xen: fix scrub_page()

Impact: fix guest kernel crash with CONFIG_XEN_SCRUB_PAGES=y

Jens noticed that scrub_page() has a buggy unmap of the wrong
thing. (virtual address instead of page)

Linus pointed out that the whole scrub_page() code is an unnecessary
reimplementation of clear_highpage() to begin with.

Just use clear_highpage() rather than reimplementing it poorly.

Reported-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by Jeremy Fitzhardinge and committed by Ingo Molnar 26a3e991 d3c6aa1e

+1 -8
+1 -8
drivers/xen/balloon.c
··· 122 static void scrub_page(struct page *page) 123 { 124 #ifdef CONFIG_XEN_SCRUB_PAGES 125 - if (PageHighMem(page)) { 126 - void *v = kmap(page); 127 - clear_page(v); 128 - kunmap(v); 129 - } else { 130 - void *v = page_address(page); 131 - clear_page(v); 132 - } 133 #endif 134 } 135
··· 122 static void scrub_page(struct page *page) 123 { 124 #ifdef CONFIG_XEN_SCRUB_PAGES 125 + clear_highpage(page); 126 #endif 127 } 128