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

[Xen-devel] [PATCH] Need to save and restore MSRs for VMX domains across context switches.



Need to save and restore MSRs for VMX domains across context switches.

Signed-off-by: Yunhong Jiang <yunhong.jiang@xxxxxxxxx>
Signed-off-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

diff -r ea18bec15d36 -r f63f9aa5fff7 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Jul 12 19:40:36 2005
+++ b/xen/arch/x86/domain.c     Tue Jul 12 23:26:43 2005
@@ -640,9 +640,21 @@
     }
 }
 
+static inline void vmx_save_segments(struct vcpu *v)
+{
+    struct msr_state *guest_state;
+
+    guest_state = &v->arch.arch_vmx.msr_content;
+    rdmsrl(MSR_SHADOW_GS_BASE, guest_state->shadow_gs);
+}
+
 static void save_segments(struct vcpu *v)
 {
     struct cpu_user_regs *regs = &v->arch.guest_context.user_regs;
+
+    if (VMX_DOMAIN(v)) 
+        vmx_save_segments(v); 
+
     __asm__ __volatile__ ( "movl %%ds,%0" : "=m" (regs->ds) );
     __asm__ __volatile__ ( "movl %%es,%0" : "=m" (regs->es) );
     __asm__ __volatile__ ( "movl %%fs,%0" : "=m" (regs->fs) );
@@ -796,6 +808,8 @@
             load_LDT(next);
             load_segments(realprev, next);
             load_msrs(realprev, next);
+        } else {
+            vmx_restore_msrs(next);
         }
     }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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