riscv: cpufeature: Fix thead vector hwcap removal
authorCharlie Jenkins <charlie@rivosinc.com>
Fri, 3 May 2024 04:50:50 +0000 (21:50 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 22 May 2024 16:41:02 +0000 (09:41 -0700)
commite482eab4d1eb31031eff2b6afb71776483101979
treeeff55df23649d9ad65b80a0731c6283a1333bf84
parent4cece764965020c22cff7665b18a012006359095
riscv: cpufeature: Fix thead vector hwcap removal

The riscv_cpuinfo struct that contains mvendorid and marchid is not
populated until all harts are booted which happens after the DT parsing.
Use the mvendorid/marchid from the boot hart to determine if the DT
contains an invalid V.

Fixes: d82f32202e0d ("RISC-V: Ignore V from the riscv,isa DT property on older T-Head CPUs")
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20240502-cpufeature_fixes-v4-1-b3d1a088722d@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/sbi.h
arch/riscv/kernel/cpu.c
arch/riscv/kernel/cpufeature.c