]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
riscv: vector: add a comment when calling riscv_setup_vsize()
authorAndy Chiu <andy.chiu@sifive.com>
Thu, 9 May 2024 16:26:51 +0000 (00:26 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 30 May 2024 21:33:04 +0000 (14:33 -0700)
The function would fail when it detects the calling hart's vlen doesn't
match the first one's. The boot hart is the first hart calling this
function during riscv_fill_hwcap, so it is impossible to fail here. Add
a comment about this behavior.

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240510-zve-detection-v5-1-0711bdd26c12@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/cpufeature.c

index 5ef48cb20ee119eceb82c71db65f86fe683c58b6..ccba08548004001b11e9faea77fe7d78d19b6031 100644 (file)
@@ -687,6 +687,9 @@ void __init riscv_fill_hwcap(void)
        }
 
        if (elf_hwcap & COMPAT_HWCAP_ISA_V) {
+               /*
+                * This cannot fail when called on the boot hart
+                */
                riscv_v_setup_vsize();
                /*
                 * ISA string in device tree might have 'v' flag, but