]> xenbits.xensource.com Git - xen.git/commitdiff
vmx: Fix c/s 21433:095e4b964f99: Must save host MSRs on cpu init
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 27 May 2010 07:34:44 +0000 (08:34 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 27 May 2010 07:34:44 +0000 (08:34 +0100)
Original patch by Dulloor <dulloor@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vmx/vmcs.h

index 2d0b45bad12b27d420d7b80447da07961d2648b7..e74032a9d235abb2fca2ec90f96a840e3b4a994f 100644 (file)
@@ -431,6 +431,8 @@ int vmx_cpu_up(void)
 
     BUG_ON(!(read_cr4() & X86_CR4_VMXE));
 
+    vmx_save_host_msrs();
+
     /* 
      * Ensure the current processor operating mode meets 
      * the requred CRO fixed bits in VMX operation. 
index 48cc3b59b359b0d972c4cdd7a1e9075534655f84..d60a552ca20297982e3b2c5694d659529fbf3fc0 100644 (file)
@@ -144,7 +144,7 @@ static u32 msr_index[] =
 
 #define MSR_INDEX_SIZE (ARRAY_SIZE(msr_index))
 
-static void vmx_save_host_msrs(void)
+void vmx_save_host_msrs(void)
 {
     struct vmx_msr_state *host_msr_state = &this_cpu(host_msr_state);
     int i;
@@ -343,7 +343,7 @@ static void vmx_restore_guest_msrs(struct vcpu *v)
 
 #else  /* __i386__ */
 
-#define vmx_save_host_msrs()        ((void)0)
+void vmx_save_host_msrs(void) {}
 #define vmx_restore_host_msrs()     ((void)0)
 
 #define vmx_save_guest_msrs(v)      ((void)0)
@@ -1415,8 +1415,6 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
 
 struct hvm_function_table * __init start_vmx(void)
 {
-    vmx_save_host_msrs();
-
     /* Xen does not fill x86_capability words except 0. */
     boot_cpu_data.x86_capability[4] = cpuid_ecx(1);
 
index 389531b79dbbf9e3fb11806bbad840edb05a483d..535830f7d3bd7ad3e75b811514de6cd3387f6cfe 100644 (file)
@@ -29,6 +29,7 @@ extern int  vmx_cpu_up_prepare(unsigned int cpu);
 extern void vmx_cpu_dead(unsigned int cpu);
 extern int  vmx_cpu_up(void);
 extern void vmx_cpu_down(void);
+extern void vmx_save_host_msrs(void);
 
 struct vmcs_struct {
     u32 vmcs_revision_id;