Explorar el Código

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 <ian.campbell@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ian Campbell hace 16 años
padre
commit
ff4ce8c332
Se han modificado 1 ficheros con 7 adiciones y 4 borrados
  1. 7 4
      drivers/xen/balloon.c

+ 7 - 4
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. */