xen: handle highmem pages correctly when shrinking a domain

Commit 1058a75f07 ("xen: actually release
memory when shrinking domain") causes a crash if the page being released
is a highmem page.

If a page is highmem then there is no need to unmap it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Ian Campbell 2009-01-23 16:26:21 +00:00 committed by Ingo Molnar
parent 42ef73fe13
commit ff4ce8c332

View File

@ -299,12 +299,15 @@ static int decrease_reservation(unsigned long nr_pages)
scrub_page(page);
if (!PageHighMem(page)) {
ret = HYPERVISOR_update_va_mapping(
(unsigned long)__va(pfn << PAGE_SHIFT),
__pte_ma(0), 0);
BUG_ON(ret);
}
}
/* Ensure that ballooned highmem pages don't have kmaps. */
kmap_flush_unused();
flush_tlb_all();