Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26a3e991 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by Ingo Molnar
Browse files

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: default avatarJens Axboe <jens.axboe@oracle.com>
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent d3c6aa1e
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -122,14 +122,7 @@ static struct timer_list balloon_timer;
static void scrub_page(struct page *page)
{
#ifdef CONFIG_XEN_SCRUB_PAGES
	if (PageHighMem(page)) {
		void *v = kmap(page);
		clear_page(v);
		kunmap(v);
	} else {
		void *v = page_address(page);
		clear_page(v);
	}
	clear_highpage(page);
#endif
}