WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Need to save and restore MSRs for VMX domains across context switches.
From: Arun Sharma <arun.sharma@xxxxxxxxx>
Date: Tue, 12 Jul 2005 16:39:52 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 12 Jul 2005 23:33:51 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Need to save and restore MSRs for VMX domains across context switches., Arun Sharma <=