From patchwork Tue Dec 22 09:57:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 41604 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 59EF9B7BDE for ; Tue, 22 Dec 2009 20:57:50 +1100 (EST) Received: from localhost ([127.0.0.1]:33629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NN1Uw-0005U9-Od for incoming@patchwork.ozlabs.org; Tue, 22 Dec 2009 04:57:46 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NN1UQ-0005RP-Av for qemu-devel@nongnu.org; Tue, 22 Dec 2009 04:57:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NN1UK-0005L5-3I for qemu-devel@nongnu.org; Tue, 22 Dec 2009 04:57:12 -0500 Received: from [199.232.76.173] (port=42384 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NN1UJ-0005L2-UW for qemu-devel@nongnu.org; Tue, 22 Dec 2009 04:57:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49235) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NN1UJ-0004ef-EY for qemu-devel@nongnu.org; Tue, 22 Dec 2009 04:57:07 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBM9v4S3027652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Dec 2009 04:57:05 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBM9v3g4022951; Tue, 22 Dec 2009 04:57:03 -0500 Received: from localhost.localdomain (file.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 8291225004D; Tue, 22 Dec 2009 11:57:02 +0200 (IST) From: Avi Kivity To: Anthony Liguori , qemu-devel@nongnu.org Date: Tue, 22 Dec 2009 11:57:02 +0200 Message-Id: <1261475822-31679-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH v2 master, stable-0.12] Don't load options roms intended to be loaded by the bios in qemu X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The first such option rom will load at address 0, which isn't very nice, and the second will report a conflict and abort, which is horrible. Signed-off-by: Avi Kivity --- Changes from v1: - use ->fw_file instead of ->addr to distinguish between host-loaded and firmware-loaded roms - add the same check in a couple more places hw/loader.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/hw/loader.c b/hw/loader.c index 2ceb8eb..eef385e 100644 --- a/hw/loader.c +++ b/hw/loader.c @@ -636,6 +636,9 @@ static void rom_reset(void *unused) Rom *rom; QTAILQ_FOREACH(rom, &roms, next) { + if (rom->fw_file) { + continue; + } if (rom->data == NULL) continue; cpu_physical_memory_write_rom(rom->addr, rom->data, rom->romsize); @@ -654,6 +657,9 @@ int rom_load_all(void) Rom *rom; QTAILQ_FOREACH(rom, &roms, next) { + if (rom->fw_file) { + continue; + } if (addr > rom->addr) { fprintf(stderr, "rom: requested regions overlap " "(rom %s. free=0x" TARGET_FMT_plx @@ -752,7 +758,7 @@ void do_info_roms(Monitor *mon) Rom *rom; QTAILQ_FOREACH(rom, &roms, next) { - if (rom->addr) { + if (!rom->fw_file) { monitor_printf(mon, "addr=" TARGET_FMT_plx " size=0x%06zx mem=%s name=\"%s\" \n", rom->addr, rom->romsize,