diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-11-17 12:35:00 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-17 13:11:26 -0500 |
commit | 26a3e99160cfb06a0a33e25b9fb0d516e2cc680d (patch) | |
tree | 83cec2de720c3ce23a612b4d1bf37c36bf28f0ec /drivers/xen | |
parent | d3c6aa1e69f705ac3ab64584101b1d38435b1353 (diff) |
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>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/balloon.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index a0fb5eac407c..526c191e84ea 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -122,14 +122,7 @@ static struct timer_list balloon_timer; | |||
122 | static void scrub_page(struct page *page) | 122 | static void scrub_page(struct page *page) |
123 | { | 123 | { |
124 | #ifdef CONFIG_XEN_SCRUB_PAGES | 124 | #ifdef CONFIG_XEN_SCRUB_PAGES |
125 | if (PageHighMem(page)) { | 125 | clear_highpage(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 | 126 | #endif |
134 | } | 127 | } |
135 | 128 | ||