From: Ian Campbell Date: Fri, 23 Jan 2009 16:26:21 +0000 (+0000) Subject: xen: handle highmem pages correctly when shrinking a domain X-Git-Tag: v2.6.29-rc3~42^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ff4ce8c332859508dc97826ab8b7f42bb9c212c9;p=linux-2.6-omap-h63xx.git xen: handle highmem pages correctly when shrinking a domain Commit 1058a75f07b9bb8323fb5197be5526220f8b75cf ("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 Acked-by: Jeremy Fitzhardinge Signed-off-by: Ingo Molnar --- diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 8069d520c46..2ba8f95516a 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -299,10 +299,13 @@ static int decrease_reservation(unsigned long nr_pages) scrub_page(page); - ret = HYPERVISOR_update_va_mapping( - (unsigned long)__va(pfn << PAGE_SHIFT), - __pte_ma(0), 0); - BUG_ON(ret); + 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. */