Skip to contentSkip to conversation

nested vmx: nested TPR shadow/threshold emulation

PATCH New Dongxiao Xu 1 participant 1 message Dec 18, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nested vmx: nested TPR shadow/threshold emulation

TPR shadow/threshold feature is important to speedup the boot time for Windows guest. Besides, it is a must feature for certain VMM.

We map virtual APIC page address and TPR threshold from L1 VMCS, and synch it into shadow VMCS in virtual vmentry.
If TPR_BELOW_THRESHOLD VM exit is triggered by L2 guest, we inject it into L1 VMM for handling.

Besides, this commit fixes an issue for apic access page, if L1 VMM didn't enable this feature, we need to fill zero into the shadow VMCS.

---
 xen/arch/x86/hvm/vmx/intr.c |    4 +++-
 xen/arch/x86/hvm/vmx/vvmx.c |   43 +++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 44 insertions(+), 3 deletions(-)
xen/arch/x86/hvm/vmx/intr.c +3 -1
index 535248a..c5c503e 100644
@@ -324,7 +324,9 @@ void vmx_intr_assist(void)
     }
 
  out:
-    if ( !cpu_has_vmx_virtual_intr_delivery && cpu_has_vmx_tpr_shadow )
+    if ( !nestedhvm_vcpu_in_guestmode(v) &&
+         !cpu_has_vmx_virtual_intr_delivery &&
+         cpu_has_vmx_tpr_shadow )
         __vmwrite(TPR_THRESHOLD, tpr_threshold);
 }
 
xen/arch/x86/hvm/vmx/vvmx.c +41 -2

73 lines not on this page · raw message

Signature · 1 line
1.7.1