qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Nicholas Piggin <npiggin@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, qemu-stable@nongnu.org,
	Daniel Henrique Barboza <danielhb413@gmail.com>,
	Harsh Prateek Bora <harshpb@linux.ibm.com>
Subject: Re: [PULL 1/2] target/ppc: Big-core scratch register fix
Date: Thu, 24 Apr 2025 10:25:57 +0200	[thread overview]
Message-ID: <2d6dead5-f56c-43cf-b7d1-9567fef99616@redhat.com> (raw)
In-Reply-To: <20250408124550.40485-2-npiggin@gmail.com>

On 08/04/2025 14.45, Nicholas Piggin wrote:
> The per-core SCRATCH0-7 registers are shared between big cores, which
> was missed in the big-core implementation. It is difficult to model
> well with the big-core == 2xPnvCore scheme we moved to, this fix
> uses the even PnvCore to store the scrach data.
> 
> Also remove a stray log message that came in with the same patch that
> introduced patch.
> 
> Fixes: c26504afd5f5c ("ppc/pnv: Add a big-core mode that joins two regular cores")
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   target/ppc/misc_helper.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c
> index 2d9512c116..46ae454afd 100644
> --- a/target/ppc/misc_helper.c
> +++ b/target/ppc/misc_helper.c
> @@ -332,6 +332,10 @@ target_ulong helper_load_sprd(CPUPPCState *env)
>       PnvCore *pc = pnv_cpu_state(cpu)->pnv_core;
>       target_ulong sprc = env->spr[SPR_POWER_SPRC];
>   
> +    if (pc->big_core) {
> +        pc = pnv_chip_find_core(pc->chip, CPU_CORE(pc)->core_id & ~0x1);
> +    }
> +
>       switch (sprc & 0x3e0) {
>       case 0: /* SCRATCH0-3 */
>       case 1: /* SCRATCH4-7 */
> @@ -368,6 +372,10 @@ void helper_store_sprd(CPUPPCState *env, target_ulong val)
>       PnvCore *pc = pnv_cpu_state(cpu)->pnv_core;
>       int nr;
>   
> +    if (pc->big_core) {
> +        pc = pnv_chip_find_core(pc->chip, CPU_CORE(pc)->core_id & ~0x1);
> +    }
> +

  Hi Nicholas,

this patch breaks compilation when QEMU has been configured with 
"--without-default-devices" :

FAILED: qemu-system-ppc64
cc -m64 @qemu-system-ppc64.rsp
/usr/bin/ld: libqemu-ppc64-softmmu.a.p/target_ppc_misc_helper.c.o: in 
function `helper_load_sprd':
.../qemu/target/ppc/misc_helper.c:336:(.text+0xcab): undefined reference to 
`pnv_chip_find_core'
/usr/bin/ld: libqemu-ppc64-softmmu.a.p/target_ppc_misc_helper.c.o: in 
function `helper_store_sprd':
.../qemu/target/ppc/misc_helper.c:376:(.text+0xda3): undefined reference to 
`pnv_chip_find_core'
collect2: error: ld returned 1 exit status

Could you please have a look?

  Thanks,
   Thomas



  reply	other threads:[~2025-04-24  8:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 12:45 [PULL 0/2] ppc-for-10.0-3 queue Nicholas Piggin
2025-04-08 12:45 ` [PULL 1/2] target/ppc: Big-core scratch register fix Nicholas Piggin
2025-04-24  8:25   ` Thomas Huth [this message]
2025-04-30  0:00     ` Nicholas Piggin
2025-04-30  5:56       ` Thomas Huth
2025-04-08 12:45 ` [PULL 2/2] target/ppc: Fix SPRC/SPRD SPRs for P9/10 Nicholas Piggin
2025-04-09  8:31 ` [PULL 0/2] ppc-for-10.0-3 queue Stefan Hajnoczi

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=2d6dead5-f56c-43cf-b7d1-9567fef99616@redhat.com \
    --to=thuth@redhat.com \
    --cc=danielhb413@gmail.com \
    --cc=harshpb@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-stable@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 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).