All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Need to save and restore MSRs for VMX domains across context switches.
@ 2005-07-12 23:39 Arun Sharma
  0 siblings, 0 replies; only message in thread
From: Arun Sharma @ 2005-07-12 23:39 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser; +Cc: xen-devel

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

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

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);
         }
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-12 23:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-12 23:39 [PATCH] Need to save and restore MSRs for VMX domains across context switches Arun Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.