Skip to contentSkip to conversation

pc: allow raising low memory via max-ram-below-4g option

PATCH RESEND In review Gerd Hoffmann 3 participants 4 messages Jun 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 pc: allow raising low memory via max-ram-below-4g option

This patch extends the functionality of the max-ram-below-4g option to also allow increasing lowmem. Use case: Give as much memory as possible to legacy non-PAE guests.

While being at it also rework the lowmem calculation logic and add a longish comment describing how it works and what the compatibility constrains are.

---
 hw/i386/pc.c      |  2 +-
 hw/i386/pc_piix.c | 61 +++++++++++++++++++++++++++++++++++--------------------
 2 files changed, 40 insertions(+), 23 deletions(-)
hw/i386/pc.c +1 -1
index e29ccc8..bfaf5a3 100644
@@ -1893,7 +1893,7 @@ static void pc_machine_initfn(Object *obj)
                         pc_machine_get_hotplug_memory_region_size,
                         NULL, NULL, NULL, &error_abort);
 
-    pcms->max_ram_below_4g = 1ULL << 32; /* 4G */
+    pcms->max_ram_below_4g = 0xe0000000; /* 3.5G */
     object_property_add(obj, PC_MACHINE_MAX_RAM_BELOW_4G, "size",
                         pc_machine_get_max_ram_below_4g,
                         pc_machine_set_max_ram_below_4g,
hw/i386/pc_piix.c +39 -22

68 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 7 lines · Gerd Hoffmann

This patch extends the functionality of the max-ram-below-4g option to also allow increasing lowmem. Use case: Give as much memory as possible to legacy non-PAE guests.

While being at it also rework the lowmem calculation logic and add a longish comment describing how it works and what the compatibility constrains are.

Does this break migration if you use something like "-M max-ram-below-4g=4g -m 3968m"?

I don't have big problems with that, but it has to be documented.

Thanks,

Paolo

#2 lore raw
Quoted 9 lines · Paolo Bonzini
Quoted 7 lines · Gerd Hoffmann

This patch extends the functionality of the max-ram-below-4g option to also allow increasing lowmem. Use case: Give as much memory as possible to legacy non-PAE guests.

While being at it also rework the lowmem calculation logic and add a longish comment describing how it works and what the compatibility constrains are.

Quoted 6 lines

Does this break migration if you use something like "-M max-ram-below-4g=4g -m 3968m"?

I don't have big problems with that, but it has to be documented.

From reading the previous discussion, it looks like it breaks

compatibility for:
gigabyte_align && max_ram_below_4g > 3G || max_ram_below_4g > 3.5G

My past self said that those were unsupported configurations (but I didn't verify his claim), so it should be OK. But we need to document that in the commit message, at least.

Signature · 1 line
Eduardo
Reviewed-by on v1 1/1
#3 lore raw
In reply to Gerd Hoffmann
Quoted 9 lines · Gerd Hoffmann

This patch extends the functionality of the max-ram-below-4g option to also allow increasing lowmem. Use case: Give as much memory as possible to legacy non-PAE guests.

While being at it also rework the lowmem calculation logic and add a longish comment describing how it works and what the compatibility constrains are.

It's the same patch I have reviewed in January, so:

Signature · 1 line
Eduardo