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-unstable] On debug builds, scrub pages with non-zer

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] On debug builds, scrub pages with non-zero poison.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 07 Aug 2007 05:30:21 -0700
Delivery-date: Tue, 07 Aug 2007 05:28:24 -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@xxxxxxxxxxxxxxxxxxxxx
# Date 1186140153 -3600
# Node ID cb3e6fcb7f34dd4cb46e46a3e5068c9333a06cda
# Parent  52e5c110aadb31d6086f0785dc1f52160bc8e5ba
On debug builds, scrub pages with non-zero poison.
Will flush out guests which are relying on zeroed memory.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/page_alloc.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff -r 52e5c110aadb -r cb3e6fcb7f34 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Fri Aug 03 12:10:35 2007 +0100
+++ b/xen/common/page_alloc.c   Fri Aug 03 12:22:33 2007 +0100
@@ -91,6 +91,14 @@ custom_param("dma_emergency_pool", parse
 #define round_pgdown(_p)  ((_p)&PAGE_MASK)
 #define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
 
+#ifndef NDEBUG
+/* Avoid callers relying on allocations returning zeroed pages. */
+#define scrub_page(p) memset((p), 0xc2, PAGE_SIZE)
+#else
+/* For a production build, clear_page() is the fastest way to scrub. */
+#define scrub_page(p) clear_page(p)
+#endif
+
 static DEFINE_SPINLOCK(page_scrub_lock);
 LIST_HEAD(page_scrub_list);
 static unsigned long scrub_pages;
@@ -618,13 +626,13 @@ void __init scrub_heap_pages(void)
             {
                 p = page_to_virt(mfn_to_page(mfn));
                 memguard_unguard_range(p, PAGE_SIZE);
-                clear_page(p);
+                scrub_page(p);
                 memguard_guard_range(p, PAGE_SIZE);
             }
             else
             {
                 p = map_domain_page(mfn);
-                clear_page(p);
+                scrub_page(p);
                 unmap_domain_page(p);
             }
         }
@@ -1018,7 +1026,7 @@ static void page_scrub_softirq(void)
             pg = list_entry(ent, struct page_info, list);
             ent = ent->prev;
             p = map_domain_page(page_to_mfn(pg));
-            clear_page(p);
+            scrub_page(p);
             unmap_domain_page(p);
             free_heap_pages(pfn_dom_zone_type(page_to_mfn(pg)), pg, 0);
         }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] On debug builds, scrub pages with non-zero poison., Xen patchbot-unstable <=