Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30 lines
901 B
C
30 lines
901 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
#include <asm/cpufeature.h>
|
|
#include <asm/vendor_extensions.h>
|
|
#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 */
|
|
static const struct riscv_isa_ext_data riscv_isa_vendor_ext_thead[] = {
|
|
__RISCV_ISA_EXT_DATA(xtheadvector, RISCV_ISA_VENDOR_EXT_XTHEADVECTOR),
|
|
};
|
|
|
|
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);
|
|
}
|