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] [XEN] Fix early-unshadow detection for 3-

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Fix early-unshadow detection for 3- or 4-level guest pagetables.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Jan 2007 19:50:06 -0800
Delivery-date: Tue, 16 Jan 2007 19:49:54 -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 George Dunlap <dunlapg@xxxxxxxxx>
# Date 1168974252 18000
# Node ID fd2667419c53ce2555c799acf3e84dd25912bcb5
# Parent  895d873a00b47cb7b0edf3d0b6a42f47a3f4854c
[XEN] Fix early-unshadow detection for 3- or 4-level guest pagetables.
Early-unshadow will unshadow whenever 2 zero values are written
to the same page; for PAE, one PTE takes 2 writes.  Only check
for the early unshadow when writing the low half of the PTE.
---
 xen/arch/x86/mm/shadow/multi.c   |    4 ++--
 xen/arch/x86/mm/shadow/private.h |    5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff -r 895d873a00b4 -r fd2667419c53 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c    Tue Jan 16 10:02:50 2007 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c    Tue Jan 16 14:04:12 2007 -0500
@@ -3944,7 +3944,7 @@ sh_x86_emulate_write(struct vcpu *v, uns
     if ( !skip ) sh_validate_guest_pt_write(v, mfn, addr, bytes);
 
     /* If we are writing zeros to this page, might want to unshadow */
-    if ( likely(bytes >= 4) && (*(u32 *)addr == 0) )
+    if ( likely(bytes >= 4) && (*(u32 *)addr == 0) && is_lo_pte(vaddr) )
         check_for_early_unshadow(v, mfn);
 
     sh_unmap_domain_page(addr);
@@ -3996,7 +3996,7 @@ sh_x86_emulate_cmpxchg(struct vcpu *v, u
                   vaddr, prev, old, new, *(unsigned long *)addr, bytes);
 
     /* If we are writing zeros to this page, might want to unshadow */
-    if ( likely(bytes >= 4) && (*(u32 *)addr == 0) )
+    if ( likely(bytes >= 4) && (*(u32 *)addr == 0) && is_lo_pte(vaddr) )
         check_for_early_unshadow(v, mfn);
 
     sh_unmap_domain_page(addr);
diff -r 895d873a00b4 -r fd2667419c53 xen/arch/x86/mm/shadow/private.h
--- a/xen/arch/x86/mm/shadow/private.h  Tue Jan 16 10:02:50 2007 +0000
+++ b/xen/arch/x86/mm/shadow/private.h  Tue Jan 16 14:04:12 2007 -0500
@@ -427,6 +427,11 @@ extern int sh_remove_write_access(struct
 #undef mfn_valid
 #define mfn_valid(_mfn) (mfn_x(_mfn) < max_page)
 
+#if GUEST_PAGING_LEVELS >= 3
+# define is_lo_pte(_vaddr) (((_vaddr)&0x4)==0)
+#else
+# define is_lo_pte(_vaddr) (1)
+#endif
 
 static inline int
 sh_mfn_is_a_page_table(mfn_t gmfn)

_______________________________________________
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] [XEN] Fix early-unshadow detection for 3- or 4-level guest pagetables., Xen patchbot-unstable <=