Commit 2a4c92fa authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge

xen: prevent crashes with non-HIGHMEM 32-bit kernels with largeish memory

If this is a non-HIGHMEM 32-bit kernel, then the page structures only go
up to the limit of addressable memory, even if more memory is physically
present.  Don't try to add that extra memory to the balloon.
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
parent bc15fde7
...@@ -412,8 +412,16 @@ static int __init balloon_init(void) ...@@ -412,8 +412,16 @@ static int __init balloon_init(void)
register_balloon(&balloon_sysdev); register_balloon(&balloon_sysdev);
/* Initialise the balloon with excess memory space. */ /*
extra_pfn_end = min(e820_end_of_ram_pfn(), * Initialise the balloon with excess memory space. We need
* to make sure we don't add memory which doesn't exist or
* logically exist. The E820 map can be trimmed to be smaller
* than the amount of physical memory due to the mem= command
* line parameter. And if this is a 32-bit non-HIGHMEM kernel
* on a system with memory which requires highmem to access,
* don't try to use it.
*/
extra_pfn_end = min(min(max_pfn, e820_end_of_ram_pfn()),
(unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); (unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size));
for (pfn = PFN_UP(xen_extra_mem_start); for (pfn = PFN_UP(xen_extra_mem_start);
pfn < extra_pfn_end; pfn < extra_pfn_end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment