Re: [Xen-devel] [PATCH 2/3] VMX: Make hook pi_do_resume always available
On Mon, 2016-05-23 at 06:32 -0600, Jan Beulich wrote: > > > > On 20.05.16 at 10:53,wrote: > > @@ -247,13 +246,14 @@ void vmx_pi_hooks_deassign(struct domain *d) > > d->arch.hvm_domain.vmx.vcpu_block = NULL; > > d->arch.hvm_domain.vmx.pi_switch_from = NULL; > > d->arch.hvm_domain.vmx.pi_switch_to = NULL; > > -d->arch.hvm_domain.vmx.pi_do_resume = NULL; > > } > > > > static int vmx_domain_initialise(struct domain *d) > > { > > int rc; > > > > +d->arch.hvm_domain.vmx.pi_do_resume = vmx_pi_do_resume; > > + > > if ( !has_vlapic(d) ) > > return 0; > Along the lines of what I said last in for 1/3: There's no need to > always install the hook. For your purpose it ought to suffice to > simply not zap it upon device de-assign (which would still leave > all VMs without passed through devices without such useless to > them hook in place). > FWIW, +1 to this. Dario -- <> (Raistlin Majere) - Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R Ltd., Cambridge (UK) signature.asc Description: This is a digitally signed message part ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH 2/3] VMX: Make hook pi_do_resume always available
>>> On 20.05.16 at 10:53,wrote: > --- a/xen/arch/x86/hvm/vmx/vmx.c > +++ b/xen/arch/x86/hvm/vmx/vmx.c > @@ -233,7 +233,6 @@ void vmx_pi_hooks_assign(struct domain *d) > d->arch.hvm_domain.vmx.vcpu_block = vmx_vcpu_block; > d->arch.hvm_domain.vmx.pi_switch_from = vmx_pi_switch_from; > d->arch.hvm_domain.vmx.pi_switch_to = vmx_pi_switch_to; > -d->arch.hvm_domain.vmx.pi_do_resume = vmx_pi_do_resume; > } > > /* This function is called when pcidevs_lock is held */ > @@ -247,13 +246,14 @@ void vmx_pi_hooks_deassign(struct domain *d) > d->arch.hvm_domain.vmx.vcpu_block = NULL; > d->arch.hvm_domain.vmx.pi_switch_from = NULL; > d->arch.hvm_domain.vmx.pi_switch_to = NULL; > -d->arch.hvm_domain.vmx.pi_do_resume = NULL; > } > > static int vmx_domain_initialise(struct domain *d) > { > int rc; > > +d->arch.hvm_domain.vmx.pi_do_resume = vmx_pi_do_resume; > + > if ( !has_vlapic(d) ) > return 0; Along the lines of what I said last in for 1/3: There's no need to always install the hook. For your purpose it ought to suffice to simply not zap it upon device de-assign (which would still leave all VMs without passed through devices without such useless to them hook in place). Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [PATCH 2/3] VMX: Make hook pi_do_resume always available
Make hook pi_do_resume always available, so when the last assigned device is dettached from a domain, the blocked vcpu can be removed from the per-cpu blocking list properly. Signed-off-by: Feng Wu--- xen/arch/x86/hvm/vmx/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 3fbc7b1..4862b13 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -233,7 +233,6 @@ void vmx_pi_hooks_assign(struct domain *d) d->arch.hvm_domain.vmx.vcpu_block = vmx_vcpu_block; d->arch.hvm_domain.vmx.pi_switch_from = vmx_pi_switch_from; d->arch.hvm_domain.vmx.pi_switch_to = vmx_pi_switch_to; -d->arch.hvm_domain.vmx.pi_do_resume = vmx_pi_do_resume; } /* This function is called when pcidevs_lock is held */ @@ -247,13 +246,14 @@ void vmx_pi_hooks_deassign(struct domain *d) d->arch.hvm_domain.vmx.vcpu_block = NULL; d->arch.hvm_domain.vmx.pi_switch_from = NULL; d->arch.hvm_domain.vmx.pi_switch_to = NULL; -d->arch.hvm_domain.vmx.pi_do_resume = NULL; } static int vmx_domain_initialise(struct domain *d) { int rc; +d->arch.hvm_domain.vmx.pi_do_resume = vmx_pi_do_resume; + if ( !has_vlapic(d) ) return 0; -- 2.1.0 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel