From e208d2519d727d6edc8bfda84ab12d28d57586d0 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Mon, 11 Dec 2023 01:19:23 -0500 Subject: [PATCH] Cleanup and name some previouly-unnamed registers Signed-off-by: Daniel Berlin --- src/cpu_regs.h | 4 ++++ src/hv_exc.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cpu_regs.h b/src/cpu_regs.h index 920abf8ee..c10ca4a54 100644 --- a/src/cpu_regs.h +++ b/src/cpu_regs.h @@ -10,6 +10,7 @@ #define SYS_IMP_APL_ACTLR_EL12 sys_reg(3, 6, 15, 14, 6) #define SYS_IMP_APL_AMX_CTX_EL1 sys_reg(3, 4, 15, 5, 0) +#define SYS_IMP_APL_AMX_STATE_T sys_reg(3, 4, 15, 1, 3) #define SYS_IMP_APL_AMX_CTL_EL1 sys_reg(3, 4, 15, 1, 4) #define SYS_IMP_APL_AMX_CTL_EL2 sys_reg(3, 4, 15, 4, 7) #define SYS_IMP_APL_AMX_CTL_EL12 sys_reg(3, 4, 15, 4, 6) @@ -555,6 +556,9 @@ #define UPMCR0_IMODE_FIQ (4 << 16) #define UPMCR0_IMODE_MASK (7 << 16) +#define SYS_IMP_APL_CORE_NRG_ACC_DAT sys_reg(3, 7, 15, 1, 1) +#define SYS_IMP_APL_CORE_SRM_NRG_ACC_DAT sys_reg(3, 7, 15, 3, 1) + #define SYS_IMP_APL_UPMSR sys_reg(3, 7, 15, 6, 4) #define UPMSR_IACT (BIT(0)) diff --git a/src/hv_exc.c b/src/hv_exc.c index f4e316b7c..3533802a7 100644 --- a/src/hv_exc.c +++ b/src/hv_exc.c @@ -209,9 +209,8 @@ static bool hv_handle_msr_unlocked(struct exc_info *ctx, u64 iss) regs[31] = 0; switch (reg) { - /* Some kind of timer */ - SYSREG_PASS(sys_reg(3, 7, 15, 1, 1)); - SYSREG_PASS(sys_reg(3, 7, 15, 3, 1)); + SYSREG_PASS(SYS_IMP_APL_CORE_NRG_ACC_DAT); + SYSREG_PASS(SYS_IMP_APL_CORE_SRM_NRG_ACC_DAT); /* Architectural timer, for ECV */ SYSREG_MAP(SYS_CNTV_CTL_EL0, SYS_CNTV_CTL_EL02) SYSREG_MAP(SYS_CNTV_CVAL_EL0, SYS_CNTV_CVAL_EL02) @@ -220,6 +219,7 @@ static bool hv_handle_msr_unlocked(struct exc_info *ctx, u64 iss) SYSREG_MAP(SYS_CNTP_CVAL_EL0, SYS_CNTP_CVAL_EL02) SYSREG_MAP(SYS_CNTP_TVAL_EL0, SYS_CNTP_TVAL_EL02) /* Spammy stuff seen on t600x p-cores */ + /* These are PMU/PMC registers */ SYSREG_PASS(sys_reg(3, 2, 15, 12, 0)); SYSREG_PASS(sys_reg(3, 2, 15, 13, 0)); SYSREG_PASS(sys_reg(3, 2, 15, 14, 0)); @@ -231,7 +231,7 @@ static bool hv_handle_msr_unlocked(struct exc_info *ctx, u64 iss) /* Noisy traps */ SYSREG_PASS(SYS_IMP_APL_HID4) SYSREG_PASS(SYS_IMP_APL_EHID4) - /* We don't normally trap hese, but if we do, they're noisy */ + /* We don't normally trap these, but if we do, they're noisy */ SYSREG_PASS(SYS_IMP_APL_GXF_STATUS_EL1) SYSREG_PASS(SYS_IMP_APL_CNTVCT_ALIAS_EL0) SYSREG_PASS(SYS_IMP_APL_TPIDR_GL1) @@ -243,7 +243,7 @@ static bool hv_handle_msr_unlocked(struct exc_info *ctx, u64 iss) SYSREG_MAP(SYS_IMP_APL_APCTL_EL1, SYS_IMP_APL_APCTL_EL12) SYSREG_MAP(SYS_IMP_APL_AMX_CTL_EL1, SYS_IMP_APL_AMX_CTL_EL12) /* FIXME:Might be wrong */ - SYSREG_PASS(sys_reg(3, 4, 15, 1, 3)) + SYSREG_PASS(SYS_IMP_APL_AMX_STATE_T) /* pass through PMU handling */ SYSREG_PASS(SYS_IMP_APL_PMCR1) SYSREG_PASS(SYS_IMP_APL_PMCR2)