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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [SVM] Make sure that the WP bit is always set in CR0 when running SVM guests.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Nov 2006 11:00:33 +0000
Delivery-date: Thu, 23 Nov 2006 03:00:12 -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>
# Node ID 4ddda0bbb57c025b8620af613def2c2bbb8b77ae
# Parent  2ef0f17a9af9b6b3b2f76460e0f9da5112c0bd79
[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>
---
 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 2ef0f17a9af9 -r 4ddda0bbb57c xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Wed Nov 22 18:36:48 2006 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c        Thu Nov 23 09:36:48 2006 +0000
@@ -1441,7 +1441,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. */
@@ -2094,7 +2094,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 2ef0f17a9af9 -r 4ddda0bbb57c xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Wed Nov 22 18:36:48 2006 +0000
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Thu Nov 23 09:36:48 2006 +0000
@@ -197,6 +197,7 @@ static int construct_vmcb(struct vcpu *v
     /* Guest CR0. */
     vmcb->cr0 = read_cr0();
     arch_svm->cpu_shadow_cr0 = vmcb->cr0 & ~(X86_CR0_PG | X86_CR0_TS);
+    vmcb->cr0 |= X86_CR0_WP;
 
     /* Guest CR4. */
     arch_svm->cpu_shadow_cr4 =

_______________________________________________
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] [SVM] Make sure that the WP bit is always set in CR0 when running SVM guests., Xen patchbot-unstable <=