diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2024-07-11 18:31:35 +1000 |
---|---|---|
committer | Nicholas Piggin <npiggin@gmail.com> | 2024-07-26 09:21:06 +1000 |
commit | 16ffcb3401ddb991ec746de05595ba62eae45a1b (patch) | |
tree | 2ecaa5ebb4886572c2efa7ffbd05f7ca802d09d3 | |
parent | 27f61d1b0b708b4659894cd0677f65ebed6eaa0b (diff) | |
download | qemu-16ffcb3401ddb991ec746de05595ba62eae45a1b.zip qemu-16ffcb3401ddb991ec746de05595ba62eae45a1b.tar.gz qemu-16ffcb3401ddb991ec746de05595ba62eae45a1b.tar.bz2 |
ppc/pnv: Implement Power9 CPU core thread state indirect register
Power9 CPUs have a core thread state register accessible via SPRC/SPRD
indirect registers. This register includes a bit for big-core mode,
which skiboot requires.
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
-rw-r--r-- | target/ppc/misc_helper.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c index 9789d69..1b83971 100644 --- a/target/ppc/misc_helper.c +++ b/target/ppc/misc_helper.c @@ -325,6 +325,23 @@ target_ulong helper_load_sprd(CPUPPCState *env) case 0: /* SCRATCH0-3 */ case 1: /* SCRATCH4-7 */ return pc->scratch[(sprc >> 3) & 0x7]; + + case 0x1e0: /* core thread state */ + if (env->excp_model == POWERPC_EXCP_POWER9) { + /* + * Only implement for POWER9 because skiboot uses it to check + * big-core mode. Other bits are unimplemented so we would + * prefer to get unimplemented message on POWER10 if it were + * used anywhere. + */ + if (pc->big_core) { + return PPC_BIT(63); + } else { + return 0; + } + } + /* fallthru */ + default: qemu_log_mask(LOG_UNIMP, "mfSPRD: Unimplemented SPRC:0x" TARGET_FMT_lx"\n", sprc); |