[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/4] hppa: drop usage of memory_region_allocate_system_memory() fo
From: |
Eduardo Habkost |
Subject: |
[PULL 4/4] hppa: drop usage of memory_region_allocate_system_memory() for ROM |
Date: |
Wed, 23 Oct 2019 23:46:23 -0300 |
From: Igor Mammedov <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
hw/hppa/machine.c | 5 ++---
1 file 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 */
--
2.21.0
- [PULL 0/4] x86 and machine queue, 2019-10-23, Eduardo Habkost, 2019/10/23
- [PULL 1/4] target/i386: Introduce Denverton CPU model, Eduardo Habkost, 2019/10/23
- [PULL 2/4] sparc64: use memory_region_allocate_system_memory() only for '-m' specified RAM, Eduardo Habkost, 2019/10/23
- [PULL 3/4] ppc: rs6000_mc: drop usage of memory_region_allocate_system_memory(), Eduardo Habkost, 2019/10/23
- [PULL 4/4] hppa: drop usage of memory_region_allocate_system_memory() for ROM,
Eduardo Habkost <=
- Re: [PULL 0/4] x86 and machine queue, 2019-10-23, Peter Maydell, 2019/10/24