summaryrefslogtreecommitdiff
path: root/hw/i386/pc.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2015-09-07 13:55:32 +0200
committerMichael S. Tsirkin <mst@redhat.com>2015-09-10 12:15:30 +0300
commit2f8b50083b321e470ef8e2502910ade40cbfa020 (patch)
tree166ed56a351850b2ad56378a7c3819477aa76879 /hw/i386/pc.c
parent3385e8e2640e5c38582f6e8413042bd23d97c640 (diff)
downloadqemu-2f8b50083b321e470ef8e2502910ade40cbfa020.tar.gz
pc: memhotplug: keep reserved-memory-end broken on 2.4 and earlier machines
it will prevent guests on old machines from seeing inconsistent memory mapping in firmware/ACPI views. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/i386/pc.c')
-rw-r--r--hw/i386/pc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 354e1b3157..b5107f7c58 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1412,8 +1412,12 @@ FWCfgState *pc_memory_init(PCMachineState *pcms,
if (guest_info->has_reserved_memory && pcms->hotplug_memory.base) {
uint64_t *val = g_malloc(sizeof(*val));
- uint64_t res_mem_end = pcms->hotplug_memory.base +
- memory_region_size(&pcms->hotplug_memory.mr);
+ PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
+ uint64_t res_mem_end = pcms->hotplug_memory.base;
+
+ if (!pcmc->broken_reserved_end) {
+ res_mem_end += memory_region_size(&pcms->hotplug_memory.mr);
+ }
*val = cpu_to_le64(ROUND_UP(res_mem_end, 0x1ULL << 30));
fw_cfg_add_file(fw_cfg, "etc/reserved-memory-end", val, sizeof(*val));
}