ia64/xen-unstable

changeset 5074:07bd52c0f8de

bitkeeper revision 1.1504 (428f10aaD4iY_Mj4uu6RLDmF65qx-w)

Fix memory scrubbing to deal with memguarded Xen heap pages.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat May 21 10:42:50 2005 +0000 (2005-05-21)
parents 6dda721a273a
children d55569f2ac18
files xen/common/page_alloc.c
line diff
     1.1 --- a/xen/common/page_alloc.c	Sat May 21 10:41:06 2005 +0000
     1.2 +++ b/xen/common/page_alloc.c	Sat May 21 10:42:50 2005 +0000
     1.3 @@ -375,9 +375,19 @@ void scrub_heap_pages(void)
     1.4          /* Re-check page status with lock held. */
     1.5          if ( !allocated_in_map(pfn) )
     1.6          {
     1.7 -            p = map_domain_mem(pfn << PAGE_SHIFT);
     1.8 -            clear_page(p);
     1.9 -            unmap_domain_mem(p);
    1.10 +            if ( IS_XEN_HEAP_FRAME(pfn_to_page(pfn)) )
    1.11 +            {
    1.12 +                p = page_to_virt(pfn_to_page(pfn));
    1.13 +                memguard_unguard_range(p, PAGE_SIZE);
    1.14 +                clear_page(p);
    1.15 +                memguard_guard_range(p, PAGE_SIZE);
    1.16 +            }
    1.17 +            else
    1.18 +            {
    1.19 +                p = map_domain_mem(pfn << PAGE_SHIFT);
    1.20 +                clear_page(p);
    1.21 +                unmap_domain_mem(p);
    1.22 +            }
    1.23          }
    1.24          
    1.25          spin_unlock_irqrestore(&heap_lock, flags);