Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
TODO: audit it is safe
---
target/arm/hvf/hvf.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 26bafee259e..4fc92760934 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -1214,6 +1214,10 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t reg,
uint64_t *val)
*val = env->cp15.c9_pmcnten;
return 0;
case SYSREG_PMUSERENR_EL0:
+ /* Call the TCG sysreg handler. This is only safe for PMU regs. */
+ if (hvf_sysreg_read_cp(cpu, "PMU", reg, val)) {
+ return 0;
+ }
*val = env->cp15.c9_pmuserenr;
return 0;
case SYSREG_PMCEID0_EL0:
@@ -1505,6 +1509,10 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t reg,
uint64_t val)
pmu_op_finish(env);
return 0;
case SYSREG_PMUSERENR_EL0:
+ /* Call the TCG sysreg handler. This is only safe for PMU regs. */
+ if (hvf_sysreg_write_cp(cpu, "PMU", reg, val)) {
+ return 0;
+ }
env->cp15.c9_pmuserenr = val & 0xf;
return 0;
case SYSREG_PMCNTENSET_EL0:
--
2.51.0