PoD: Scrub pages before adding to the cache
PATCH 1/1 PoD: Scrub pages before adding to the cache
Neither memory from the allocator nor memory from the balloon driver is guaranteed to be zero. Scrub it before adding to the cache.
attaching the patch this time...
Quoted 6 lines · George Dunlap
Neither memory from the allocator nor memory from the balloon driver is guaranteed to be zero. Scrub it before adding to the cache.
Signed-off-by George Dunlap <[email protected]>
xen/arch/x86/mm/p2m.c +11 -0
@@ -257,6 +257,17 @@ }#endif +/* Pages from domain_alloc and returned by the balloon driver aren't +* guaranteed to be zero; but by reclaiming zero pages, we implicitly promise +* to provide zero pages. So we scrub pages before using */ +for ( i=0 ; i<1 << order ; i++) + { +char * b; + b =map_domain_page (page_to_mfn (page) + i); +clear_page (b); +unmap_domain_page (b); + } +spin_lock (&d->page_alloc_lock);/* First, take all pages off the domain list */
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Sorry, noticed that this patch doesn't build with debug=y. Attached patch is a replacement.
-George
Quoted 11 lines · George Dunlap
attaching the patch this time...
Quoted 6 lines · George Dunlap
Neither memory from the allocator nor memory from the balloon driver is guaranteed to be zero. Scrub it before adding to the cache.
Signed-off-by George Dunlap <[email protected]>
xen/arch/x86/mm/p2m.c +11 -0
@@ -307,6 +307,17 @@ }#endif +/* Pages from domain_alloc and returned by the balloon driver aren't +* guaranteed to be zero; but by reclaiming zero pages, we implicitly promise +* to provide zero pages. So we scrub pages before using */ +for ( i=0 ; i<1 << order ; i++) + { +char * b; + b =map_domain_page (mfn_x (page_to_mfn (page)) + i); +clear_page (b); +unmap_domain_page (b); + } +spin_lock (&d->page_alloc_lock);/* First, take all pages off the domain list */
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel