qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Alexander Graf" <agraf@suse.de>,
	qemu-ppc@nongnu.org, "Andreas Färber" <afaerber@suse.de>,
	"Avi Kivity" <avi@redhat.com>
Subject: [Qemu-devel] [PATCH] prep: Fix offset of BIOS MemoryRegion
Date: Thu,  5 Jan 2012 18:13:15 +0100	[thread overview]
Message-ID: <1325783595-22962-1-git-send-email-afaerber@suse.de> (raw)

Since 0c90c52fab5ea92d7f12b29bfe26a7cd75d9efcb (ppc_prep: convert to memory
API) OHW was "Trying to execute code outside RAM or ROM at 0xfff00700".

The BIOS MemoryRegion is created with a fixed size of 1 MiB.
Ensure that the full size can be accessed since the exception
vectors are located at 0xfff00000 and the BIOS may want to use them.

It thereby no longer depends on the actual BIOS binary size.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Avi Kivity <avi@redhat.com>
Cc: Alexander Graf <agraf@suse.de>
---
 hw/ppc_prep.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 47dab3f..dec059a 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -560,6 +560,8 @@ static void ppc_prep_init (ram_addr_t ram_size,
 
     /* allocate and load BIOS */
     memory_region_init_ram(bios, "ppc_prep.bios", BIOS_SIZE);
+    memory_region_set_readonly(bios, true);
+    memory_region_add_subregion(sysmem, (uint32_t)(-BIOS_SIZE), bios);
     vmstate_register_ram_global(bios);
     if (bios_name == NULL)
         bios_name = BIOS_FILENAME;
@@ -573,8 +575,6 @@ static void ppc_prep_init (ram_addr_t ram_size,
         target_phys_addr_t bios_addr;
         bios_size = (bios_size + 0xfff) & ~0xfff;
         bios_addr = (uint32_t)(-bios_size);
-        memory_region_set_readonly(bios, true);
-        memory_region_add_subregion(sysmem, bios_addr, bios);
         bios_size = load_image_targphys(filename, bios_addr, bios_size);
     }
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
-- 
1.7.7

             reply	other threads:[~2012-01-05 17:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 17:13 Andreas Färber [this message]
2012-01-11 21:43 ` [Qemu-devel] [PATCH] prep: Fix offset of BIOS MemoryRegion Andreas Färber
2012-01-11 21:46   ` Anthony Liguori
2012-01-11 21:49     ` Alexander Graf
2012-01-11 21:51       ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2012-01-11 21:55         ` Andreas Färber
2012-01-11 21:58           ` Alexander Graf
2012-01-11 22:04       ` [Qemu-devel] " Anthony Liguori
2012-01-11 23:12   ` [Qemu-devel] [PATCH] PREP: Finish qdev conversion Alexander Graf
2012-01-16 14:36 ` [Qemu-devel] [PATCH] prep: Fix offset of BIOS MemoryRegion Andreas Färber

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=1325783595-22962-1-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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).