From patchwork Thu Oct 25 09:22:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 194085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1D9E42C00B1 for ; Thu, 25 Oct 2012 20:24:16 +1100 (EST) Received: from localhost ([::1]:37867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRJfi-0002TA-8C for incoming@patchwork.ozlabs.org; Thu, 25 Oct 2012 05:24:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRJfY-0002Io-IM for qemu-devel@nongnu.org; Thu, 25 Oct 2012 05:24:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRJfR-0008C2-OW for qemu-devel@nongnu.org; Thu, 25 Oct 2012 05:24:04 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:35402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRJfJ-0007wP-1F for qemu-devel@nongnu.org; Thu, 25 Oct 2012 05:23:57 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Oct 2012 19:21:25 +1000 Received: from d23relay03.au.ibm.com (202.81.31.245) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 25 Oct 2012 19:20:57 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9P9Mb2t63635502 for ; Thu, 25 Oct 2012 20:22:37 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9P9MFId022084 for ; Thu, 25 Oct 2012 20:22:16 +1100 Received: from localhost.localdomain ([9.123.236.99]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9P9MCvk021949; Thu, 25 Oct 2012 20:22:12 +1100 Message-ID: <508904C4.7030409@linux.vnet.ibm.com> Date: Thu, 25 Oct 2012 17:22:12 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Xiao Guangrong References: <50890462.5010307@linux.vnet.ibm.com> In-Reply-To: <50890462.5010307@linux.vnet.ibm.com> x-cbid: 12102509-7014-0000-0000-000002140449 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.81.31.148 Cc: KVM , Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, Kevin O'Connor , Avi Kivity , Anthony Liguori , Liu Sheng Subject: [Qemu-devel] [PATCH v2 3/5] Qemu: do not mark bios readonly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In isapc, no i440x device exists in guest that means seabios can not make 0xc0000 to 0x1000000 writable It works fine in current code since the guest can happily write readonly memory. In order to support readonly slot in Qemu, we do not make the bios readonly anymore Signed-off-by: Xiao Guangrong --- hw/pc_sysfw.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c index b45f0ac..2d56fc7 100644 --- a/hw/pc_sysfw.c +++ b/hw/pc_sysfw.c @@ -156,7 +156,6 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory) bios = g_malloc(sizeof(*bios)); memory_region_init_ram(bios, "pc.bios", bios_size); vmstate_register_ram_global(bios); - memory_region_set_readonly(bios, true); ret = rom_add_file_fixed(bios_name, (uint32_t)(-bios_size), -1); if (ret != 0) { bios_error: @@ -179,7 +178,6 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory) 0x100000 - isa_bios_size, isa_bios, 1); - memory_region_set_readonly(isa_bios, true); /* map all the bios at the top of memory */ memory_region_add_subregion(rom_memory,