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

[Xen-changelog] [xen-unstable] Since shadow_update_paging_modes() will modify v->arch.hvm_vcpu.hw_cr3,



# HG changeset patch
# User Tim Deegan <tim.deegan@xxxxxxxxxxxxx>
# Node ID b92104e0cf08256a818a7d902326898583f13ad8
# Parent  a5469bf602efda2d208ef7b7e9b9ecb934e7415c
Since shadow_update_paging_modes() will modify v->arch.hvm_vcpu.hw_cr3,
so we should always do shadow_update_paging_modes() before we writes to
GUEST_CR3 with v->arch.hvm_vcpu.hw_cr3.

Signed-off-by: Xiaohui Xin xiaohui.xin@xxxxxxxxx
Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -r a5469bf602ef -r b92104e0cf08 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Sun Oct 08 18:05:57 2006 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Mon Oct 09 10:18:11 2006 +0100
@@ -1250,7 +1250,7 @@ static int vmx_world_save(struct vcpu *v
 
 static int vmx_world_restore(struct vcpu *v, struct vmx_assist_context *c)
 {
-    unsigned long mfn, old_cr4, old_base_mfn;
+    unsigned long mfn, old_base_mfn;
     int error = 0;
 
     error |= __vmwrite(GUEST_RIP, c->eip);
@@ -1304,9 +1304,7 @@ static int vmx_world_restore(struct vcpu
         HVM_DBG_LOG(DBG_LEVEL_VMMU, "switching to vmxassist. use phys table");
     else
         HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %x", c->cr3);
-    __vmwrite(GUEST_CR3, v->arch.hvm_vcpu.hw_cr3);
-
-    error |= __vmread(CR4_READ_SHADOW, &old_cr4);
+
     error |= __vmwrite(GUEST_CR4, (c->cr4 | VMX_CR4_HOST_MASK));
     error |= __vmwrite(CR4_READ_SHADOW, c->cr4);
 
@@ -1357,6 +1355,7 @@ static int vmx_world_restore(struct vcpu
     error |= __vmwrite(GUEST_LDTR_AR_BYTES, c->ldtr_arbytes.bytes);
 
     shadow_update_paging_modes(v);
+    __vmwrite(GUEST_CR3, v->arch.hvm_vcpu.hw_cr3);
 
     return !error;
 }
@@ -1572,8 +1571,8 @@ static int vmx_set_cr0(unsigned long val
     }
     else if ( (value & (X86_CR0_PE | X86_CR0_PG)) == X86_CR0_PE )
     {
+        shadow_update_paging_modes(v);
         __vmwrite(GUEST_CR3, v->arch.hvm_vcpu.hw_cr3);
-        shadow_update_paging_modes(v);
     }
 
     return 1;

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