From: "Nicholas Piggin" <npiggin@gmail.com>
To: "BALATON Zoltan" <balaton@eik.bme.hu>, <qemu-devel@nongnu.org>,
<qemu-ppc@nongnu.org>
Subject: Re: [PATCH] target/ppc: Add PIR to ppc_cpu_dump_state() for debug print out
Date: Mon, 17 Mar 2025 14:24:22 +1000 [thread overview]
Message-ID: <D8I97CI501PM.29Q1AWDR7ZM09@gmail.com> (raw)
In-Reply-To: <20250316144341.39E6F4E6014@zero.eik.bme.hu>
On Mon Mar 17, 2025 at 12:43 AM AEST, BALATON Zoltan wrote:
> Some CPU variants have a Processor Identification Register which was
> not printed in register dump. Add it to ppc_cpu_dump_state() which is
> used by debug options to print CPU register values.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Looks okay. I suppose it's not worth a ppc_cpu_get_pir() type function
to get it...
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Thanks,
Nick
> ---
> target/ppc/cpu_init.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 8b590e7f17..b1f32662ed 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -7606,9 +7606,14 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, int flags)
> int i;
>
> qemu_fprintf(f, "NIP " TARGET_FMT_lx " LR " TARGET_FMT_lx " CTR "
> - TARGET_FMT_lx " XER " TARGET_FMT_lx " CPU#%d\n",
> - env->nip, env->lr, env->ctr, cpu_read_xer(env),
> - cs->cpu_index);
> + TARGET_FMT_lx " XER " TARGET_FMT_lx,
> + env->nip, env->lr, env->ctr, cpu_read_xer(env));
> + if (env->spr_cb[SPR_PIR].name) {
> + qemu_fprintf(f, " PIR " TARGET_FMT_lx, env->spr[SPR_PIR]);
> + } else if (env->spr_cb[SPR_BOOKE_PIR].name) {
> + qemu_fprintf(f, " PIR " TARGET_FMT_lx, env->spr[SPR_BOOKE_PIR]);
> + }
> + qemu_fprintf(f, " CPU#%d\n", cs->cpu_index);
> qemu_fprintf(f, "MSR " TARGET_FMT_lx " HID0 " TARGET_FMT_lx " HF "
> "%08x iidx %d didx %d\n",
> env->msr, env->spr[SPR_HID0], env->hflags,
prev parent reply other threads:[~2025-03-17 4:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-16 14:43 [PATCH] target/ppc: Add PIR to ppc_cpu_dump_state() for debug print out BALATON Zoltan
2025-03-17 4:24 ` Nicholas Piggin [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=D8I97CI501PM.29Q1AWDR7ZM09@gmail.com \
--to=npiggin@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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.