From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [Patch RFC 07/13] vt-d: If the qi_flag is Set, the domain's vCPUs are not allowed to Date: Wed, 16 Sep 2015 10:44:08 +0100 Message-ID: <55F939E8.3050300@citrix.com> References: <1442409847-65383-1-git-send-email-quan.xu@intel.com> <1442409847-65383-8-git-send-email-quan.xu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442409847-65383-8-git-send-email-quan.xu@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Quan Xu , andrew.cooper3@citrix.com, eddie.dong@intel.com, ian.campbell@citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com, jun.nakajima@intel.com, keir@xen.org, kevin.tian@intel.com, tim@xen.org, yang.z.zhang@intel.com, george.dunlap@eu.citrix.com Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi Quan, On 16/09/2015 14:24, Quan Xu wrote: > diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c > index 447c650..d26b026 100644 > --- a/xen/arch/x86/x86_64/asm-offsets.c > +++ b/xen/arch/x86/x86_64/asm-offsets.c > @@ -116,6 +116,7 @@ void __dummy__(void) > BLANK(); > > OFFSET(DOMAIN_is_32bit_pv, struct domain, arch.is_32bit_pv); > + OFFSET(QI_flag, struct domain, arch.hvm_domain.hvm_iommu.qi_flag); > BLANK(); > > OFFSET(VMCB_rax, struct vmcb_struct, rax); > diff --git a/xen/common/domain.c b/xen/common/domain.c > index 1b9fcfc..1f62e3b 100644 > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -1479,6 +1479,11 @@ int continue_hypercall_on_cpu( > return 0; > } > > +void do_qi_flushing(struct domain *d) > +{ > + do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void)); SCHEDOP_yield is as wrapper to vcpu_yield() to would be called by the guest. It would be simpler to use the latter. You may even be able to call it directly from the assembly code rather than introducing is a wrapper. If not, this function should go in x86 specific code (maybe arch/x86/domain.c ?) > +} > + > /* > * Local variables: > * mode: C > diff --git a/xen/include/xen/hvm/iommu.h b/xen/include/xen/hvm/iommu.h > index e838905..e40fc7b 100644 > --- a/xen/include/xen/hvm/iommu.h > +++ b/xen/include/xen/hvm/iommu.h > @@ -57,6 +57,8 @@ struct hvm_iommu { > DECLARE_BITMAP(features, IOMMU_FEAT_count); > }; > > +void do_qi_flushing(struct domain *d); > + If you declare the function in file.c you should add the prototype in file.h. I.e as you defined the function in common/domain.c, the prototype should go in xen/domain.h. > #define iommu_set_feature(d, f) set_bit((f), domain_hvm_iommu(d)->features) > #define iommu_clear_feature(d, f) clear_bit((f), domain_hvm_iommu(d)->features) > > Regards, -- Julien Grall