Skip to content

Commit 7d0928f

Browse files
mrutland-armwildea01
authored andcommitted
arm64: fix erroneous __raw_read_system_reg() cases
Since it was introduced in commit da8d02d ("arm64/capabilities: Make use of system wide safe value"), __raw_read_system_reg() has erroneously mapped some sysreg IDs to other registers. For the fields in ID_ISAR5_EL1, our local feature detection will be erroneous. We may spuriously detect that a feature is uniformly supported, or may fail to detect when it actually is, meaning some compat hwcaps may be erroneous (or not enforced upon hotplug). This patch corrects the erroneous entries. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Fixes: da8d02d ("arm64/capabilities: Make use of system wide safe value") Reported-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: stable@vger.kernel.org Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent f85279b commit 7d0928f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,15 +664,15 @@ static u64 __raw_read_system_reg(u32 sys_id)
664664
case SYS_ID_ISAR2_EL1: return read_cpuid(ID_ISAR2_EL1);
665665
case SYS_ID_ISAR3_EL1: return read_cpuid(ID_ISAR3_EL1);
666666
case SYS_ID_ISAR4_EL1: return read_cpuid(ID_ISAR4_EL1);
667-
case SYS_ID_ISAR5_EL1: return read_cpuid(ID_ISAR4_EL1);
667+
case SYS_ID_ISAR5_EL1: return read_cpuid(ID_ISAR5_EL1);
668668
case SYS_MVFR0_EL1: return read_cpuid(MVFR0_EL1);
669669
case SYS_MVFR1_EL1: return read_cpuid(MVFR1_EL1);
670670
case SYS_MVFR2_EL1: return read_cpuid(MVFR2_EL1);
671671

672672
case SYS_ID_AA64PFR0_EL1: return read_cpuid(ID_AA64PFR0_EL1);
673-
case SYS_ID_AA64PFR1_EL1: return read_cpuid(ID_AA64PFR0_EL1);
673+
case SYS_ID_AA64PFR1_EL1: return read_cpuid(ID_AA64PFR1_EL1);
674674
case SYS_ID_AA64DFR0_EL1: return read_cpuid(ID_AA64DFR0_EL1);
675-
case SYS_ID_AA64DFR1_EL1: return read_cpuid(ID_AA64DFR0_EL1);
675+
case SYS_ID_AA64DFR1_EL1: return read_cpuid(ID_AA64DFR1_EL1);
676676
case SYS_ID_AA64MMFR0_EL1: return read_cpuid(ID_AA64MMFR0_EL1);
677677
case SYS_ID_AA64MMFR1_EL1: return read_cpuid(ID_AA64MMFR1_EL1);
678678
case SYS_ID_AA64MMFR2_EL1: return read_cpuid(ID_AA64MMFR2_EL1);

0 commit comments

Comments
 (0)