[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] VMX: permanently assign PI hook vmx_pi_switch_to()



commit 7c00de17562e28f01e188c6a2c240ebc21b9d4b7
Author:     Feng Wu <feng.wu@xxxxxxxxx>
AuthorDate: Fri Mar 3 11:57:30 2017 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Mar 3 11:57:30 2017 +0100

    VMX: permanently assign PI hook vmx_pi_switch_to()
    
    PI hook vmx_pi_switch_to() is needed even after any previously
    assigned device is detached from the domain. Since 'SN' bit is
    also used to control the CPU side PI and we change the state of
    SN bit in vmx_pi_switch_to() and vmx_pi_switch_from(), then
    evaluate this bit in vmx_deliver_posted_intr() when trying to
    deliver the interrupt in posted way via software. The problem
    is if we deassign the hooks while the vCPU is runnable in the
    runqueue with 'SN' set, all the furture notificaton event will
    be suppressed. This patch makes the hook permanently assigned.
    
    Signed-off-by: Feng Wu <feng.wu@xxxxxxxxx>
    Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>).
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index b3d274b..e9f75d7 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -259,9 +259,22 @@ void vmx_pi_hooks_deassign(struct domain *d)
 
     ASSERT(d->arch.hvm_domain.pi_ops.vcpu_block);
 
+    /*
+     * Note that we don't set 'd->arch.hvm_domain.pi_ops.switch_to' to NULL
+     * here. If we deassign the hooks while the vCPU is runnable in the
+     * runqueue with 'SN' set, all the future notification event will be
+     * suppressed since vmx_deliver_posted_intr() also use 'SN' bit
+     * as the suppression flag. Preserving the 'switch_to' hook function can
+     * clear the 'SN' bit when the vCPU becomes running next time. After
+     * that, No matter which status(runnable, running or block) the vCPU is in,
+     * the 'SN' bit will keep clear for the 'switch_from' hook function that 
set
+     * the 'SN' bit has been removed. At that time, the 'switch_to' hook 
function
+     * is also useless. Considering the function doesn't do harm to the whole
+     * system, leave it here until we find a clean solution to deassign the
+     * 'switch_to' hook function.
+     */
     d->arch.hvm_domain.pi_ops.vcpu_block = NULL;
     d->arch.hvm_domain.pi_ops.switch_from = NULL;
-    d->arch.hvm_domain.pi_ops.switch_to = NULL;
     d->arch.hvm_domain.pi_ops.do_resume = NULL;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.