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

[Xen-changelog] Fix memory scrubbing to deal with memguarded Xen heap pages.



ChangeSet 1.1504, 2005/05/21 11:42:50+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Fix memory scrubbing to deal with memguarded Xen heap pages.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 page_alloc.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)


diff -Nru a/xen/common/page_alloc.c b/xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   2005-05-22 13:04:12 -04:00
+++ b/xen/common/page_alloc.c   2005-05-22 13:04:12 -04:00
@@ -375,9 +375,19 @@
         /* Re-check page status with lock held. */
         if ( !allocated_in_map(pfn) )
         {
-            p = map_domain_mem(pfn << PAGE_SHIFT);
-            clear_page(p);
-            unmap_domain_mem(p);
+            if ( IS_XEN_HEAP_FRAME(pfn_to_page(pfn)) )
+            {
+                p = page_to_virt(pfn_to_page(pfn));
+                memguard_unguard_range(p, PAGE_SIZE);
+                clear_page(p);
+                memguard_guard_range(p, PAGE_SIZE);
+            }
+            else
+            {
+                p = map_domain_mem(pfn << PAGE_SHIFT);
+                clear_page(p);
+                unmap_domain_mem(p);
+            }
         }
         
         spin_unlock_irqrestore(&heap_lock, flags);

_______________________________________________
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®.