diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 0c313feb0b297709a5c554051cf1a517e2786340..ec5508b28830d005003e2ea1568860ed4f763c22 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1134,12 +1134,20 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory, memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", ram, 0, below_4g_mem_size); memory_region_add_subregion(system_memory, 0, ram_below_4g); + if (0) { + /* + * Ideally we should do that too, but that would ruin the e820 + * reservations added by seabios before initializing fw_cfg. + */ + e820_add_entry(0, below_4g_mem_size, E820_RAM); + } if (above_4g_mem_size > 0) { ram_above_4g = g_malloc(sizeof(*ram_above_4g)); memory_region_init_alias(ram_above_4g, NULL, "ram-above-4g", ram, below_4g_mem_size, above_4g_mem_size); memory_region_add_subregion(system_memory, 0x100000000ULL, ram_above_4g); + e820_add_entry(0x100000000ULL, above_4g_mem_size, E820_RAM); }