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

[Xen-changelog] [xen-unstable] vmx: Fix c/s 21433:095e4b964f99: Must save host MSRs on cpu init



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1274945684 -3600
# Node ID 7fb801ac0a5951115d0da82e73f8681b1ae71b3a
# Parent  946b892a8ad7ebabb40a6004ad8d883768233834
vmx: Fix c/s 21433:095e4b964f99: Must save host MSRs on cpu init

Original patch by Dulloor <dulloor@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 ++
 xen/arch/x86/hvm/vmx/vmx.c         |    6 ++----
 xen/include/asm-x86/hvm/vmx/vmcs.h |    1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff -r 946b892a8ad7 -r 7fb801ac0a59 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Thu May 27 08:26:52 2010 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Thu May 27 08:34:44 2010 +0100
@@ -430,6 +430,8 @@ int vmx_cpu_up(void)
     u64 cr0, vmx_cr0_fixed0, vmx_cr0_fixed1;
 
     BUG_ON(!(read_cr4() & X86_CR4_VMXE));
+
+    vmx_save_host_msrs();
 
     /* 
      * Ensure the current processor operating mode meets 
diff -r 946b892a8ad7 -r 7fb801ac0a59 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Thu May 27 08:26:52 2010 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Thu May 27 08:34:44 2010 +0100
@@ -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(struc
 
 #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_
 
 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);
 
diff -r 946b892a8ad7 -r 7fb801ac0a59 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h        Thu May 27 08:26:52 2010 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h        Thu May 27 08:34:44 2010 +0100
@@ -29,6 +29,7 @@ extern void vmx_cpu_dead(unsigned int cp
 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;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.