All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org,  qemu-riscv@nongnu.org,
	alistair.francis@wdc.com,  liwei1518@gmail.com,
	zhiwei_liu@linux.alibaba.com,  chao.liu@processmission.com,
	philmd@oss.qualcomm.com,  Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: [PATCH] target/riscv/cpu.c: duct tape fix for QMP + RV profiles introspection
Date: Thu, 22 Oct 2026 08:00:12 +0200	[thread overview]
Message-ID: <87ecdil1g3.fsf@pond.sub.org> (raw)
In-Reply-To: <20261021173138.2388231-1-daniel.barboza@oss.qualcomm.com> (Daniel Henrique Barboza's message of "Wed, 21 Oct 2026 14:31:38 -0300")

Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com> writes:

> Maruks reported in [1] a problem with QMP introspection with
> qemu-system-riscv64 that happens after querying a profile CPU.  QEMU
> crashes hitting an abort during satp_mode logic that, somehow, is being
> triggered via profile code.
>
> For every profile CPU that goes through init we're setting an 'enabled'
> flag in the static RISCVProfile object.  This sounded like an okay idea
> back when profiles were introduced, but now we've realized that QMP will
> querying CPUs without exiting the QEMU process while also going multiple
> times through cpu_init() and friends.  The result is that we're in a
> situation where we have runtime information being stored in static arrays
> that persists between CPU definitions being introspected.
>
> A proper fix is to get rid of profile->enabled and turn profiles into
> cpu->cfg flags like we do with every other extension.  Unfortunately
> we've been using profile->enabled for lots of things and a redesign
> would be in order, one which I'm not comfortable doing right now - we're
> too close to the QEMU 11.2 code freeze for such a change.
>
> For now let's silver tape a fix in cpu_init() to reset profile->enabled
> for all available profiles.  We'll do a proper redesign in the next
> release cycle.
>
> [1] https://lore.kernel.org/qemu-devel/87ld7rmdi6.fsf@pond.sub.org/
>
> Reported-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>

That was quick, thank you!

Tested-by: Markus Armbruster <armbru@redhat.com>



  parent reply	other threads:[~2026-10-22  6:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 17:31 [PATCH] target/riscv/cpu.c: duct tape fix for QMP + RV profiles introspection Daniel Henrique Barboza
2026-10-22  2:28 ` Alistair Francis
2026-10-22  2:34 ` Alistair Francis
2026-10-22  6:00 ` Markus Armbruster [this message]
2026-10-22 13:21   ` Daniel Henrique Barboza
2026-10-23  3:11     ` Alistair Francis

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=87ecdil1g3.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=chao.liu@processmission.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=liwei1518@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.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 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.