From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmMyR-00073u-Bb for qemu-devel@nongnu.org; Tue, 20 Sep 2016 11:28:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmMyL-0008GF-Rg for qemu-devel@nongnu.org; Tue, 20 Sep 2016 11:28:42 -0400 Received: from mail-cys01nam02on0078.outbound.protection.outlook.com ([104.47.37.78]:62080 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmMyL-0008G9-Ih for qemu-devel@nongnu.org; Tue, 20 Sep 2016 11:28:37 -0400 From: Alistair Francis Date: Tue, 20 Sep 2016 07:54:11 -0700 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v11 2/8] loader: Use the specified MemoryRegion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, armbru@redhat.com, cov@codeaurora.org, pbonzini@redhat.com 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 --- 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