Message ID | 1464269954-8056-3-git-send-email-feng.wu@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 26.05.16 at 15:39, <feng.wu@intel.com> wrote: > --- a/xen/arch/x86/hvm/vmx/vmx.c > +++ b/xen/arch/x86/hvm/vmx/vmx.c > @@ -366,6 +366,7 @@ static void vmx_vcpu_destroy(struct vcpu *v) > vmx_destroy_vmcs(v); > vpmu_destroy(v); > passive_domain_destroy(v); > + vmx_pi_blocking_cleanup(v); > } Isn't this redundant with the cleanup done when the last device gets removed (via pci_release_devices()) during domain cleanup? Jan
> -----Original Message----- > From: Jan Beulich [mailto:JBeulich@suse.com] > Sent: Friday, May 27, 2016 9:49 PM > To: Wu, Feng <feng.wu@intel.com> > Cc: andrew.cooper3@citrix.com; dario.faggioli@citrix.com; > george.dunlap@eu.citrix.com; Tian, Kevin <kevin.tian@intel.com>; xen- > devel@lists.xen.org; konrad.wilk@oracle.com; keir@xen.org > Subject: Re: [PATCH v2 2/4] VMX: Cleanup PI per-cpu blocking list when vcpu is > destroyed > > >>> On 26.05.16 at 15:39, <feng.wu@intel.com> wrote: > > --- a/xen/arch/x86/hvm/vmx/vmx.c > > +++ b/xen/arch/x86/hvm/vmx/vmx.c > > @@ -366,6 +366,7 @@ static void vmx_vcpu_destroy(struct vcpu *v) > > vmx_destroy_vmcs(v); > > vpmu_destroy(v); > > passive_domain_destroy(v); > > + vmx_pi_blocking_cleanup(v); > > } > > Isn't this redundant with the cleanup done when the last device > gets removed (via pci_release_devices()) during domain cleanup? We need to handle the following two cases: - the last device gets removed (via 'xl pci-detach ...'), and the guest is running after that. The logical in vmx_pi_hooks_deassign() cover this case. - the guest is shutting down. It is covered here. Thanks, Feng > > Jan
>>> On 31.05.16 at 12:22, <feng.wu@intel.com> wrote: > >> -----Original Message----- >> From: Jan Beulich [mailto:JBeulich@suse.com] >> Sent: Friday, May 27, 2016 9:49 PM >> To: Wu, Feng <feng.wu@intel.com> >> Cc: andrew.cooper3@citrix.com; dario.faggioli@citrix.com; >> george.dunlap@eu.citrix.com; Tian, Kevin <kevin.tian@intel.com>; xen- >> devel@lists.xen.org; konrad.wilk@oracle.com; keir@xen.org >> Subject: Re: [PATCH v2 2/4] VMX: Cleanup PI per-cpu blocking list when vcpu > is >> destroyed >> >> >>> On 26.05.16 at 15:39, <feng.wu@intel.com> wrote: >> > --- a/xen/arch/x86/hvm/vmx/vmx.c >> > +++ b/xen/arch/x86/hvm/vmx/vmx.c >> > @@ -366,6 +366,7 @@ static void vmx_vcpu_destroy(struct vcpu *v) >> > vmx_destroy_vmcs(v); >> > vpmu_destroy(v); >> > passive_domain_destroy(v); >> > + vmx_pi_blocking_cleanup(v); >> > } >> >> Isn't this redundant with the cleanup done when the last device >> gets removed (via pci_release_devices()) during domain cleanup? > > We need to handle the following two cases: > - the last device gets removed (via 'xl pci-detach ...'), and the guest > is running after that. The logical in vmx_pi_hooks_deassign() cover > this case. > - the guest is shutting down. It is covered here. Exactly. Yet that latter case is already being taken care of by the former: When the guest is shutting down, its last device will get removed anyway. Jan
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 65f5288..b01128a 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -366,6 +366,7 @@ static void vmx_vcpu_destroy(struct vcpu *v) vmx_destroy_vmcs(v); vpmu_destroy(v); passive_domain_destroy(v); + vmx_pi_blocking_cleanup(v); } static DEFINE_PER_CPU(struct vmx_msr_state, host_msr_state);
We should remove the vCPU from the per-cpu blocking list if it is going to be destroyed. Signed-off-by: Feng Wu <feng.wu@intel.com> --- xen/arch/x86/hvm/vmx/vmx.c | 1 + 1 file changed, 1 insertion(+)