From: Thomas Huth <thuth@redhat.com>
To: Peter Xu <peterx@redhat.com>, BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] hw/display/tcx: Init memory regions in realize
Date: Mon, 16 Mar 2026 17:23:47 +0100 [thread overview]
Message-ID: <e596bcf2-962b-4857-addc-1200702fe455@redhat.com> (raw)
In-Reply-To: <abgqjKVFHKxuKupP@x1.local>
On 16/03/2026 17.06, Peter Xu wrote:
> On Mon, Mar 16, 2026 at 02:06:51PM +0100, BALATON Zoltan wrote:
>> Due to aux-ram-share property qemu_ram_alloc_internal dereferences
>> current_machine which is not set during init when inspecting the
>> device. This causes the qtest/device-introspect-test to fail since a
>
> Does it has anything to do with aux-ram-share? I thought it's because the
> qom introspect test will create yet another sun-tcx device, causing double
> registration?
I think it happens because the test starts QEMU with the sun4m machine (or
whichever machine uses this device by default), and then creates another
instance of the device for introspection (without realizing it). You can
easily recreate the bug manually like this:
$ ./qemu-system-sparc -M SS-20 -display none -monitor stdio
QEMU 10.2.50 monitor - type 'help' for more information
(qemu) device_add sun-tcx,help
RAMBlock "tcx.prom" already registered, abort!
Aborted (core dumped)
An instance_init() function should not change the global state of QEMU, so
registering memory regions this way is a no-go. This has to be done in
realize() instead.
So for this patch here:
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2026-03-16 16:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 13:06 [PATCH] hw/display/tcx: Init memory regions in realize BALATON Zoltan
2026-03-16 16:06 ` Peter Xu
2026-03-16 16:23 ` Thomas Huth [this message]
2026-03-16 16:36 ` Peter Maydell
2026-03-16 17:49 ` Peter Xu
2026-03-16 21:45 ` Mark Cave-Ayland
2026-03-17 5:31 ` Thomas Huth
2026-03-16 18:10 ` BALATON Zoltan
2026-03-16 21:30 ` Peter Xu
2026-03-16 22:30 ` BALATON Zoltan
2026-03-17 5:41 ` Thomas Huth
2026-03-17 6:15 ` Thomas Huth
2026-03-17 10:17 ` BALATON Zoltan
2026-03-17 10:24 ` BALATON Zoltan
2026-03-17 14:24 ` Peter Xu
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=e596bcf2-962b-4857-addc-1200702fe455@redhat.com \
--to=thuth@redhat.com \
--cc=balaton@eik.bme.hu \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@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.