Fix balloon driver for auto_translated_physmap guests
PATCH 1/1 Fix balloon driver for auto_translated_physmap guests
For guest domains running in auto_translated mode, the domain builder maps the guest grant table at the end of its physmap, i.e. from page frame 'nr_pages' to page frame 'nr_pages + NR_GRANT_FRAMES'.
However, the balloon driver, on initialization, appends all page frames from 'nr_pages' to 'max_pfn' to its ballooned_pages list (this includes the grant table page frames). This ballooned_pages list is subsequently used for increasing memory reservation.
Thus for auto_translated guests, the balloon driver remaps the grant table page frames when it tries to increase the memory reservation.
The attached patch fixes the balloon driver for auto_translated mode.
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +6 -2
@@ -462,6 +462,7 @@ static int __init balloon_init(void) {unsigned long pfn;struct page *page; +unsigned long page_start;if (!is_running_on_xen ())return -ENODEV ;
@@ -489,9 +490,12 @@ static int __init balloon_init(void) balloon_pde->read_proc = balloon_read; balloon_pde->write_proc = balloon_write;#endif - + page_start = xen_start_info->nr_pages; +if (xen_feature (XENFEAT_auto_translated_physmap)) + page_start +=NR_GRANT_FRAMES ; +/* Initialise the balloon with excess memory space. */ -for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) { +for (pfn = page_start; pfn < max_pfn; pfn++) { page =pfn_to_page (pfn);if (!PageReserved (page))balloon_append (page);
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel