qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: Thomas Huth <thuth@redhat.com>
Cc: Bernhard Beschow <shentey@gmail.com>,
	qemu-ppc@nongnu.org,  qemu-devel@nongnu.org
Subject: Re: [PATCH v2] hw/ppc/e500: Check for compatible CPU type instead of aborting ungracefully
Date: Wed, 15 Oct 2025 14:51:35 +0200 (CEST)	[thread overview]
Message-ID: <c2b57b2a-e24f-427b-0769-82465eb4032f@eik.bme.hu> (raw)
In-Reply-To: <20251015111243.1585018-1-thuth@redhat.com>

On Wed, 15 Oct 2025, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
>
> When using the ppce500 machine with an embedded CPU type that has
> the right MMU model, but is not part of the e500 CPU family, QEMU
> currently aborts ungracefully:
>
> $ ./qemu-system-ppc -machine ppce500 -cpu e200z5 -nographic
> qemu-system-ppc: ../qemu/hw/core/gpio.c:108: qdev_get_gpio_in_named:
>  Assertion `n >= 0 && n < gpio_list->num_in' failed.
> Aborted (core dumped)
>
> The ppce500 machine expects a CPU with certain GPIO interrupt pins,
> so let's replace the coarse check for the MMU_BOOKE206 model with
> a more precise check that only allows CPUs from the e500 family.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3162
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>

> ---
> v2: Drop the old check for the MMU_BOOKE206 model
>
> hw/ppc/e500.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index 723c97fad2e..3d69428f31c 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -20,6 +20,7 @@
> #include "qemu/guest-random.h"
> #include "exec/target_page.h"
> #include "qapi/error.h"
> +#include "cpu-models.h"
> #include "e500.h"
> #include "e500-ccsr.h"
> #include "net/net.h"
> @@ -942,9 +943,8 @@ void ppce500_init(MachineState *machine)
>         env = &cpu->env;
>         cs = CPU(cpu);
>
> -        if (env->mmu_model != POWERPC_MMU_BOOKE206) {
> -            error_report("MMU model %i not supported by this machine",
> -                         env->mmu_model);
> +        if (!(POWERPC_CPU_GET_CLASS(cpu)->svr & POWERPC_SVR_E500)) {
> +            error_report("This machine needs a CPU from the e500 family");
>             exit(1);
>         }
>
>


  reply	other threads:[~2025-10-15 12:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 11:12 [PATCH v2] hw/ppc/e500: Check for compatible CPU type instead of aborting ungracefully Thomas Huth
2025-10-15 12:51 ` BALATON Zoltan [this message]
2025-10-15 19:13 ` Bernhard Beschow
2025-10-16  4:58 ` Harsh Prateek Bora
2025-10-22 19:05 ` Philippe Mathieu-Daudé

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=c2b57b2a-e24f-427b-0769-82465eb4032f@eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=shentey@gmail.com \
    --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).