diff options
| author | Charlie Jenkins <charlie@rivosinc.com> | 2024-11-13 18:21:11 -0800 |
|---|---|---|
| committer | Palmer Dabbelt <palmer@rivosinc.com> | 2025-01-18 12:33:29 -0800 |
| commit | 377be47f90e411c10440650864d72d2ecb639bd7 (patch) | |
| tree | dcfbba3bdbf69ae58dafb85881a71603597ba6bd /arch/riscv/kernel/vendor_extensions | |
| parent | cddd63869f9214f2bc5c4b89a8ea1bd0ff4d89c5 (diff) | |
| download | lwn-377be47f90e411c10440650864d72d2ecb639bd7.tar.gz lwn-377be47f90e411c10440650864d72d2ecb639bd7.zip | |
riscv: vector: Use vlenb from DT for thead
If thead,vlenb is provided in the device tree, prefer that over reading
the vlenb csr.
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Yangyu Chen <cyy@cyyself.name>
Link: https://lore.kernel.org/r/20241113-xtheadvector-v11-5-236c22791ef9@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/kernel/vendor_extensions')
| -rw-r--r-- | arch/riscv/kernel/vendor_extensions/thead.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/riscv/kernel/vendor_extensions/thead.c b/arch/riscv/kernel/vendor_extensions/thead.c index 0f27baf8d245..519dbf70710a 100644 --- a/arch/riscv/kernel/vendor_extensions/thead.c +++ b/arch/riscv/kernel/vendor_extensions/thead.c @@ -5,6 +5,7 @@ #include <asm/vendor_extensions/thead.h> #include <linux/array_size.h> +#include <linux/cpumask.h> #include <linux/types.h> /* All T-Head vendor extensions supported in Linux */ @@ -16,3 +17,13 @@ struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_thead = { .ext_data_count = ARRAY_SIZE(riscv_isa_vendor_ext_thead), .ext_data = riscv_isa_vendor_ext_thead, }; + +void disable_xtheadvector(void) +{ + int cpu; + + for_each_possible_cpu(cpu) + clear_bit(RISCV_ISA_VENDOR_EXT_XTHEADVECTOR, riscv_isa_vendor_ext_list_thead.per_hart_isa_bitmap[cpu].isa); + + clear_bit(RISCV_ISA_VENDOR_EXT_XTHEADVECTOR, riscv_isa_vendor_ext_list_thead.all_harts_isa_bitmap.isa); +} |
