All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>
Cc: Kevin O'Connor <kevin@koconnor.net>,
	Michael Tokarev <mjt@tls.msk.ru>, Avi Kivity <avi@redhat.com>,
	qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] isapc: Shadow ISA BIOS by default
Date: Wed, 12 Sep 2012 10:20:06 +0200	[thread overview]
Message-ID: <505045B6.7050608@siemens.com> (raw)
In-Reply-To: <504F5E94.9070108@siemens.com>

[forgot to CC stable: this one apparently qualifies for older QEMU
releases as well but would require some adaptions for < 1.1]

On 2012-09-11 17:53, Jan Kiszka wrote:
> Our one and only BIOS depends on a writable shadowed BIOS in the ISA
> range. As we have no interface to control the write property, make that
> region writable by default.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> This unbreaks isapc for TCG, and keep it working for KVM once it starts
> supporting read-only memslots.
> 
>  hw/pc_sysfw.c |   13 +++++++++----
>  1 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
> index b45f0ac..027d98a 100644
> --- a/hw/pc_sysfw.c
> +++ b/hw/pc_sysfw.c
> @@ -136,6 +136,7 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory)
>  {
>      char *filename;
>      MemoryRegion *bios, *isa_bios;
> +    void *isa_bios_ptr;
>      int bios_size, isa_bios_size;
>      int ret;
>  
> @@ -167,19 +168,23 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory)
>          g_free(filename);
>      }
>  
> -    /* map the last 128KB of the BIOS in ISA space */
> +    /* Shadow the last 128KB of the BIOS in ISA space as RAM -
> +     * Seabios depends on this */
>      isa_bios_size = bios_size;
>      if (isa_bios_size > (128 * 1024)) {
>          isa_bios_size = 128 * 1024;
>      }
>      isa_bios = g_malloc(sizeof(*isa_bios));
> -    memory_region_init_alias(isa_bios, "isa-bios", bios,
> -                             bios_size - isa_bios_size, isa_bios_size);
> +    memory_region_init_ram(isa_bios, "isa-bios", isa_bios_size);
> +    vmstate_register_ram_global(isa_bios);
>      memory_region_add_subregion_overlap(rom_memory,
>                                          0x100000 - isa_bios_size,
>                                          isa_bios,
>                                          1);
> -    memory_region_set_readonly(isa_bios, true);
> +
> +    /* copy ISA rom image from top of the ROM */
> +    isa_bios_ptr = memory_region_get_ram_ptr(isa_bios);
> +    rom_copy(isa_bios_ptr, (uint32_t)(-isa_bios_size), isa_bios_size);
>  
>      /* map all the bios at the top of memory */
>      memory_region_add_subregion(rom_memory,
> 

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

  parent reply	other threads:[~2012-09-12  8:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 15:53 [Qemu-devel] [PATCH] isapc: Shadow ISA BIOS by default Jan Kiszka
2012-09-12  5:57 ` Michael Tokarev
2012-09-12  7:39   ` Avi Kivity
2012-09-12  8:20 ` Jan Kiszka [this message]
2012-10-08 17:35 ` Jan Kiszka
2012-10-08 18:52   ` Anthony Liguori
2012-10-12  9:29     ` Jan Kiszka
2012-10-12 13:41       ` Anthony Liguori
2012-10-12 15:52         ` Jan Kiszka
2012-10-12 16:13           ` Anthony Liguori
2012-10-12 23:33       ` Kevin O'Connor

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=505045B6.7050608@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.