qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Beschow <shentey@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-arm@nongnu.org, "Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH 1/2] hw/arm/fsl-imx8mp: Make SoC not user-creatable, derive from TYPE_SYS_BUS_DEVICE
Date: Fri, 14 Mar 2025 07:13:06 +0000	[thread overview]
Message-ID: <B6268CD2-A3FE-4215-9532-8728CD95DD15@gmail.com> (raw)
In-Reply-To: <CAFEAcA9ivdbKoe2ip9njx4hFkkCsQCUHnMDrKeH-iQ_5368bJw@mail.gmail.com>



Am 13. März 2025 10:12:18 UTC schrieb Peter Maydell <peter.maydell@linaro.org>:
>On Wed, 12 Mar 2025 at 23:58, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>>
>> On Wed, 12 Mar 2025, Bernhard Beschow wrote:
>> > Fixes a crash when creating the SoC object on the command line:
>> >
>> >  $ ./qemu-system-aarch64  -M virt -device fsl-imx8mp
>> >  **
>> >  ERROR:../../devel/qemu/tcg/tcg.c:1006:tcg_register_thread: assertion failed:
>> >  (n < tcg_max_ctxs)
>> >  Bail out! ERROR:../../devel/qemu/tcg/tcg.c:1006:tcg_register_thread:
>> >  assertion failed: (n < tcg_max_ctxs)
>> >  Aborted (core dumped)
>> >
>> > Furthermore, the SoC object should be derived from TYPE_SYS_BUS_DEVICE such that
>> > it gets properly reset.
>> >
>> > Fixes: a4eefc69b237 "hw/arm: Add i.MX 8M Plus EVK board"
>> > Reported-by: Thomas Huth <thuth@redhat.com>
>> > Suggested-by: Peter Maydell <peter.maydell@linaro.org>
>> > Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>
>> > diff --git a/hw/arm/fsl-imx8mp.c b/hw/arm/fsl-imx8mp.c
>> > index 1ea98e1463..9133d49383 100644
>> > --- a/hw/arm/fsl-imx8mp.c
>> > +++ b/hw/arm/fsl-imx8mp.c
>> > @@ -698,13 +698,15 @@ static void fsl_imx8mp_class_init(ObjectClass *oc, void *data)
>> >     device_class_set_props(dc, fsl_imx8mp_properties);
>> >     dc->realize = fsl_imx8mp_realize;
>> >
>> > +    /* Reason: SoC can only be instantiated from a board */
>> > +    dc->user_creatable = false;
>>
>> I think sysbus devices are not user creatable by default (that's why
>> dynamic sysbus device was introduced) so either this or the .parent change
>> below is enough. You can have both just in case but maybe not necessary as
>> other sysbus devices usually don't set user_createble either.
>
>Yes, that's correct -- we don't need to manually set the
>user_creatable flag here now we've changed the parent class
>to be sysbus.

I'll send a patch later this day.

Best regards,
Bernhard

>
>-- PMM


  reply	other threads:[~2025-03-14  7:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 21:26 [PATCH 0/2] i.MX 8M Plus EVK Fixes Bernhard Beschow
2025-03-12 21:26 ` [PATCH 1/2] hw/arm/fsl-imx8mp: Make SoC not user-creatable, derive from TYPE_SYS_BUS_DEVICE Bernhard Beschow
2025-03-12 23:41   ` Philippe Mathieu-Daudé
2025-03-12 23:58   ` BALATON Zoltan
2025-03-13 10:12     ` Peter Maydell
2025-03-14  7:13       ` Bernhard Beschow [this message]
2025-03-12 21:26 ` [PATCH 2/2] hw/arm/fsl-imx8mp: Remove unused define Bernhard Beschow

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=B6268CD2-A3FE-4215-9532-8728CD95DD15@gmail.com \
    --to=shentey@gmail.com \
    --cc=balaton@eik.bme.hu \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.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).