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] Propagate guest MSR writes to machine MSRs immediately

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Propagate guest MSR writes to machine MSRs immediately
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Jul 2005 10:00:09 -0400
Delivery-date: Thu, 21 Jul 2005 14:00:33 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID dd3dbd7c82e01724e563f9262f85dfccbc306046
# Parent  c7f883aaedb076e26577d21ab9d262dd24eb30d6

Propagate guest MSR writes to machine MSRs immediately

Right now, we have an exposure between the time the MSR is written
and used by an instruction such as syscall. If there is a context
switch and we do vmx_do_restore_msrs(), everything goes fine. But
if we don't, then we execute the syscall with the wrong MSR.

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

diff -r c7f883aaedb0 -r dd3dbd7c82e0 xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c        Wed Jul 20 19:45:05 2005
+++ b/xen/arch/x86/vmx.c        Thu Jul 21 13:59:08 2005
@@ -94,12 +94,16 @@
     msr_content = msr->msr_items[VMX_INDEX_MSR_ ## address]; \
     break
 
-#define CASE_WRITE_MSR(address)   \
-    case MSR_ ## address:                   \
-    msr->msr_items[VMX_INDEX_MSR_ ## address] = msr_content; \
-    if (!test_bit(VMX_INDEX_MSR_ ## address, &msr->flags)){ \
-       set_bit(VMX_INDEX_MSR_ ## address, &msr->flags);   \
-    }\
+#define CASE_WRITE_MSR(address)                                     \
+    case MSR_ ## address:                                           \
+    {                                                               \
+        msr->msr_items[VMX_INDEX_MSR_ ## address] = msr_content;    \
+        if (!test_bit(VMX_INDEX_MSR_ ## address, &msr->flags)) {    \
+            set_bit(VMX_INDEX_MSR_ ## address, &msr->flags);        \
+        }                                                           \
+        wrmsrl(MSR_ ## address, msr_content);                       \
+        set_bit(VMX_INDEX_MSR_ ## address, &host_state->flags);     \
+    }                                                               \
     break
 
 #define IS_CANO_ADDRESS(add) 1
@@ -1261,6 +1265,7 @@
         CASE_SET_REG(EBP, ebp);
         CASE_SET_REG(ESI, esi);
         CASE_SET_REG(EDI, edi);
+        CASE_EXTEND_SET_REG
     case REG_ESP:
         __vmwrite(GUEST_RSP, value);
         regs->esp = value;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Propagate guest MSR writes to machine MSRs immediately, Xen patchbot -unstable <=