]> xenbits.xensource.com Git - people/aperard/mini-os.git/commitdiff
mini-os: fix bug in ballooning on PVH xen-4.17.0-rc4 xen-4.18.0-rc4 xen-4.18.0-rc5 xen-RELEASE-4.17.0 xen-RELEASE-4.17.1 xen-RELEASE-4.17.3 xen-RELEASE-4.18.0
authorJuergen Gross <jgross@suse.com>
Tue, 21 Jun 2022 07:23:14 +0000 (09:23 +0200)
committerJulien Grall <jgrall@amazon.com>
Mon, 4 Jul 2022 08:52:38 +0000 (09:52 +0100)
There is a subtle bug in ballooning code for PVH: in case ballooning
extends above a non-RAM area of the memory map, wrong pages will be
used.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
balloon.c

index 6ad07644d8b7bc45ac1a30c52151771e9b4567a7..55be81414fe767851a44486f83ae2a8e9396f428 100644 (file)
--- a/balloon.c
+++ b/balloon.c
@@ -124,7 +124,7 @@ int balloon_up(unsigned long n_pages)
     for ( pfn = 0; pfn < rc; pfn++ )
     {
         arch_pfn_add(start_pfn + pfn, balloon_frames[pfn]);
-        free_page(pfn_to_virt(nr_mem_pages + pfn));
+        free_page(pfn_to_virt(start_pfn + pfn));
     }
 
     nr_mem_pages += rc;