From c3ba77ce162a9ff80427303fd4af51183c897f9e Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sat, 18 Sep 2021 22:27:27 +0900 Subject: [PATCH] hv_exc: Handle SYS_IMP_APL_CYC_OVRD in the fast path m1n1 now uses this for SMP, and due to wfi FIQ leakage from the HV timer this gets spammed thousands of times per second. Handle it in the HV directly. Fixes: #107 Signed-off-by: Hector Martin --- proxyclient/m1n1/hv.py | 1 - src/hv_exc.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/proxyclient/m1n1/hv.py b/proxyclient/m1n1/hv.py index 4b5bdc2d..2327fa2c 100644 --- a/proxyclient/m1n1/hv.py +++ b/proxyclient/m1n1/hv.py @@ -546,7 +546,6 @@ class HV(Reloadable): } ro = { ACC_CFG_EL1, - CYC_OVRD_EL1, ACC_OVRD_EL1, } value = 0 diff --git a/src/hv_exc.c b/src/hv_exc.c index 7d7158fa..e125d4ef 100644 --- a/src/hv_exc.c +++ b/src/hv_exc.c @@ -166,6 +166,10 @@ static bool hv_handle_msr(u64 *regs, u64 iss) SYSREG_PASS(SYS_IMP_APL_PMC7) SYSREG_PASS(SYS_IMP_APL_PMC8) SYSREG_PASS(SYS_IMP_APL_PMC9) + /* Handle this one here because m1n1/Linux (will) use it for explicit cpuidle. + * We can pass it through; going into deep sleep doesn't break the HV since we + * don't do any wfis that assume otherwise in m1n1. */ + SYSREG_PASS(SYS_IMP_APL_CYC_OVRD) /* IPI handling */ SYSREG_PASS(SYS_IMP_APL_IPI_RR_LOCAL_EL1) SYSREG_PASS(SYS_IMP_APL_IPI_RR_GLOBAL_EL1)