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 set_guest_back_ptr to ignore

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0-testing] [HVM] Fix set_guest_back_ptr to ignore empty PTEs.
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 03 Jun 2006 00:01:27 +0000
Delivery-date: Fri, 02 Jun 2006 17:03:34 -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 29ed4e0fdeae52cb19c4425cff182046a050249e
# Parent  648bb8901eda44dc04b744c0eca72685cac73065
[HVM] Fix set_guest_back_ptr to ignore empty PTEs.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset:   10237:121ec8b952d33a358e6c6ab65493e0b47e56781d
xen-unstable date:        Thu Jun 01 10:50:33 2006 +0100
---
 xen/include/asm-x86/shadow.h |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff -r 648bb8901eda -r 29ed4e0fdeae xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      Thu Jun 01 10:59:50 2006 +0100
+++ b/xen/include/asm-x86/shadow.h      Thu Jun 01 11:00:13 2006 +0100
@@ -756,23 +756,26 @@ shadow_unpin(unsigned long smfn)
  * when working on finer-gained locks for shadow.
  */
 static inline void set_guest_back_ptr(
-    struct domain *d, l1_pgentry_t spte, unsigned long smfn, unsigned int 
index)
-{
-    if ( shadow_mode_external(d) ) {
-        unsigned long gmfn;
-
-        ASSERT(shadow_lock_is_acquired(d));
-        ASSERT( smfn );
-        gmfn = l1e_get_pfn(spte);
-        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;
-        }
-    }
+    struct domain *d, l1_pgentry_t spte,
+    unsigned long smfn, unsigned int index)
+{
+    struct page_info *gpage;
+
+    ASSERT(shadow_lock_is_acquired(d));
+
+    if ( !shadow_mode_external(d) || 
+         ((l1e_get_flags(spte) & (_PAGE_PRESENT|_PAGE_RW)) !=
+          (_PAGE_PRESENT|_PAGE_RW)) )
+        return;
+
+    gpage = l1e_get_page(spte);
+
+    ASSERT(smfn != 0);
+    ASSERT(page_to_mfn(gpage) != 0);
+
+    gpage->tlbflush_timestamp = smfn;
+    gpage->u.inuse.type_info &= ~PGT_va_mask;
+    gpage->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 set_guest_back_ptr to ignore empty PTEs., Xen patchbot-3 . 0-testing <=