Commit ff4ce8c3 authored by Ian Campbell's avatar Ian Campbell Committed by Ingo Molnar

xen: handle highmem pages correctly when shrinking a domain

Commit 1058a75f ("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: default avatarIan Campbell <ian.campbell@citrix.com>
Acked-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 42ef73fe
...@@ -299,12 +299,15 @@ static int decrease_reservation(unsigned long nr_pages) ...@@ -299,12 +299,15 @@ static int decrease_reservation(unsigned long nr_pages)
scrub_page(page); scrub_page(page);
if (!PageHighMem(page)) {
ret = HYPERVISOR_update_va_mapping( ret = HYPERVISOR_update_va_mapping(
(unsigned long)__va(pfn << PAGE_SHIFT), (unsigned long)__va(pfn << PAGE_SHIFT),
__pte_ma(0), 0); __pte_ma(0), 0);
BUG_ON(ret); BUG_ON(ret);
} }
}
/* Ensure that ballooned highmem pages don't have kmaps. */ /* Ensure that ballooned highmem pages don't have kmaps. */
kmap_flush_unused(); kmap_flush_unused();
flush_tlb_all(); flush_tlb_all();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment