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-testing] [HVM] Fix shadow mode to not corrupt f

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0-testing] [HVM] Fix shadow mode to not corrupt frame 0's page_info struct.
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 03 Jun 2006 00:01:21 +0000
Delivery-date: Fri, 02 Jun 2006 17:02:59 -0700
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID b6a04d27b6e16cf16a3bdbad61a00719df62b8d3
# Parent  18e8e613deb9050de02eb8ba9138185e33240e7f
[HVM] Fix shadow mode to not corrupt frame 0's page_info struct.
Signed-off-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>
xen-unstable changeset:   10189:ec1e371ec3208f771595da6c82baae4cd9a441f5
xen-unstable date:        Wed May 31 07:25:59 2006 +0100
---
 xen/arch/x86/shadow.c        |    3 ++-
 xen/arch/x86/shadow32.c      |    3 ++-
 xen/include/asm-x86/shadow.h |   12 +++++++++---
 3 files changed, 13 insertions(+), 5 deletions(-)

diff -r 18e8e613deb9 -r b6a04d27b6e1 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Tue May 30 18:14:05 2006 +0100
+++ b/xen/arch/x86/shadow.c     Wed May 31 07:32:04 2006 +0100
@@ -1688,7 +1688,8 @@ static int resync_all(struct domain *d, 
                         unshadow_l1 = 1;
                     else {
                         need_flush |= error;
-                        set_guest_back_ptr(d, *sl1e_p, smfn, i);
+                        if ( l1e_get_flags(*sl1e_p) & _PAGE_PRESENT )
+                            set_guest_back_ptr(d, *sl1e_p, smfn, i);
                     }
                     // can't update snapshots of linear page tables -- they
                     // are used multiple times...
diff -r 18e8e613deb9 -r b6a04d27b6e1 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Tue May 30 18:14:05 2006 +0100
+++ b/xen/arch/x86/shadow32.c   Wed May 31 07:32:04 2006 +0100
@@ -2678,7 +2678,8 @@ static int resync_all(struct domain *d, 
                         unshadow_l1 = 1;
                     else {
                         need_flush |= error;
-                        set_guest_back_ptr(d, shadow1[i], smfn, i);
+                        if ( l1e_get_flags(shadow1[i]) & _PAGE_PRESENT )
+                            set_guest_back_ptr(d, shadow1[i], smfn, i);
                     }
 
                     // can't update snapshots of linear page tables -- they
diff -r 18e8e613deb9 -r b6a04d27b6e1 xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      Tue May 30 18:14:05 2006 +0100
+++ b/xen/include/asm-x86/shadow.h      Wed May 31 07:32:04 2006 +0100
@@ -762,10 +762,16 @@ static inline void set_guest_back_ptr(
         unsigned long gmfn;
 
         ASSERT(shadow_lock_is_acquired(d));
+        ASSERT( smfn );
         gmfn = l1e_get_pfn(spte);
-        mfn_to_page(gmfn)->tlbflush_timestamp = smfn;
-        mfn_to_page(gmfn)->u.inuse.type_info &= ~PGT_va_mask;
-        mfn_to_page(gmfn)->u.inuse.type_info |= (unsigned long) index << 
PGT_va_shift;
+        ASSERT( gmfn );
+        if ( l1e_get_flags(spte) & _PAGE_RW )
+        {
+            mfn_to_page(gmfn)->tlbflush_timestamp = smfn;
+            mfn_to_page(gmfn)->u.inuse.type_info &= ~PGT_va_mask;
+            mfn_to_page(gmfn)->u.inuse.type_info |= 
+                (unsigned long) index << PGT_va_shift;
+        }
     }
 }
 

_______________________________________________
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-testing] [HVM] Fix shadow mode to not corrupt frame 0's page_info struct., Xen patchbot-3 . 0-testing <=