]> Git Repo - J-linux.git/commitdiff
riscv: cpufeature: Fix extension subset checking
authorCharlie Jenkins <[email protected]>
Fri, 3 May 2024 04:50:51 +0000 (21:50 -0700)
committerPalmer Dabbelt <[email protected]>
Wed, 22 May 2024 16:41:03 +0000 (09:41 -0700)
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 <[email protected]>
Reviewed-by: Conor Dooley <[email protected]>
Reviewed-by: Alexandre Ghiti <[email protected]>
Reviewed-by: Andrew Jones <[email protected]>
Fixes: 0d8295ed975b ("riscv: add ISA extension parsing for scalar crypto")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
arch/riscv/kernel/cpufeature.c

index 13d4fc0d1817ec048951a09d14eaf17cd5da2f9f..5ef48cb20ee119eceb82c71db65f86fe683c58b6 100644 (file)
@@ -603,7 +603,7 @@ static int __init riscv_fill_hwcap_from_ext_list(unsigned long *isa2hwcap)
 
                        if (ext->subset_ext_size) {
                                for (int j = 0; j < ext->subset_ext_size; j++) {
-                                       if (riscv_isa_extension_check(ext->subset_ext_ids[i]))
+                                       if (riscv_isa_extension_check(ext->subset_ext_ids[j]))
                                                set_bit(ext->subset_ext_ids[j], isainfo->isa);
                                }
                        }
This page took 0.056461 seconds and 4 git commands to generate.