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-3.0.3-testing] [SVM] Make sure that the WP bit is a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0.3-testing] [SVM] Make sure that the WP bit is always set in CR0 when running SVM guests.
From: "Xen patchbot-3.0.3-testing" <patchbot-3.0.3-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Nov 2006 04:50:13 -0800
Delivery-date: Thu, 23 Nov 2006 04:51:00 -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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0.3-testing] [SVM] Make sure that the WP bit is always set in CR0 when running SVM guests., Xen patchbot-3.0.3-testing <=