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

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



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 6778d68a2c4cea49bccc90ead12395ee28d61189
# Parent  3a4ef6acd5451499b604fd36035eaa435dc5d2c3

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 3a4ef6acd545 -r 6778d68a2c4c xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Wed Jul 13 08:25:08 2005
+++ b/xen/arch/x86/domain.c     Wed Jul 13 08:36:38 2005
@@ -643,6 +643,10 @@
 static void save_segments(struct vcpu *v)
 {
     struct cpu_user_regs *regs = &v->arch.guest_context.user_regs;
+
+    if ( VMX_DOMAIN(v) )
+        rdmsrl(MSR_SHADOW_GS_BASE, v->arch.arch_vmx.msr_content.shadow_gs);
+
     __asm__ __volatile__ ( "movl %%ds,%0" : "=m" (regs->ds) );
     __asm__ __volatile__ ( "movl %%es,%0" : "=m" (regs->es) );
     __asm__ __volatile__ ( "movl %%fs,%0" : "=m" (regs->fs) );
@@ -791,7 +795,11 @@
 
         local_irq_enable();
         
-        if ( !VMX_DOMAIN(next) )
+        if ( VMX_DOMAIN(next) )
+        {
+            vmx_restore_msrs(next);
+        }
+        else
         {
             load_LDT(next);
             load_segments(realprev, next);

_______________________________________________
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®.