From patchwork Tue Oct 9 05:55:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10631959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA796112B for ; Tue, 9 Oct 2018 05:56:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87BCE28A5B for ; Tue, 9 Oct 2018 05:56:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AA8C28A60; Tue, 9 Oct 2018 05:56:18 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,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 D581F28A5E for ; Tue, 9 Oct 2018 05:56:17 +0000 (UTC) Received: from localhost ([::1]:49676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9l0D-0006fw-7i for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Oct 2018 01:56:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9kzN-000680-QG for qemu-devel@nongnu.org; Tue, 09 Oct 2018 01:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9kzK-0002x1-Ga for qemu-devel@nongnu.org; Tue, 09 Oct 2018 01:55:25 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:34827) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g9kzK-0002wg-8p for qemu-devel@nongnu.org; Tue, 09 Oct 2018 01:55:22 -0400 Received: by mail-pg1-x541.google.com with SMTP id v133-v6so261193pgb.2 for ; Mon, 08 Oct 2018 22:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=XhJi22c6TfQ8QdrH3RV32gUhJVbQcH/+VBDtxNWmkn4=; b=F39SmN+XCQbabmgU/D08k8EU63kdGQ9O1ThMeWiV0wlLFQOqOIEe3lqah7wLO8o1vl Md2KZzaB2U8cbtE9ZKWvU+wiVq60prbMBQzLYcNOYxREuxI/Yz6pGG2Z0lAtmnoeMSQX Eq+V6yRLwpxlfIH4LGsrHS+pVCBDk/Yj66g2GviLN+LErBtd13dMixDO9c0/h/N3GNmS 80qeCx9y3Vg36lppgJAIirYybn3+glmXt0XczdT82Ttj1qCegJpbQ0nFMGcSrx3KWu9H EY/s5JQ2oCDz2wSaFOiqMOXX6CF06sovy8z2wNbY3CI1Lp0oCxhoPAHW5L13uzyNrotv kQGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XhJi22c6TfQ8QdrH3RV32gUhJVbQcH/+VBDtxNWmkn4=; b=bCe7gSu6rI1SCwMntgoOJFAbpDQBZvnIKXvqHicgshRwWqM19tJZ+D92eQtTI5/GDB vnIj0kP2fwIATlF77x/vcPLME21+CvunKIbOZqwR6S0VZTocNvNx5vpayH7rPRHVUgob TcXfvbMCwEHPInGv/DwYB/K89+ngSjdiWlSo4EJJigdzYuX62nyHttq5Jw3e9Jp2hwd2 xQltdla7JhR8g0kgxbUtZ2pa/+Ii32Ne2zQqmYYfcSVBGLPee/0O0y/EzQ1hGwYif3qT f6gub44FYLSfmD1/TD1LtFaoFbvjk6UHqWNclQ715EdbTh4Ld/v1A83y6WliXCdINRoQ iqKA== X-Gm-Message-State: ABuFfogi77Ffy1qTcquf0nEwsPerV8DcNp0pv5QkXCjYvImy1Z2lJsfC t1swf2AZt+3PXmdAXUIjv5Z18CKR X-Google-Smtp-Source: ACcGV63e3DB8ZNIyWaMl84GXnSNDwfm/WBzTiByWJryBt1pFY+93z5BU9NZ7p37QbAoEJO9/PxJtew== X-Received: by 2002:a62:425b:: with SMTP id p88-v6mr28455881pfa.96.1539064520725; Mon, 08 Oct 2018 22:55:20 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.65]) by smtp.gmail.com with ESMTPSA id c79-v6sm27362414pfb.147.2018.10.08.22.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 22:55:20 -0700 (PDT) From: Li Qiang To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mst@redhat.com, marcel.apfelbaum@gmail.com, peter.maydell@linaro.org Date: Mon, 8 Oct 2018 22:55:14 -0700 Message-Id: <1539064514-2606-1-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 Subject: [Qemu-devel] [PATCH] i386: pc_sysfw: load bios using rom API 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: Li Qiang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP As the bios is a ROM, just using rom API. AFAICS no functionality changed. Signed-off-by: Li Qiang --- hw/i386/pc_sysfw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 091e22dd60..7f469fd582 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -209,9 +209,9 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) goto bios_error; } bios = g_malloc(sizeof(*bios)); - memory_region_init_ram(bios, NULL, "pc.bios", bios_size, &error_fatal); - if (!isapc_ram_fw) { - memory_region_set_readonly(bios, true); + memory_region_init_rom(bios, NULL, "pc.bios", bios_size, &error_fatal); + if (isapc_ram_fw) { + memory_region_set_readonly(bios, false); } ret = rom_add_file_fixed(bios_name, (uint32_t)(-bios_size), -1); if (ret != 0) { @@ -230,8 +230,8 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) 0x100000 - isa_bios_size, isa_bios, 1); - if (!isapc_ram_fw) { - memory_region_set_readonly(isa_bios, true); + if (isapc_ram_fw) { + memory_region_set_readonly(isa_bios, false); } /* map all the bios at the top of memory */