[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/38] target/ppc: Add power10 pmu SPRs
From: |
Nicholas Piggin |
Subject: |
[PULL 16/38] target/ppc: Add power10 pmu SPRs |
Date: |
Wed, 13 Mar 2024 02:58:27 +1000 |
From: Madhavan Srinivasan <maddy@linux.ibm.com>
Currently in tcg mode, when reading from power10 pmu spr like MMCR3,
qemu logs this message (when starting qemu with -d guest_errors)
Trying to read invalid spr 754 (0x2f2) at 0000000030056bb0
This is becuase, no read/write call-backs are registered for
these SPRs. Add support to register generic read/write
functions to these power10 pmu sprs to fix it.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
target/ppc/cpu.h | 6 ++++++
target/ppc/cpu_init.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 0133da4e07..ed04351f27 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1951,6 +1951,12 @@ void ppc_compat_add_property(Object *obj, const char
*name,
#define SPR_BOOKE_TLB2CFG (0x2B2)
#define SPR_BOOKE_TLB3CFG (0x2B3)
#define SPR_BOOKE_EPR (0x2BE)
+#define SPR_POWER_USIER2 (0x2E0)
+#define SPR_POWER_USIER3 (0x2E1)
+#define SPR_POWER_UMMCR3 (0x2E2)
+#define SPR_POWER_SIER2 (0x2F0)
+#define SPR_POWER_SIER3 (0x2F1)
+#define SPR_POWER_MMCR3 (0x2F2)
#define SPR_PERF0 (0x300)
#define SPR_RCPU_MI_RBA0 (0x300)
#define SPR_MPC_MI_CTR (0x300)
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index b160926a93..df31490b07 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -5308,6 +5308,38 @@ static void register_power8_pmu_user_sprs(CPUPPCState
*env)
0x00000000);
}
+static void register_power10_pmu_sup_sprs(CPUPPCState *env)
+{
+ spr_register_kvm(env, SPR_POWER_MMCR3, "MMCR3",
+ SPR_NOACCESS, SPR_NOACCESS,
+ &spr_read_generic, &spr_write_generic,
+ KVM_REG_PPC_MMCR3, 0x00000000);
+ spr_register_kvm(env, SPR_POWER_SIER2, "SIER2",
+ SPR_NOACCESS, SPR_NOACCESS,
+ &spr_read_generic, &spr_write_generic,
+ KVM_REG_PPC_SIER2, 0x00000000);
+ spr_register_kvm(env, SPR_POWER_SIER3, "SIER3",
+ SPR_NOACCESS, SPR_NOACCESS,
+ &spr_read_generic, &spr_write_generic,
+ KVM_REG_PPC_SIER3, 0x00000000);
+}
+
+static void register_power10_pmu_user_sprs(CPUPPCState *env)
+{
+ spr_register(env, SPR_POWER_UMMCR3, "UMMCR3",
+ &spr_read_generic, &spr_write_generic,
+ &spr_read_generic, &spr_write_generic,
+ 0x00000000);
+ spr_register(env, SPR_POWER_USIER2, "USIER2",
+ &spr_read_generic, SPR_NOACCESS,
+ &spr_read_generic, &spr_write_generic,
+ 0x00000000);
+ spr_register(env, SPR_POWER_USIER3, "USIER3",
+ &spr_read_generic, SPR_NOACCESS,
+ &spr_read_generic, &spr_write_generic,
+ 0x00000000);
+}
+
static void register_power5p_ear_sprs(CPUPPCState *env)
{
/* External access control */
@@ -6502,6 +6534,8 @@ static void init_proc_POWER10(CPUPPCState *env)
register_power9_mmu_sprs(env);
register_power10_hash_sprs(env);
register_power10_dexcr_sprs(env);
+ register_power10_pmu_sup_sprs(env);
+ register_power10_pmu_user_sprs(env);
/* FIXME: Filter fields properly based on privilege level */
spr_register_kvm_hv(env, SPR_PSSCR, "PSSCR", NULL, NULL, NULL, NULL,
--
2.42.0
- [PULL 11/38] ppc/pnv: Set POWER9, POWER10 ibm,pa-features bits, (continued)
- [PULL 11/38] ppc/pnv: Set POWER9, POWER10 ibm,pa-features bits, Nicholas Piggin, 2024/03/12
- [PULL 09/38] ppc/spapr: Add pa-features for POWER10 machines, Nicholas Piggin, 2024/03/12
- [PULL 13/38] docs: Deprecate the pseries-2.12 machines, Nicholas Piggin, 2024/03/12
- [PULL 14/38] docs/system/ppc: Document running Linux on AmigaNG machines, Nicholas Piggin, 2024/03/12
- [PULL 17/38] ppc/pnv: Improve pervasive topology calculation for big-core, Nicholas Piggin, 2024/03/12
- [PULL 12/38] MAINTAINERS: Remove myself as reviewer from PPC, Nicholas Piggin, 2024/03/12
- [PULL 15/38] target/ppc: Move add and subf type fixed-point arithmetic instructions to decodetree, Nicholas Piggin, 2024/03/12
- [PULL 21/38] target/ppc: Clean up ifdefs in excp_helper.c, part 1, Nicholas Piggin, 2024/03/12
- [PULL 19/38] target/ppc: Readability improvements in exception handlers, Nicholas Piggin, 2024/03/12
- [PULL 20/38] target/ppc: Add gen_exception_err_nip() function, Nicholas Piggin, 2024/03/12
- [PULL 16/38] target/ppc: Add power10 pmu SPRs,
Nicholas Piggin <=
- [PULL 18/38] target/ppc: Use env_cpu for cpu_abort in excp_helper, Nicholas Piggin, 2024/03/12
- [PULL 22/38] target/ppc: Clean up ifdefs in excp_helper.c, part 2, Nicholas Piggin, 2024/03/12
- [PULL 32/38] spapr: nested: Introduce H_GUEST_CREATE_VCPU hcall., Nicholas Piggin, 2024/03/12
- [PULL 24/38] target/ppc: Remove interrupt handler wrapper functions, Nicholas Piggin, 2024/03/12
- [PULL 25/38] spapr: nested: register nested-hv api hcalls only for cap-nested-hv, Nicholas Piggin, 2024/03/12
- [PULL 23/38] target/ppc: Clean up ifdefs in excp_helper.c, part 3, Nicholas Piggin, 2024/03/12
- [PULL 26/38] spapr: nested: move nested part of spapr_get_pate into spapr_nested.c, Nicholas Piggin, 2024/03/12
- [PULL 29/38] spapr: nested: Document Nested PAPR API, Nicholas Piggin, 2024/03/12
- [PULL 28/38] spapr: nested: keep nested-hv related code restricted to its API., Nicholas Piggin, 2024/03/12
- [PULL 30/38] spapr: nested: Introduce H_GUEST_[GET|SET]_CAPABILITIES hcalls., Nicholas Piggin, 2024/03/12