From d6ac342a48d50bdceaa43abe2e57854230101d90 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Thu, 22 Sep 2016 18:13:08 +0100 Subject: [PATCH] loader: Use the specified MemoryRegion Prevously the specified MemoryRegion was ignored during the rom register reset. This patch uses the rom MemoryRegion is avaliable. Signed-off-by: Alistair Francis Reviewed-by: Peter Maydell Message-id: d63fef5524deeb88e0068ca9d3fd4c8344f54dd4.1474331683.git.alistair.francis@xilinx.com Signed-off-by: Peter Maydell --- hw/core/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 53e0e41..6b61f29 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -1045,7 +1045,8 @@ int rom_check_and_register_reset(void) } addr = rom->addr; addr += rom->romsize; - section = memory_region_find(get_system_memory(), rom->addr, 1); + section = memory_region_find(rom->mr ? rom->mr : get_system_memory(), + rom->addr, 1); rom->isrom = int128_nz(section.size) && memory_region_is_rom(section.mr); memory_region_unref(section.mr); } -- 2.7.4