Skip to content

Commit 2de7689

Browse files
kristina-martsenkowilldeacon
authored andcommitted
arm64: cpufeature: remove duplicate ID_AA64ISAR2_EL1 entry
The ID register table should have one entry per ID register but currently has two entries for ID_AA64ISAR2_EL1. Only one entry has an override, and get_arm64_ftr_reg() can end up choosing the other, causing the override to be ignored. Fix this by removing the duplicate entry. While here, also make the check in sort_ftr_regs() more strict so that duplicate entries can't be added in the future. Fixes: def8c22 ("arm64: Add support of PAuth QARMA3 architected algorithm") Signed-off-by: Kristina Martsenko <[email protected]> Reviewed-by: Vladimir Murzin <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 205f399 commit 2de7689

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,6 @@ static const struct __ftr_reg_entry {
654654
ARM64_FTR_REG(SYS_ID_AA64ISAR0_EL1, ftr_id_aa64isar0),
655655
ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ISAR1_EL1, ftr_id_aa64isar1,
656656
&id_aa64isar1_override),
657-
ARM64_FTR_REG(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2),
658657
ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2,
659658
&id_aa64isar2_override),
660659

@@ -810,7 +809,7 @@ static void __init sort_ftr_regs(void)
810809
* to sys_id for subsequent binary search in get_arm64_ftr_reg()
811810
* to work correctly.
812811
*/
813-
BUG_ON(arm64_ftr_regs[i].sys_id < arm64_ftr_regs[i - 1].sys_id);
812+
BUG_ON(arm64_ftr_regs[i].sys_id <= arm64_ftr_regs[i - 1].sys_id);
814813
}
815814
}
816815

0 commit comments

Comments
 (0)