From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhang, Yang Z" Subject: Re: [PATCH for 4.6 07/13] xen: Introduce a generic way to describe device Date: Thu, 18 Dec 2014 01:12:53 +0000 Message-ID: References: <1418760534-18163-1-git-send-email-julien.grall@linaro.org> <1418760534-18163-8-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Y1Peo-0007dD-HI for xen-devel@lists.xenproject.org; Thu, 18 Dec 2014 01:13:34 +0000 In-Reply-To: <1418760534-18163-8-git-send-email-julien.grall@linaro.org> Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall , "xen-devel@lists.xenproject.org" Cc: Keir Fraser , "ian.campbell@citrix.com" , "manish.jaggi@caviumnetworks.com" , "tim@xen.org" , "stefano.stabellini@citrix.com" , Jan Beulich List-Id: xen-devel@lists.xenproject.org Julien Grall wrote on 2014-12-17: > diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index > 5f295f3..6ace79d 100644 > --- a/xen/include/xen/pci.h > +++ b/xen/include/xen/pci.h > @@ -13,6 +13,7 @@ > #include #include #include > +#include #include > > /* @@ -75,8 +76,19 @@ struct pci_dev { #define PT_FAULT_THRESHOLD 10 > } fault; > u64 vf_rlen[6]; > + > + struct device dev; > }; > +#define pci_to_dev(pcidev) (&(pcidev)->dev) > + > +static inline struct pci_dev *dev_to_pci(struct device *dev) { > + ASSERT(dev->type == DEV_PCI); > + > + return container_of(dev, struct pci_dev, dev); } > + > #define for_each_pdev(domain, pdev) \ > list_for_each_entry(pdev, &(domain->arch.pdev_list), domain_list) I'd suggest splitting the changes to common code to a separate patch and also CC the VT-d/AMD maintainers. Because I didn't find those definitions when reviewing the 8th patch and I need to search the whole patch set to find them. Best regards, Yang