From: Igor Mammedov Date: Tue, 8 Oct 2019 11:33:18 +0000 (-0400) Subject: hppa: drop usage of memory_region_allocate_system_memory() for ROM X-Git-Tag: v4.2.0-rc0~41^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a3a2e828220d9c86425930178445b868ea3c3c4;p=thirdparty%2Fqemu.git 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 Message-Id: <20191008113318.7012-4-imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Eduardo Habkost --- diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 7e236754292..953d454f487 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 */