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

[Xen-changelog] [xen master] VMX: don't unintentionally leave x2APIC MSR intercepts disabled



commit 72af6f455ac6afcd46d9a556f90349f2397507e8
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Sep 16 13:58:20 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Sep 16 13:58:20 2014 +0200

    VMX: don't unintentionally leave x2APIC MSR intercepts disabled
    
    These should be re-enabled in particular when the virtualized APIC
    transitions to HW-disabled state.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 26b1ad5..d3e7ac9 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2167,6 +2167,7 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
 {
     int virtualize_x2apic_mode;
     struct vlapic *vlapic = vcpu_vlapic(v);
+    unsigned int msr;
 
     virtualize_x2apic_mode = ( (cpu_has_vmx_apic_reg_virt ||
                                 cpu_has_vmx_virtual_intr_delivery) &&
@@ -2183,8 +2184,6 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
     if ( !vlapic_hw_disabled(vlapic) &&
          (vlapic_base_address(vlapic) == APIC_DEFAULT_PHYS_BASE) )
     {
-        unsigned int msr;
-
         if ( virtualize_x2apic_mode && vlapic_x2apic_mode(vlapic) )
         {
             v->arch.hvm_vmx.secondary_exec_control |=
@@ -2213,15 +2212,15 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
             }
         }
         else
-        {
             v->arch.hvm_vmx.secondary_exec_control |=
                 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
-            for ( msr = MSR_IA32_APICBASE_MSR;
-                  msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
-                vmx_enable_intercept_for_msr(v, msr,
-                                             MSR_TYPE_R | MSR_TYPE_W);
-        }
     }
+    if ( !(v->arch.hvm_vmx.secondary_exec_control &
+           SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE) )
+        for ( msr = MSR_IA32_APICBASE_MSR;
+              msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
+            vmx_enable_intercept_for_msr(v, msr, MSR_TYPE_R | MSR_TYPE_W);
+
     vmx_update_secondary_exec_control(v);
     vmx_vmcs_exit(v);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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