File 25786-x86-prefer-multiboot-meminfo-over-e801.patch of Package xen.openSUSE_12.1_Update
# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1346190045 -3600
# Node ID a0b5f8102a0013c112d8e2f7c476040e882838ae
# Parent 3908b256ff345539ae63851b8d3f810d9af19890
x86: Prefer multiboot-provided e820 over bios-provided e801 memory info.
Some UEFI systems do not provide e820 information. In this case we
should take the detailed memory map provided by a multiboot-capable
loader, rather than rely on very conservative values from the e801
bios call. Using the latter on any modern system really hardly makes
good sense.
[Excellent candidate for 4.1 backport]
Signed-off-by: Keir Fraser <keir@xen.org>
Tested-by: Jonathan Tripathy <jonnyt@abpni.co.uk>
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -691,17 +691,6 @@ void __init __start_xen(unsigned long mb
{
memmap_type = "Xen-e820";
}
- else if ( bootsym(lowmem_kb) )
- {
- memmap_type = "Xen-e801";
- e820_raw[0].addr = 0;
- e820_raw[0].size = bootsym(lowmem_kb) << 10;
- e820_raw[0].type = E820_RAM;
- e820_raw[1].addr = 0x100000;
- e820_raw[1].size = bootsym(highmem_kb) << 10;
- e820_raw[1].type = E820_RAM;
- e820_raw_nr = 2;
- }
else if ( mbi->flags & MBI_MEMMAP )
{
memmap_type = "Multiboot-e820";
@@ -739,6 +728,17 @@ void __init __start_xen(unsigned long mb
bytes += map->size + 4;
}
}
+ else if ( bootsym(lowmem_kb) )
+ {
+ memmap_type = "Xen-e801";
+ e820_raw[0].addr = 0;
+ e820_raw[0].size = bootsym(lowmem_kb) << 10;
+ e820_raw[0].type = E820_RAM;
+ e820_raw[1].addr = 0x100000;
+ e820_raw[1].size = bootsym(highmem_kb) << 10;
+ e820_raw[1].type = E820_RAM;
+ e820_raw_nr = 2;
+ }
else if ( mbi->flags & MBI_MEMLIMITS )
{
memmap_type = "Multiboot-e801";