riscv: Add vendor extensions support for SiFive
Subsystems (4)
cover riscv: Add vendor extensions support for SiFive
This patch set adds four vendor-specific ISA extensions from SiFive:
"xsfvqmaccdod", "xsfvqmaccqoq", "xsfvfnrclipxfqf", and "xsfvfwmaccqqq".
Additionally, a new hwprobe key, RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0, has been added to query which SiFive vendor extensions are supported on the current platform.
Cyan Yang (12):
dt-bindings: riscv: Add xsfvqmaccdod and xsfvqmaccqoq ISA extension
description
riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions
riscv: hwprobe: Document SiFive xsfvqmaccdod and xsfvqmaccqoq vendor
extensions
riscv: hwprobe: Add SiFive vendor extension support and probe for
xsfqmaccdod and xsfqmaccqoq
dt-bindings: riscv: Add xsfvfnrclipxfqf ISA extension description
riscv: Add SiFive xsfvfnrclipxfqf vendor extension
riscv: hwprobe: Document SiFive xsfvfnrclipxfqf vendor extension
riscv: hwprobe: Add SiFive xsfvfnrclipxfqf vendor extension
dt-bindings: riscv: Add xsfvfwmaccqqq ISA extension description
riscv: Add SiFive xsfvfwmaccqqq vendor extension
riscv: hwprobe: Document SiFive xsfvfwmaccqqq vendor extension
riscv: hwprobe: Add SiFive xsfvfwmaccqqq vendor extension
Documentation/arch/riscv/hwprobe.rst | 22 ++++++++++++++++ .../devicetree/bindings/riscv/extensions.yaml | 25 +++++++++++++++++++ arch/riscv/Kconfig.vendor | 13 ++++++++++ arch/riscv/include/asm/hwprobe.h | 3 ++- .../include/asm/vendor_extensions/sifive.h | 16 ++++++++++++ .../asm/vendor_extensions/sifive_hwprobe.h | 19 ++++++++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/include/uapi/asm/vendor/sifive.h | 6 +++++ arch/riscv/kernel/sys_hwprobe.c | 5 ++++ arch/riscv/kernel/vendor_extensions.c | 10 ++++++++ arch/riscv/kernel/vendor_extensions/Makefile | 2 ++ arch/riscv/kernel/vendor_extensions/sifive.c | 21 ++++++++++++++++ .../kernel/vendor_extensions/sifive_hwprobe.c | 22 ++++++++++++++++ 13 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 arch/riscv/include/asm/vendor_extensions/sifive.h create mode 100644 arch/riscv/include/asm/vendor_extensions/sifive_hwprobe.h create mode 100644 arch/riscv/include/uapi/asm/vendor/sifive.h create mode 100644 arch/riscv/kernel/vendor_extensions/sifive.c create mode 100644 arch/riscv/kernel/vendor_extensions/sifive_hwprobe.c
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 1/12 dt-bindings: riscv: Add xsfvqmaccdod and xsfvqmaccqoq ISA extension description
Add "xsfvqmaccdod" and "xsfvqmaccqoq" ISA extensions which are provided by SiFive for int8 matrix multiplication instructions support.
--- .../devicetree/bindings/riscv/extensions.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +13 -0
@@ -662,6 +662,19 @@ properties: Registers in the AX45MP datasheet. https://www.andestech.com/wp-content/uploads/AX45MP-1C-Rev.-5.0.0-Datasheet.pdf + # SiFive + - const: xsfvqmaccdod + description: + SiFive Int8 Matrix Multiplication Extensions Specification. + See more details in + https://www.sifive.com/document-file/sifive-int8-matrix-multiplication-extensions-specification + + - const: xsfvqmaccqoq + description: + SiFive Int8 Matrix Multiplication Extensions Specification. + See more details in + https://www.sifive.com/document-file/sifive-int8-matrix-multiplication-extensions-specification + # T-HEAD - const: xtheadvector description:
Signature · 1 line
2.39.5 (Apple Git-154)
Re: [PATCH 01/12] dt-bindings: riscv: Add xsfvqmaccdod and xsfvqmaccqoq ISA extension description
Quoted 4 lines · Cyan Yang
Add "xsfvqmaccdod" and "xsfvqmaccqoq" ISA extensions which are provided by SiFive for int8 matrix multiplication instructions support.
Signed-off-by Cyan Yang <[email protected]>
If these have some dependencies, please look at how other extensions have made them required. Otherwise all three dt-binding patches look fine. I'll leave acks on them all, but with the condition that you should make dependencies required.
Quoted 31 lines
--- .../devicetree/bindings/riscv/extensions.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +13
-0@@ -662,6 +662,19 @@ properties: Registers in the AX45MP datasheet. https://www.andestech.com/wp-content/uploads/AX45MP-1C-Rev.-5.0.0-Datasheet.pdf + # SiFive + - const: xsfvqmaccdod + description: + SiFive Int8 Matrix Multiplication Extensions Specification. + See more details in + https://www.sifive.com/document-file/sifive-int8-matrix-multiplication-extensions-specification + + - const: xsfvqmaccqoq + description: + SiFive Int8 Matrix Multiplication Extensions Specification. + See more details in + https://www.sifive.com/document-file/sifive-int8-matrix-multiplication-extensions-specification + # T-HEAD - const: xtheadvector description:Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 2/12 riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions
In reply to Cyan YangAdd SiFive vendor extension support to the kernel with the target of "xsfvqmaccdod" and "xsfvqmaccqoq".
--- arch/riscv/Kconfig.vendor | 13 +++++++++++++ .../include/asm/vendor_extensions/sifive.h | 14 ++++++++++++++ arch/riscv/kernel/vendor_extensions.c | 10 ++++++++++ arch/riscv/kernel/vendor_extensions/Makefile | 1 + arch/riscv/kernel/vendor_extensions/sifive.c | 19 +++++++++++++++++++ 5 files changed, 57 insertions(+) create mode 100644 arch/riscv/include/asm/vendor_extensions/sifive.h create mode 100644 arch/riscv/kernel/vendor_extensions/sifive.c
arch/riscv/Kconfig.vendor +13 -0
@@ -16,6 +16,19 @@ config RISCV_ISA_VENDOR_EXT_ANDES If you don't know what to do here, say Y. endmenu +menu "SiFive" +config RISCV_ISA_VENDOR_EXT_SIFIVE + bool "SiFive vendor extension support" + select RISCV_ISA_VENDOR_EXT + default y + help + Say N here if you want to disable all SiFive vendor extension + support. This will cause any SiFive vendor extensions that are + requested by hardware probing to be ignored. + + If you don't know what to do here, say Y. +endmenu + menu "T-Head" config RISCV_ISA_VENDOR_EXT_THEAD bool "T-Head vendor extension support"
arch/riscv/include/asm/vendor_extensions/sifive.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_RISCV_VENDOR_EXTENSIONS_SIFIVE_H +#define _ASM_RISCV_VENDOR_EXTENSIONS_SIFIVE_H + +#include <asm/vendor_extensions.h> + +#include <linux/types.h> + +#define RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD 0 +#define RISCV_ISA_VENDOR_EXT_XSFVQMACCQOQ 1 + +extern struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_sifive; + +#endif
arch/riscv/kernel/vendor_extensions.c +10 -0
@@ -6,6 +6,7 @@#include <asm/vendorid_list.h> #include <asm/vendor_extensions.h> #include <asm/vendor_extensions/andes.h> +#include <asm/vendor_extensions/sifive.h> #include <asm/vendor_extensions/thead.h> #include <linux/array_size.h>
@@ -15,6 +16,9 @@ struct riscv_isa_vendor_ext_data_list *riscv_isa_vendor_ext_list[] = {#ifdef CONFIG_RISCV_ISA_VENDOR_EXT_ANDES &riscv_isa_vendor_ext_list_andes,#endif +#ifdef CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE + &riscv_isa_vendor_ext_list_sifive, +#endif #ifdef CONFIG_RISCV_ISA_VENDOR_EXT_THEAD &riscv_isa_vendor_ext_list_thead,#endif
@@ -45,6 +49,12 @@ bool __riscv_isa_vendor_extension_available(int cpu, unsigned long vendor, unsig cpu_bmap = riscv_isa_vendor_ext_list_andes.per_hart_isa_bitmap;break ;#endif +#ifdef CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE +case SIFIVE_VENDOR_ID : + bmap = &riscv_isa_vendor_ext_list_sifive.all_harts_isa_bitmap; + cpu_bmap = riscv_isa_vendor_ext_list_sifive.per_hart_isa_bitmap; +break ; +#endif #ifdef CONFIG_RISCV_ISA_VENDOR_EXT_THEAD case THEAD_VENDOR_ID : bmap = &riscv_isa_vendor_ext_list_thead.all_harts_isa_bitmap;
arch/riscv/kernel/vendor_extensions/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_ANDES) += andes.o +obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE) += sifive.o obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_THEAD) += thead.o obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_THEAD) += thead_hwprobe.o
arch/riscv/kernel/vendor_extensions/sifive.c new file +19 -0
@@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include <asm/cpufeature.h> +#include <asm/vendor_extensions.h> +#include <asm/vendor_extensions/sifive.h> + +#include <linux/array_size.h> +#include <linux/types.h> + +/* All SiFive vendor extensions supported in Linux */ +const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = { +__RISCV_ISA_EXT_DATA (xsfvqmaccdod,RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD ), +__RISCV_ISA_EXT_DATA (xsfvqmaccqoq,RISCV_ISA_VENDOR_EXT_XSFVQMACCQOQ ), +}; + +struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_sifive = { + .ext_data_count =ARRAY_SIZE (riscv_isa_vendor_ext_sifive), + .ext_data = riscv_isa_vendor_ext_sifive, +};
Signature · 1 line
2.39.5 (Apple Git-154)
kernel test robot
build botRe: [PATCH 02/12] riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions
kernel test robot noticed the following build warnings:
Hi Cyan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.15-rc5 next-20250507] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Cyan-Yang/dt-bindings-riscv-Add-xsfvqmaccdod-and-xsfvqmaccqoq-ISA-extension-description/20250418-133832 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next patch link: https://lore.kernel.org/r/20250418053239.4351-3-cyan.yang%40sifive.com patch subject: [PATCH 02/12] riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions config: riscv-randconfig-r112-20250426 (https://download.01.org/0day-ci/archive/20250507/[email protected]/config) compiler: riscv64-linux-gcc (GCC) 8.5.0 reproduce: (https://download.01.org/0day-ci/archive/20250507/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kernel/vendor_extensions/sifive.c:11:33: sparse: sparse: symbol 'riscv_isa_vendor_ext_sifive' was not declared. Should it be static?
vim +/riscv_isa_vendor_ext_sifive +11 arch/riscv/kernel/vendor_extensions/sifive.c
9
10 /* All SiFive vendor extensions supported in Linux */
> 11 const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = { 12 __RISCV_ISA_EXT_DATA(xsfvqmaccdod, RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD),
13 __RISCV_ISA_EXT_DATA(xsfvqmaccqoq, RISCV_ISA_VENDOR_EXT_XSFVQMACCQOQ),
14 };
15
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH 3/12 riscv: hwprobe: Document SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions
In reply to Cyan YangDocument the support for sifive vendor extensions using the key RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0 and two vendor extensions for SiFive Int8 Matrix Multiplication Instructions using RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCDOD and RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCQOQ.
--- Documentation/arch/riscv/hwprobe.rst | 14 ++++++++++++++ arch/riscv/include/asm/hwprobe.h | 2 +- arch/riscv/include/uapi/asm/hwprobe.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-)
Documentation/arch/riscv/hwprobe.rst +14 -0
@@ -335,3 +335,17 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_KEY_ZICBOM_BLOCK_SIZE`: An unsigned int which represents the size of the Zicbom block in bytes. + +* :c:macro:`RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0`: A bitmask containing the + sifive vendor extensions that are compatible with the + :c:macro:`RISCV_HWPROBE_BASE_BEHAVIOR_IMA`: base system behavior. + + * SIFIVE + + * :c:macro:`RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCDOD`: The Xsfqmaccdod vendor + extension is supported in version 1.1 of SiFive Int8 Matrix Multiplication + Extensions Specification. + + * :c:macro:`RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCQOQ`: The Xsfqmaccqoq vendor + extension is supported in version 1.1 of SiFive Int8 Matrix Multiplication + Instruction Extensions Specification.
arch/riscv/include/asm/hwprobe.h +1 -1
@@ -8,7 +8,7 @@#include <uapi/asm/hwprobe.h> -#define RISCV_HWPROBE_MAX_KEY 12 +#define RISCV_HWPROBE_MAX_KEY 13static inline bool riscv_hwprobe_key_is_valid (__s64 key) {
arch/riscv/include/uapi/asm/hwprobe.h +1 -0
@@ -104,6 +104,7 @@ struct riscv_hwprobe {#define RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED 4#define RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0 11#define RISCV_HWPROBE_KEY_ZICBOM_BLOCK_SIZE 12 +#define RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0 13/* Increase RISCV_HWPROBE_MAX_KEY when adding items. */ /* Flags */
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 4/12 riscv: hwprobe: Add SiFive vendor extension support and probe for xsfqmaccdod and xsfqmaccqoq
In reply to Cyan YangAdd a new hwprobe key "RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0" which allows userspace to probe for the new vendor extensions from SiFive. Also, add new hwprobe for SiFive "xsfvqmaccdod" and "xsfvqmaccqoq" vendor extensions.
--- arch/riscv/include/asm/hwprobe.h | 1 + .../asm/vendor_extensions/sifive_hwprobe.h | 19 ++++++++++++++++++ arch/riscv/include/uapi/asm/vendor/sifive.h | 4 ++++ arch/riscv/kernel/sys_hwprobe.c | 5 +++++ arch/riscv/kernel/vendor_extensions/Makefile | 1 + .../kernel/vendor_extensions/sifive_hwprobe.c | 20 +++++++++++++++++++ 6 files changed, 50 insertions(+) create mode 100644 arch/riscv/include/asm/vendor_extensions/sifive_hwprobe.h create mode 100644 arch/riscv/include/uapi/asm/vendor/sifive.h create mode 100644 arch/riscv/kernel/vendor_extensions/sifive_hwprobe.c
arch/riscv/include/asm/hwprobe.h +1 -0
@@ -22,6 +22,7 @@ static inline bool hwprobe_key_is_bitmask(__s64 key)case RISCV_HWPROBE_KEY_IMA_EXT_0 :case RISCV_HWPROBE_KEY_CPUPERF_0 :case RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0 : +case RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0 :return true; }
arch/riscv/include/asm/vendor_extensions/sifive_hwprobe.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_RISCV_VENDOR_EXTENSIONS_SIFIVE_HWPROBE_H +#define _ASM_RISCV_VENDOR_EXTENSIONS_SIFIVE_HWPROBE_H + +#include <linux/cpumask.h> + +#include <uapi/asm/hwprobe.h> + +#ifdef CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE +void hwprobe_isa_vendor_ext_sifive_0 (struct riscv_hwprobe *pair,const struct cpumask *cpus); +#else +static inline void hwprobe_isa_vendor_ext_sifive_0 (struct riscv_hwprobe *pair, +const struct cpumask *cpus) +{ + pair->value =0 ; +} +#endif + +#endif
arch/riscv/include/uapi/asm/vendor/sifive.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ + +#define RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCDOD (1 << 0) +#define RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCQOQ (1 << 1)
arch/riscv/kernel/sys_hwprobe.c +5 -0
@@ -15,6 +15,7 @@#include <asm/uaccess.h> #include <asm/unistd.h> #include <asm/vector.h> +#include <asm/vendor_extensions/sifive_hwprobe.h> #include <asm/vendor_extensions/thead_hwprobe.h> #include <vdso/vsyscall.h>
@@ -300,6 +301,10 @@ static void hwprobe_one_pair(struct riscv_hwprobe *pair, pair->value = riscv_timebase;break ; +case RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0 : +hwprobe_isa_vendor_ext_sifive_0 (pair, cpus); +break ; +case RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0 :hwprobe_isa_vendor_ext_thead_0 (pair, cpus);break ;
arch/riscv/kernel/vendor_extensions/Makefile +1 -0
@@ -2,5 +2,6 @@ obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_ANDES) += andes.o obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE) += sifive.o +obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE) += sifive_hwprobe.o obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_THEAD) += thead.o obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_THEAD) += thead_hwprobe.o
arch/riscv/kernel/vendor_extensions/sifive_hwprobe.c new file +20 -0
@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include <asm/vendor_extensions/sifive.h> +#include <asm/vendor_extensions/sifive_hwprobe.h> +#include <asm/vendor_extensions/vendor_hwprobe.h> + +#include <linux/cpumask.h> +#include <linux/types.h> + +#include <uapi/asm/hwprobe.h> +#include <uapi/asm/vendor/sifive.h> + +void hwprobe_isa_vendor_ext_sifive_0 (struct riscv_hwprobe *pair,const struct cpumask *cpus) +{ +VENDOR_EXTENSION_SUPPORTED (pair, cpus, + riscv_isa_vendor_ext_list_sifive.per_hart_isa_bitmap, { +VENDOR_EXT_KEY (XSFVQMACCDOD ); +VENDOR_EXT_KEY (XSFVQMACCQOQ ); + }); +}
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 5/12 dt-bindings: riscv: Add xsfvfnrclipxfqf ISA extension description
In reply to Cyan YangAdd "xsfvfnrclipxfqf" ISA extension which is provided by SiFive for FP32-to-int8 ranged clip instructions support.
--- Documentation/devicetree/bindings/riscv/extensions.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +6 -0
@@ -675,6 +675,12 @@ properties: See more details in https://www.sifive.com/document-file/sifive-int8-matrix-multiplication-extensions-specification + - const: xsfvfnrclipxfqf + description: + SiFive FP32-to-int8 Ranged Clip Instructions Extensions Specification. + See more details in + https://www.sifive.com/document-file/fp32-to-int8-ranged-clip-instructions + # T-HEAD - const: xtheadvector description:
Signature · 1 line
2.39.5 (Apple Git-154)
Re: [PATCH 05/12] dt-bindings: riscv: Add xsfvfnrclipxfqf ISA extension description
Quoted 4 lines · Cyan Yang
Add "xsfvfnrclipxfqf" ISA extension which is provided by SiFive for FP32-to-int8 ranged clip instructions support.
Signed-off-by Cyan Yang <[email protected]>
PATCH 6/12 riscv: Add SiFive xsfvfnrclipxfqf vendor extension
In reply to Cyan YangAdd SiFive vendor extension "xsfvfnrclipxfqf" support to the kernel.
--- arch/riscv/include/asm/vendor_extensions/sifive.h | 1 + arch/riscv/kernel/vendor_extensions/sifive.c | 1 + 2 files changed, 2 insertions(+)
arch/riscv/include/asm/vendor_extensions/sifive.h +1 -0
@@ -8,6 +8,7 @@#define RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD 0#define RISCV_ISA_VENDOR_EXT_XSFVQMACCQOQ 1 +#define RISCV_ISA_VENDOR_EXT_XSFVFNRCLIPXFQF 2extern struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_sifive;
arch/riscv/kernel/vendor_extensions/sifive.c +1 -0
@@ -9,6 +9,7 @@/* All SiFive vendor extensions supported in Linux */ const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = { +__RISCV_ISA_EXT_DATA (xsfvfnrclipxfqf,RISCV_ISA_VENDOR_EXT_XSFVFNRCLIPXFQF ),__RISCV_ISA_EXT_DATA (xsfvqmaccdod,RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD ),__RISCV_ISA_EXT_DATA (xsfvqmaccqoq,RISCV_ISA_VENDOR_EXT_XSFVQMACCQOQ ), };
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 7/12 riscv: hwprobe: Document SiFive xsfvfnrclipxfqf vendor extension
In reply to Cyan YangDocument the support for SiFive vendor extensions for FP32-to-int8 Ranged Clip Instructions using RISCV_HWPROBE_VENDOR_EXT_XSFVFNRCLIPXFQF.
--- Documentation/arch/riscv/hwprobe.rst | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/arch/riscv/hwprobe.rst +4 -0
@@ -349,3 +349,7 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCQOQ`: The Xsfqmaccqoq vendor extension is supported in version 1.1 of SiFive Int8 Matrix Multiplication Instruction Extensions Specification. + + * :c:macro:`RISCV_HWPROBE_VENDOR_EXT_XSFVFNRCLIPXFQF`: The Xsfvfnrclipxfqf + vendor extension is supported in version 1.0 of SiFive FP32-to-int8 Ranged + Clip Instructions Extensions Specification.
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 8/12 riscv: hwprobe: Add SiFive xsfvfnrclipxfqf vendor extension
In reply to Cyan YangAdd hwprobe for SiFive "xsfvfnrclipxfqf" vendor extension.
--- arch/riscv/include/uapi/asm/vendor/sifive.h | 1 + arch/riscv/kernel/vendor_extensions/sifive_hwprobe.c | 1 + 2 files changed, 2 insertions(+)
arch/riscv/include/uapi/asm/vendor/sifive.h +1 -0
@@ -2,3 +2,4 @@#define RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCDOD (1 << 0)#define RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCQOQ (1 << 1) +#define RISCV_HWPROBE_VENDOR_EXT_XSFVFNRCLIPXFQF (1 << 2)
arch/riscv/kernel/vendor_extensions/sifive_hwprobe.c +1 -0
@@ -16,5 +16,6 @@ void hwprobe_isa_vendor_ext_sifive_0(struct riscv_hwprobe *pair, const struct cp riscv_isa_vendor_ext_list_sifive.per_hart_isa_bitmap, {VENDOR_EXT_KEY (XSFVQMACCDOD );VENDOR_EXT_KEY (XSFVQMACCQOQ ); +VENDOR_EXT_KEY (XSFVFNRCLIPXFQF ); }); }
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 9/12 dt-bindings: riscv: Add xsfvfwmaccqqq ISA extension description
In reply to Cyan YangAdd "xsfvfwmaccqqq" ISA extension which is provided by SiFive for matrix multiply accumulate instructions support.
--- Documentation/devicetree/bindings/riscv/extensions.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +6 -0
@@ -681,6 +681,12 @@ properties: See more details in https://www.sifive.com/document-file/fp32-to-int8-ranged-clip-instructions + - const: xsfvfwmaccqqq + description: + SiFive Matrix Multiply Accumulate Instruction Extensions Specification. + See more details in + https://www.sifive.com/document-file/matrix-multiply-accumulate-instruction + # T-HEAD - const: xtheadvector description:
Signature · 1 line
2.39.5 (Apple Git-154)
Re: [PATCH 09/12] dt-bindings: riscv: Add xsfvfwmaccqqq ISA extension description
Quoted 4 lines · Cyan Yang
Add "xsfvfwmaccqqq" ISA extension which is provided by SiFive for matrix multiply accumulate instructions support.
Signed-off-by Cyan Yang <[email protected]>
PATCH 10/12 riscv: Add SiFive xsfvfwmaccqqq vendor extension
In reply to Cyan YangAdd SiFive vendor extension "xsfvfwmaccqqq" support to the kernel.
--- arch/riscv/include/asm/vendor_extensions/sifive.h | 1 + arch/riscv/kernel/vendor_extensions/sifive.c | 1 + 2 files changed, 2 insertions(+)
arch/riscv/include/asm/vendor_extensions/sifive.h +1 -0
@@ -9,6 +9,7 @@#define RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD 0#define RISCV_ISA_VENDOR_EXT_XSFVQMACCQOQ 1#define RISCV_ISA_VENDOR_EXT_XSFVFNRCLIPXFQF 2 +#define RISCV_ISA_VENDOR_EXT_XSFVFWMACCQQQ 3extern struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_sifive;
arch/riscv/kernel/vendor_extensions/sifive.c +1 -0
@@ -10,6 +10,7 @@/* All SiFive vendor extensions supported in Linux */ const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = {__RISCV_ISA_EXT_DATA (xsfvfnrclipxfqf,RISCV_ISA_VENDOR_EXT_XSFVFNRCLIPXFQF ), +__RISCV_ISA_EXT_DATA (xsfvfwmaccqqq,RISCV_ISA_VENDOR_EXT_XSFVFWMACCQQQ ),__RISCV_ISA_EXT_DATA (xsfvqmaccdod,RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD ),__RISCV_ISA_EXT_DATA (xsfvqmaccqoq,RISCV_ISA_VENDOR_EXT_XSFVQMACCQOQ ), };
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 11/12 riscv: hwprobe: Document SiFive xsfvfwmaccqqq vendor extension
In reply to Cyan YangDocument the support for matrix multiply accumulate instruction from SiFive using RISCV_HWPROBE_VENDOR_EXT_XSFVFWMACCQQQ.
--- Documentation/arch/riscv/hwprobe.rst | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/arch/riscv/hwprobe.rst +4 -0
@@ -353,3 +353,7 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_VENDOR_EXT_XSFVFNRCLIPXFQF`: The Xsfvfnrclipxfqf vendor extension is supported in version 1.0 of SiFive FP32-to-int8 Ranged Clip Instructions Extensions Specification. + + * :c:macro:`RISCV_HWPROBE_VENDOR_EXT_XSFVFWMACCQQQ`: The Xsfvfwmaccqqq + vendor extension is supported in version 1.0 of Matrix Multiply Accumulate + Instruction Extensions Specification.
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 12/12 riscv: hwprobe: Add SiFive xsfvfwmaccqqq vendor extension
In reply to Cyan YangAdd hwprobe for SiFive "xsfvfwmaccqqq" vendor extension.
--- arch/riscv/include/uapi/asm/vendor/sifive.h | 1 + arch/riscv/kernel/vendor_extensions/sifive_hwprobe.c | 1 + 2 files changed, 2 insertions(+)
arch/riscv/include/uapi/asm/vendor/sifive.h +1 -0
@@ -3,3 +3,4 @@#define RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCDOD (1 << 0)#define RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCQOQ (1 << 1)#define RISCV_HWPROBE_VENDOR_EXT_XSFVFNRCLIPXFQF (1 << 2) +#define RISCV_HWPROBE_VENDOR_EXT_XSFVFWMACCQQQ (1 << 3)
arch/riscv/kernel/vendor_extensions/sifive_hwprobe.c +1 -0
@@ -17,5 +17,6 @@ void hwprobe_isa_vendor_ext_sifive_0(struct riscv_hwprobe *pair, const struct cpVENDOR_EXT_KEY (XSFVQMACCDOD );VENDOR_EXT_KEY (XSFVQMACCQOQ );VENDOR_EXT_KEY (XSFVFNRCLIPXFQF ); +VENDOR_EXT_KEY (XSFVFWMACCQQQ ); }); }
Signature · 1 line
2.39.5 (Apple Git-154)
This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:
Hello:
This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:
Quoted 8 lines · On Fri, 18 Apr 2025 13:32:27 +0800 you wrote:
This patch set adds four vendor-specific ISA extensions from SiFive:
"xsfvqmaccdod", "xsfvqmaccqoq", "xsfvfnrclipxfqf", and "xsfvfwmaccqqq".Additionally, a new hwprobe key,
RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0, has been added to query which SiFive vendor extensions are supported on the current platform.[...]
Here is the summary with links:
- [01/12] dt-bindings: riscv: Add xsfvqmaccdod and xsfvqmaccqoq ISA extension description
https://git.kernel.org/riscv/c/0f733b5be965 - [02/12] riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions https://git.kernel.org/riscv/c/2d147d77ae6e - [03/12] riscv: hwprobe: Document SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions https://git.kernel.org/riscv/c/e8fd215ed0eb - [04/12] riscv: hwprobe: Add SiFive vendor extension support and probe for xsfqmaccdod and xsfqmaccqoq https://git.kernel.org/riscv/c/1a6274f03534 - [05/12] dt-bindings: riscv: Add xsfvfnrclipxfqf ISA extension description https://git.kernel.org/riscv/c/a5a15e07cbb9 - [06/12] riscv: Add SiFive xsfvfnrclipxfqf vendor extension https://git.kernel.org/riscv/c/e84fffe21b74 - [07/12] riscv: hwprobe: Document SiFive xsfvfnrclipxfqf vendor extension https://git.kernel.org/riscv/c/659d664f7df8 - [08/12] riscv: hwprobe: Add SiFive xsfvfnrclipxfqf vendor extension https://git.kernel.org/riscv/c/1d91224394c9 - [09/12] dt-bindings: riscv: Add xsfvfwmaccqqq ISA extension description https://git.kernel.org/riscv/c/d5ca02b25f5d - [10/12] riscv: Add SiFive xsfvfwmaccqqq vendor extension https://git.kernel.org/riscv/c/34e9b16b4b88 - [11/12] riscv: hwprobe: Document SiFive xsfvfwmaccqqq vendor extension https://git.kernel.org/riscv/c/a3ca43dc5271 - [12/12] riscv: hwprobe: Add SiFive xsfvfwmaccqqq vendor extension https://git.kernel.org/riscv/c/d9669e33c8fa
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html