From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Xu, Quan" Subject: Re: [PATCH v2 2/2] VT-d: Fix vt-d flush timeout issue. Date: Fri, 11 Dec 2015 05:37:49 +0000 Message-ID: <945CA011AD5F084CBEA3E851C0AB28894AE59114@SHSMSX103.ccr.corp.intel.com> References: <1449739990-66155-1-git-send-email-quan.xu@intel.com> <1449739990-66155-3-git-send-email-quan.xu@intel.com> <5669CCED.6000609@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5669CCED.6000609@citrix.com> 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: Andrew Cooper Cc: "Tian, Kevin" , "Wu, Feng" , "jbeulich@suse.com" , "george.dunlap@eu.citrix.com" , "Dong, Eddie" , "tim@xen.org" , "xen-devel@lists.xen.org" , "Nakajima, Jun" , "keir@xen.org" List-Id: xen-devel@lists.xenproject.org On 11.12.2015 at 3:05pm, Andrew Cooper wrote: > On 10/12/15 09:33, Quan Xu wrote: > > diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index > > a5aef55..0bf6b1a 100644 > > --- a/xen/include/xen/pci.h > > +++ b/xen/include/xen/pci.h > > @@ -41,6 +41,7 @@ > > struct pci_dev_info { > > bool_t is_extfn; > > bool_t is_virtfn; > > + bool_t is_unassignable; > > struct { > > u8 bus; > > u8 devfn; > > @@ -88,6 +89,12 @@ struct pci_dev { > > #define for_each_pdev(domain, pdev) \ > > list_for_each_entry(pdev, &(domain->arch.pdev_list), domain_list) > > > > +#define PDEV_UNASSIGNABLE 1 > > +#define mark_pdev_unassignable(pdev) \ > > + pdev->info.is_unassignable = PDEV_UNASSIGNABLE > > + > > +#define IS_PDEV_UNASSIGNABLE(pdev) pdev->info.is_unassignable > > Static inlines please. > > These macros lack any hygene whatsoever, but don't need to be macros in the > first place. > Andrew, Could I modify it as below: +static inline void mark_pdev_unassignable(struct pci_dev *pdev) +{ + pdev->info.is_unassignable = 1; +} + +static inline bool_t is_pdev_unassignable(struct pci_dev *pdev) +{ + return pdev->info.is_unassignable; +} Correct me If I still don't get the point. Thanks. -Quan