From d2f537bb52028f14a3bb418a21e2f7e85d1a23eb Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Thu, 10 Sep 2020 21:28:28 +0800 Subject: [PATCH] arm64: cpufeature: Fix missing ZFR0 in __read_sysreg_by_encoding() mainline inclusion from mainline-v5.9-rc1 commit 78ed70bf3a92 category: bugfix bugzilla: NA CVE: NA ------------------------------------------------- In commit 06a916feca2b ("arm64: Expose SVE2 features for userspace"), new hwcaps are added that are detected via fields in the SVE-specific ID register ID_AA64ZFR0_EL1. In order to check compatibility of secondary cpus with the hwcaps established at boot, the cpufeatures code uses __read_sysreg_by_encoding() to read this ID register based on the sys_reg field of the arm64_elf_hwcaps[] table. This leads to a kernel splat if an hwcap uses an ID register that __read_sysreg_by_encoding() doesn't explicitly handle, as now happens when exercising cpu hotplug on an SVE2-capable platform. So fix it by adding the required case in there. Fixes: 06a916feca2b ("arm64: Expose SVE2 features for userspace") Signed-off-by: Dave Martin Signed-off-by: Will Deacon Signed-off-by: Wang Faren Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- arch/arm64/kernel/cpufeature.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index fad4d32cec63..b342b0edc952 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -858,6 +858,7 @@ static u64 __read_sysreg_by_encoding(u32 sys_id) read_sysreg_case(SYS_ID_AA64PFR0_EL1); read_sysreg_case(SYS_ID_AA64PFR1_EL1); + read_sysreg_case(SYS_ID_AA64ZFR0_EL1); read_sysreg_case(SYS_ID_AA64DFR0_EL1); read_sysreg_case(SYS_ID_AA64DFR1_EL1); read_sysreg_case(SYS_ID_AA64MMFR0_EL1); -- GitLab