Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit e67e98e

Browse files
charlie-rivospalmer-dabbelt
authored andcommitted
riscv: cpufeature: Fix extension subset checking
This loop is supposed to check if ext->subset_ext_ids[j] is valid, rather than if ext->subset_ext_ids[i] is valid, before setting the extension id ext->subset_ext_ids[j] in isainfo->isa. Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Fixes: 0d8295e ("riscv: add ISA extension parsing for scalar crypto") Link: https://lore.kernel.org/r/20240502-cpufeature_fixes-v4-2-b3d1a088722d@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent e482eab commit e67e98e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/cpufeature.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static int __init riscv_fill_hwcap_from_ext_list(unsigned long *isa2hwcap)
603603

604604
if (ext->subset_ext_size) {
605605
for (int j = 0; j < ext->subset_ext_size; j++) {
606-
if (riscv_isa_extension_check(ext->subset_ext_ids[i]))
606+
if (riscv_isa_extension_check(ext->subset_ext_ids[j]))
607607
set_bit(ext->subset_ext_ids[j], isainfo->isa);
608608
}
609609
}

0 commit comments

Comments
 (0)