From patchwork Thu Jul 14 00:03:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 9228625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A6A9160572 for ; Thu, 14 Jul 2016 00:04:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9709026E69 for ; Thu, 14 Jul 2016 00:04:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BA3127FBE; Thu, 14 Jul 2016 00:04:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 32C5026E69 for ; Thu, 14 Jul 2016 00:04:39 +0000 (UTC) Received: from localhost ([::1]:50615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNU8s-0007kO-76 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Jul 2016 20:04:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNU8E-0007g0-Fr for qemu-devel@nongnu.org; Wed, 13 Jul 2016 20:04:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNU89-0000LP-N7 for qemu-devel@nongnu.org; Wed, 13 Jul 2016 20:03:58 -0400 Received: from mail-bl2nam02on0084.outbound.protection.outlook.com ([104.47.38.84]:25977 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNU89-0000LL-Hv for qemu-devel@nongnu.org; Wed, 13 Jul 2016 20:03:53 -0400 Received: from SN1NAM02FT030.eop-nam02.prod.protection.outlook.com (10.152.72.53) by SN1NAM02HT222.eop-nam02.prod.protection.outlook.com (10.152.73.71) with Microsoft SMTP Server (TLS) id 15.1.523.9; Thu, 14 Jul 2016 00:03:51 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=xilinx.com; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by SN1NAM02FT030.mail.protection.outlook.com (10.152.72.114) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.534.7 via Frontend Transport; Thu, 14 Jul 2016 00:03:51 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:38545 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1bNU86-0007Nx-JE; Wed, 13 Jul 2016 17:03:50 -0700 Received: from [127.0.0.1] (port=43832 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1bNU86-00019S-Fl; Wed, 13 Jul 2016 17:03:50 -0700 Received: from xsj-tvapsmtp02 (smtptest.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u6DNvAnj011013; Wed, 13 Jul 2016 16:57:10 -0700 Received: from [172.19.74.182] (port=53724 helo=xsjalistai50.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1bNU85-00019P-GR; Wed, 13 Jul 2016 17:03:49 -0700 From: Alistair Francis To: , Date: Wed, 13 Jul 2016 17:03:27 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22448.005 X-TM-AS-Result: No--1.835-7.0-31-10 X-imss-scan-details: No--1.835-7.0-31-10 X-TMASE-MatchedRID: 7pCwBZMu94qzMsBjmgeEEHTnOygHVQpOQl/FdRYkUZI3ZbGC9oP/O8n3 CsRqhZqvK9arbN0JZhts5SwFsix2Ux8TzIzimOwP0C1sQRfQzEHEQdG7H66TyJ8TMnmE+d0Zki1 R7HWoDsTnkmRc3AvSvKrPtZxHx//F4fAVRW/KORROa8Qo1xCM0f+J9YrebZl+wQLRFN3J4J/j8s rumtbPviNkj6e4IxzYgr6lqxbIXlHC3tMwY3ma2xUDj+dgUQVyd3BjdsjROW5WXGvUUmKP2w== X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.96; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(118296001)(85426001)(77096005)(48376002)(106466001)(92566002)(575784001)(2906002)(86362001)(4326007)(71366001)(81166006)(64026002)(81156014)(8676002)(5003940100001)(33646002)(356003)(586003)(2950100001)(36756003)(11100500001)(229853001)(5003600100003)(305945005)(47776003)(19580395003)(5001770100001)(87936001)(50986999)(9786002)(50226002)(7696003)(50466002)(189998001)(19580405001)(105606002)(7846002)(8936002)(76176999)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT222; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; PTR:unknown-60-96.xilinx.com; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: d48f36d0-e967-4569-769a-08d3ab7a567d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT222; X-Microsoft-Antispam-PRVS: <81af8fb490cf4d05a447e249c276a4c1@SN1NAM02HT222.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13018025)(13023025)(8121501046)(13015025)(13024025)(13017025)(10201501046)(3002001)(6055026); SRVR:SN1NAM02HT222; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT222; X-Forefront-PRVS: 00032065B2 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2016 00:03:51.1513 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT222 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.84 Subject: [Qemu-devel] [PATCH v9 2/8] loader: Use the specified MemoryRegion X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cov@codeaurora.org, crosthwaitepeter@gmail.com, pbonzini@redhat.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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); }