mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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>
This commit is contained in:
parent
3385e8e264
commit
2f8b50083b
4 changed files with 11 additions and 2 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue