kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	"Kevin O'Connor" <kevin@koconnor.net>,
	Liu Sheng <liusheng@linux.vnet.ibm.com>,
	KVM <kvm@vger.kernel.org>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2 3/5] Qemu: do not mark bios readonly
Date: Fri, 26 Oct 2012 12:35:30 +0200	[thread overview]
Message-ID: <508A6772.4040400@siemens.com> (raw)
In-Reply-To: <508904C4.7030409@linux.vnet.ibm.com>

On 2012-10-25 11:22, Xiao Guangrong wrote:
> 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 <xiaoguangrong@linux.vnet.ibm.com>
> ---
>  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,
> 

This has two problems: We know it breaks at least Win 95 that overwrites
its F-segment during boot. And it applies changes to the shadowed area
(below 1 MB) also to the ROM area - I don't think that is the original
behaviour on real hardware.

What we need is paravirtual shadow write control for the ISA PC. It's on
my todo list, maybe I will be able to look into this during the next week.

BTW, your patch series should allow to drop the KVM special case from
pc_system_firmware_init. That version, btw, treats high and low BIOS
areas separately - but only reloads the upper area. Hmm...

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2012-10-26 10:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  9:20 [PATCH v2 0/5] Qemu: implement readonly memory Xiao Guangrong
2012-10-25  9:21 ` [PATCH v2 1/5] KVM: define KVM_CAP_READONLY_MEM unconditionally Xiao Guangrong
2012-10-25 12:14   ` Jan Kiszka
2012-10-25  9:21 ` [PATCH v2 2/5] Qemu: update header files Xiao Guangrong
2012-10-25 11:03   ` [Qemu-devel] " Peter Maydell
2012-10-25  9:22 ` [PATCH v2 3/5] Qemu: do not mark bios readonly Xiao Guangrong
2012-10-26 10:35   ` Jan Kiszka [this message]
2012-10-29  7:09     ` Xiao Guangrong
2012-10-29  7:44       ` Jan Kiszka
2012-10-29  8:31         ` Xiao Guangrong
2012-10-31  6:03           ` Jan Kiszka
2012-10-31  6:35             ` Xiao Guangrong
2012-10-31  6:46               ` Jan Kiszka
2012-10-31  7:01                 ` Xiao Guangrong
2012-10-31  7:21                   ` Jan Kiszka
2012-10-25  9:22 ` [PATCH v2 4/5] Qemu: implement readonly memory Xiao Guangrong
2012-10-25  9:23 ` [PATCH v2 5/5] Qemu: mark pci rom readonly Xiao Guangrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=508A6772.4040400@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=liusheng@linux.vnet.ibm.com \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xiaoguangrong@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).