summaryrefslogtreecommitdiffstats
path: root/hw/hppa/machine.c
diff options
context:
space:
mode:
authorIgor Mammedov2019-10-08 13:33:18 +0200
committerEduardo Habkost2019-10-24 04:37:42 +0200
commit6a3a2e828220d9c86425930178445b868ea3c3c4 (patch)
tree0bb6b12eb820a6d57b0f22bd811d75108264032e /hw/hppa/machine.c
parentppc: rs6000_mc: drop usage of memory_region_allocate_system_memory() (diff)
downloadqemu-6a3a2e828220d9c86425930178445b868ea3c3c4.tar.gz
qemu-6a3a2e828220d9c86425930178445b868ea3c3c4.tar.xz
qemu-6a3a2e828220d9c86425930178445b868ea3c3c4.zip
hppa: drop usage of memory_region_allocate_system_memory() for ROM
machine_hppa_init() violates memory_region_allocate_system_memory() contract by calling it multiple times which could break with -mem-path. Replace the second usage (for 'rom') with memory_region_init_ram() instead. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20191008113318.7012-4-imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/hppa/machine.c')
-rw-r--r--hw/hppa/machine.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 7e23675429..953d454f48 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -161,9 +161,8 @@ static void machine_hppa_init(MachineState *machine)
g_free(firmware_filename);
rom_region = g_new(MemoryRegion, 1);
- memory_region_allocate_system_memory(rom_region, OBJECT(machine),
- "firmware",
- (FIRMWARE_END - FIRMWARE_START));
+ memory_region_init_ram(rom_region, NULL, "firmware",
+ (FIRMWARE_END - FIRMWARE_START), &error_fatal);
memory_region_add_subregion(addr_space, FIRMWARE_START, rom_region);
/* Load kernel */