From: Blue Swirl <blauwirbel@gmail.com>
To: Stefan Weil <weil@mail.berlios.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] sparc: Fix assertion caused by empty memory slot with 0 byte
Date: Fri, 15 Apr 2011 21:19:21 +0300 [thread overview]
Message-ID: <BANLkTinBTPRnMC=EEQjhLZ=LPYniOVfcJw@mail.gmail.com> (raw)
In-Reply-To: <1302801540-10491-1-git-send-email-weil@mail.berlios.de>
Thanks, applied.
On Thu, Apr 14, 2011 at 8:19 PM, Stefan Weil <weil@mail.berlios.de> wrote:
> If the memory size given on the command line is equal to the
> maximum size of memory defined by the hardware, there is no
> "empty slot" after physical memory.
>
> The following command
>
> qemu-system-sparc -m 256
>
> raised an assertion:
> exec.c:2614: cpu_register_physical_memory_offset: Assertion `size' failed
>
> This can be fixed either at the caller side (don't call empty_slot_init)
> or in empty_slot_init (do nothing) when size == 0. The second solution
> was choosen here because it is more robust.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
> hw/empty_slot.c | 21 ++++++++++++---------
> 1 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/hw/empty_slot.c b/hw/empty_slot.c
> index 664b8d9..da8adc4 100644
> --- a/hw/empty_slot.c
> +++ b/hw/empty_slot.c
> @@ -53,18 +53,21 @@ static CPUWriteMemoryFunc * const empty_slot_write[3] = {
>
> void empty_slot_init(target_phys_addr_t addr, uint64_t slot_size)
> {
> - DeviceState *dev;
> - SysBusDevice *s;
> - EmptySlot *e;
> + if (slot_size > 0) {
> + /* Only empty slots larger than 0 byte need handling. */
> + DeviceState *dev;
> + SysBusDevice *s;
> + EmptySlot *e;
>
> - dev = qdev_create(NULL, "empty_slot");
> - s = sysbus_from_qdev(dev);
> - e = FROM_SYSBUS(EmptySlot, s);
> - e->size = slot_size;
> + dev = qdev_create(NULL, "empty_slot");
> + s = sysbus_from_qdev(dev);
> + e = FROM_SYSBUS(EmptySlot, s);
> + e->size = slot_size;
>
> - qdev_init_nofail(dev);
> + qdev_init_nofail(dev);
>
> - sysbus_mmio_map(s, 0, addr);
> + sysbus_mmio_map(s, 0, addr);
> + }
> }
>
> static int empty_slot_init1(SysBusDevice *dev)
> --
> 1.7.2.5
>
>
prev parent reply other threads:[~2011-04-15 18:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-14 17:19 [Qemu-devel] [PATCH] sparc: Fix assertion caused by empty memory slot with 0 byte Stefan Weil
2011-04-15 18:19 ` Blue Swirl [this message]
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='BANLkTinBTPRnMC=EEQjhLZ=LPYniOVfcJw@mail.gmail.com' \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=weil@mail.berlios.de \
/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).