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-changelog

[Xen-changelog] [xen-unstable] [HVM][VMX] Save GS_SHADOW MSR only on x86

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM][VMX] Save GS_SHADOW MSR only on x86/64.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Dec 2006 09:05:12 -0800
Delivery-date: Thu, 21 Dec 2006 09:05:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1166700159 0
# Node ID fd1ccd818f2c7da431e1e1ce9cc6ea3392f380c1
# Parent  8af3df2f4b01a047c69805886cf28fa43ffeac56
[HVM][VMX] Save GS_SHADOW MSR only on x86/64.
Bug found by Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 8af3df2f4b01 -r fd1ccd818f2c xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Thu Dec 21 11:10:43 2006 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Thu Dec 21 11:22:39 2006 +0000
@@ -277,6 +277,12 @@ static void vmx_restore_host_msrs(void)
     }
 }
 
+static void vmx_save_guest_msrs(struct vcpu *v)
+{
+    /* MSR_SHADOW_GS_BASE may have been changed by swapgs instruction. */
+    rdmsrl(MSR_SHADOW_GS_BASE, v->arch.hvm_vmx.msr_state.shadow_gs);
+}
+
 static void vmx_restore_guest_msrs(struct vcpu *v)
 {
     struct vmx_msr_state *guest_msr_state, *host_msr_state;
@@ -308,6 +314,7 @@ static void vmx_restore_guest_msrs(struc
 
 #define vmx_save_host_msrs()        ((void)0)
 #define vmx_restore_host_msrs()     ((void)0)
+#define vmx_save_guest_msrs(v)      ((void)0)
 #define vmx_restore_guest_msrs(v)   ((void)0)
 
 static inline int long_mode_do_msr_read(struct cpu_user_regs *regs)
@@ -373,10 +380,7 @@ static inline void vmx_restore_dr(struct
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
-    /* NB. MSR_SHADOW_GS_BASE may be changed by swapgs instrucion in guest,
-     * so we must save it. */
-    rdmsrl(MSR_SHADOW_GS_BASE, v->arch.hvm_vmx.msr_state.shadow_gs);
-
+    vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
     vmx_save_dr(v);
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [HVM][VMX] Save GS_SHADOW MSR only on x86/64., Xen patchbot-unstable <=