| 1 |
// SPDX-License-Identifier: GPL-2.0-only |
| 2 |
|
| 3 |
#include <asm/cpufeature.h> |
| 4 |
#include <asm/vendor_extensions.h> |
| 5 |
#include <asm/vendor_extensions/thead.h> |
| 6 |
|
| 7 |
#include <linux/array_size.h> |
| 8 |
#include <linux/cpumask.h> |
| 9 |
#include <linux/types.h> |
| 10 |
|
| 11 |
/* All T-Head vendor extensions supported in Linux */ |
| 12 |
static const struct riscv_isa_ext_data riscv_isa_vendor_ext_thead[] = { |
| 13 |
__RISCV_ISA_EXT_DATA(xtheadvector, RISCV_ISA_VENDOR_EXT_XTHEADVECTOR), |
| 14 |
}; |
| 15 |
|
| 16 |
struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_thead = { |
| 17 |
.ext_data_count = ARRAY_SIZE(riscv_isa_vendor_ext_thead), |
| 18 |
.ext_data = riscv_isa_vendor_ext_thead, |
| 19 |
}; |
| 20 |
|
| 21 |
void disable_xtheadvector(void) |
| 22 |
{ |
| 23 |
int cpu; |
| 24 |
|
| 25 |
for_each_possible_cpu(cpu) |
| 26 |
clear_bit(RISCV_ISA_VENDOR_EXT_XTHEADVECTOR, riscv_isa_vendor_ext_list_thead.per_hart_isa_bitmap[cpu].isa); |
| 27 |
|
| 28 |
clear_bit(RISCV_ISA_VENDOR_EXT_XTHEADVECTOR, riscv_isa_vendor_ext_list_thead.all_harts_isa_bitmap.isa); |
| 29 |
} |