[Qemu-devel] [PATCH 2/2] pc: register e820 entries for ram

2013-11-04 Thread Gerd Hoffmann
So RAM shows up in the new etc/e820 fw_cfg file.

Cc: Andrea Arcangeli aarca...@redhat.com
Signed-off-by: Gerd Hoffmann kra...@redhat.com
---
 hw/i386/pc.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a653ae4..12c436e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1174,13 +1174,7 @@ 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);
-}
+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,
-- 
1.8.3.1




[Qemu-devel] [PATCH 2/2] pc: register e820 entries for ram

2013-10-22 Thread Gerd Hoffmann
So RAM shows up in the new etc/e820 fw_cfg file.

Cc: Andrea Arcangeli aarca...@redhat.com
Signed-off-by: Gerd Hoffmann kra...@redhat.com
---
 hw/i386/pc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 0500ab6..d98cb25 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1151,12 +1151,14 @@ 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);
+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, 0x1ULL,
 ram_above_4g);
+e820_add_entry(0x1ULL, above_4g_mem_size, E820_RAM);
 }
 
 
-- 
1.8.3.1