Skip to content

Commit

Permalink
xen: handle highmem pages correctly when shrinking a domain
Browse files Browse the repository at this point in the history
Commit 1058a75 ("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>
  • Loading branch information
Ian Campbell authored and Ingo Molnar committed Jan 23, 2009
1 parent 42ef73f commit ff4ce8c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/xen/balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit ff4ce8c

Please sign in to comment.