Nested VMX: Check whether interrupt is blocked by TPR
authorYang Zhang <yang.z.zhang@Intel.com>
Thu, 22 Aug 2013 08:49:24 +0000 (10:49 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 22 Aug 2013 08:49:24 +0000 (10:49 +0200)
If interrupt is blocked by L1's TPR, L2 should not see it and keep
running. Adding the check before L2 to retrive interrupt.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Acked-by: "Dong, Eddie" <eddie.dong@intel.com>
xen/arch/x86/hvm/vmx/intr.c

index e376f3c4ee664e3faa048206686370c1030857a8..cab91094f4e633825b0c91c6b9689cd45de9ea02 100644 (file)
@@ -165,6 +165,11 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 {
     u32 ctrl;
 
+    /* If blocked by L1's tpr, then nothing to do. */
+    if ( nestedhvm_vcpu_in_guestmode(v) &&
+         hvm_interrupt_blocked(v, intack) == hvm_intblk_tpr )
+        return 1;
+
     if ( nvmx_intr_blocked(v) != hvm_intblk_none )
     {
         enable_intr_window(v, intack);