[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.0-testing] [HVM] Fix set_guest_back_ptr to ignore empty PTEs.



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.