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

[Xen-changelog] [xen-3.0.3-testing] [SVM] Make sure that the WP bit is always set in CR0 when running SVM guests.



# HG changeset patch
# User Steven Smith <ssmith@xxxxxxxxxxxxx>
# Date 1164276011 0
# Node ID 328b622945124508550d7571916ebad0e2cb71ba
# Parent  52ae8dd4bc751bc7f4b2abf4ddf2ce9a8ec45649
[SVM] Make sure that the WP bit is always set in CR0 when running SVM guests.
This is necessary to be sure that the shadow mode code can always detect
writes to guest page tables.

This should fix Windows restore from hibernation on SVM platforms.

Signed-off-by: Tom Woller <thomas.woller@xxxxxxx>

This corresponds to xen-unstable cset 12525:4ddda0bbb57c.
---
 xen/arch/x86/hvm/svm/svm.c  |    4 ++--
 xen/arch/x86/hvm/svm/vmcb.c |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff -r 52ae8dd4bc75 -r 328b62294512 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Tue Oct 17 22:09:52 2006 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Thu Nov 23 10:00:11 2006 +0000
@@ -1524,7 +1524,7 @@ static int svm_set_cr0(unsigned long val
     /* We don't want to lose PG.  ET is reserved and should be always be 1*/
     paging_enabled = svm_paging_enabled(v);
     value |= X86_CR0_ET;
-    vmcb->cr0 = value | X86_CR0_PG;
+    vmcb->cr0 = value | X86_CR0_PG | X86_CR0_WP;
     v->arch.hvm_svm.cpu_shadow_cr0 = value;
 
     /* TS cleared? Then initialise FPU now. */
@@ -2197,7 +2197,7 @@ static int svm_do_vmmcall_reset_to_realm
     vmcb->tsc_offset = 0;
 
     /* VMCB State */
-    vmcb->cr0 = X86_CR0_ET | X86_CR0_PG;
+    vmcb->cr0 = X86_CR0_ET | X86_CR0_PG | X86_CR0_WP;
     v->arch.hvm_svm.cpu_shadow_cr0 = X86_CR0_ET;
 
     vmcb->cr2 = 0;
diff -r 52ae8dd4bc75 -r 328b62294512 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Tue Oct 17 22:09:52 2006 +0100
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Thu Nov 23 10:00:11 2006 +0000
@@ -243,6 +243,7 @@ static int construct_init_vmcb_guest(str
     shadow_cr = vmcb->cr0;
     shadow_cr &= ~X86_CR0_PG;
     arch_svm->cpu_shadow_cr0 = shadow_cr;
+    vmcb->cr0 |= X86_CR0_WP;
 
     /* CR3 is set in svm_final_setup_guest */
 

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