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] [HVM] Fix set_guest_back_ptr to ignore empty PTEs.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [HVM] Fix set_guest_back_ptr to ignore empty PTEs.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 Jun 2006 12:08:36 +0000
Delivery-date: Thu, 01 Jun 2006 05:13:48 -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 kfraser@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 121ec8b952d33a358e6c6ab65493e0b47e56781d
# Parent  09d9d6e7b9851cfb2206395ced55b4769e164b4a
[HVM] Fix set_guest_back_ptr to ignore empty PTEs.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/include/asm-x86/shadow.h |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff -r 09d9d6e7b985 -r 121ec8b952d3 xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      Thu Jun 01 10:34:21 2006 +0100
+++ b/xen/include/asm-x86/shadow.h      Thu Jun 01 10:50:33 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] [HVM] Fix set_guest_back_ptr to ignore empty PTEs., Xen patchbot-unstable <=