Skip to content

riscv: report more ISA extensions through hwprobe

Clément Léger linux-devicetree linux-doc linux-riscv lkml 4 versions – Applied

Status from this message: This series was applied to riscv/linux.git (for-next)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest20 patches 2 repliesApplied 20/20
  2. v320 patches 11 repliesSuperseded
  3. v219 patches 37 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v113 patches15 repliesSuperseded

Changes in v4 from the cover letter

- Rebase on master
- Do not represent zvknhb as a superset anymore
- Remove mention to hwprobe in dt-bindings documents
- Add a text specifying that Zkr string dt binding means that the CSR provided by Zkr are accessible only by the privilege level to which
the device-tree has been provided.
- Use a pointer for extension instead of struct copy in patch 1
- Add missing RISCV_ISA_EXT_ZBC define
- Remove ISA check macro since another similar commit was merged

Patches in v4 All 20 applied

#Subject and filesSizeRepliesApplied
1/20riscv: add ISA extension parsing for Zbcarch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpufeature.c+2 -00 repliesApplied
2/20riscv: hwprobe: export missing Zbc ISA extensionDocumentation/arch/riscv/hwprobe.rst arch/riscv/include/uapi/asm/hwprobe.h arch/riscv/kernel/sys_riscv.c+5 -00 repliesApplied
3/20riscv: add ISA extension parsing for scalar cryptoarch/riscv/include/asm/cpufeature.h arch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpufeature.c+109 -240 repliesApplied
4/20riscv: hwprobe: add support for scalar crypto ISA extensionsDocumentation/arch/riscv/hwprobe.rst arch/riscv/include/uapi/asm/hwprobe.h arch/riscv/kernel/sys_riscv.c+46 -00 repliesApplied
5/20dt-bindings: riscv: add scalar crypto ISA extensions descriptionDocumentation/devicetree/bindings/riscv/extensions.yaml+80 -01 replyApplied
6/20riscv: add ISA extension parsing for vector cryptoarch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpufeature.c+75 -10 repliesApplied
7/20riscv: hwprobe: export vector crypto ISA extensionsDocumentation/arch/riscv/hwprobe.rst arch/riscv/include/uapi/asm/hwprobe.h arch/riscv/kernel/sys_riscv.c+53 -00 repliesApplied
8/20dt-bindings: riscv: add vector crypto ISA extensions descriptionDocumentation/devicetree/bindings/riscv/extensions.yaml+96 -00 repliesApplied
9/20riscv: add ISA extension parsing for Zfh/Zfh[min]arch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpufeature.c+4 -00 repliesApplied
10/20riscv: hwprobe: export Zfh[min] ISA extensionsDocumentation/arch/riscv/hwprobe.rst arch/riscv/include/uapi/asm/hwprobe.h arch/riscv/kernel/sys_riscv.c+13 -00 repliesApplied
11/20dt-bindings: riscv: add Zfh[min] ISA extensions descriptionDocumentation/devicetree/bindings/riscv/extensions.yaml+13 -00 repliesApplied
12/20riscv: add ISA extension parsing for Zihintntlarch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpufeature.c+2 -00 repliesApplied
13/20riscv: hwprobe: export Zhintntl ISA extensionDocumentation/arch/riscv/hwprobe.rst arch/riscv/include/uapi/asm/hwprobe.h arch/riscv/kernel/sys_riscv.c+5 -00 repliesApplied
14/20dt-bindings: riscv: add Zihintntl ISA extension descriptionDocumentation/devicetree/bindings/riscv/extensions.yaml+6 -00 repliesApplied
15/20riscv: add ISA extension parsing for Zvfh[min]arch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpufeature.c+4 -00 repliesApplied
16/20riscv: hwprobe: export Zvfh[min] ISA extensionsDocumentation/arch/riscv/hwprobe.rst arch/riscv/include/uapi/asm/hwprobe.h arch/riscv/kernel/sys_riscv.c+12 -00 repliesApplied
17/20dt-bindings: riscv: add Zvfh[min] ISA extension descriptionDocumentation/devicetree/bindings/riscv/extensions.yaml+12 -00 repliesApplied
18/20riscv: add ISA extension parsing for Zfaarch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpufeature.c+2 -00 repliesApplied
19/20riscv: hwprobe: export Zfa ISA extensionDocumentation/arch/riscv/hwprobe.rst arch/riscv/include/uapi/asm/hwprobe.h arch/riscv/kernel/sys_riscv.c+6 -00 repliesApplied
20/20dt-bindings: riscv: add Zfa ISA extension descriptionDocumentation/devicetree/bindings/riscv/extensions.yaml+6 -00 repliesApplied

Reviews trailers per patch

16 of 20 patches have a Reviewed-by or Acked-by.

PatchConor DooleyEvan Green
1/20
2/20
3/20A-b
4/20
5/20R-b
6/20
7/20R-b
8/20A-b
9/20R-b
10/20R-b
11/20A-b
12/20R-b
13/20R-b
14/20A-b
15/20R-b
16/20R-b
17/20A-b
18/20R-b
19/20R-b
20/20A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/20] riscv: report more ISA extensions through hwprobe

In order to be able to gather more information about the supported ISA extensions from userspace using the hwprobe syscall, add more ISA extensions report. This series adds the following ISA extensions parsing support:

- Zfh[min]
- Zvfh[min]
- Zihintntl
- Zbc
- Zvbb
- Zvbc
- Zvkb
- Zvkg
- Zvkned
- Zvknh[ab]
- Zvksed
- Zvksh
- Zvkn
- Zvknc
- Zvkng
- Zvks
- Zvksc
- Zvksg
- Zvkt
- Zfa
- Zbkb
- Zbkc
- Zbkx
- Zknd
- Zkne
- Zknh
- Zkr
- Zksed
- Zksh
- Zkt

Some of these extensions are actually shorthands for other "sub" extensions. This series includes a patch from Conor/Evan that adds a way to specify such "bundled" extensions. When exposing these bundled extensions to userspace through hwprobe, only the "sub" extensions are exposed.

In order to test it, one can use qemu and the small hwprobe utility provided[1]. Run qemu by specifying additional ISA extensions, for instance:

$ qemu-system-riscv64 -cpu rv64,v=true,zk=true,zvksh=true,zvkned=true
  <whatever options you want>

Then, run hwprobe:

$ ./hwprobe
Base system ISA:
 - IMA_FD
 - C
 - V
Supported extensions:
 - Zba
 - Zbb
 - Zbs
 - Zbc
 - Zbkb
 - Zbkc
 - Zbkx
 - Zknd
 - Zkne
 - Zknh
 - Zkt
 - Zvkned
 - Zvksh
 - Zihintntl
 - Zfa

---
Changes in V4:
- Rebase on master
- Do not represent zvknhb as a superset anymore
- Remove mention to hwprobe in dt-bindings documents
- Add a text specifying that Zkr string dt binding means that the CSR provided by Zkr are accessible only by the privilege level to which
the device-tree has been provided.
- Use a pointer for extension instead of struct copy in patch 1
- Add missing RISCV_ISA_EXT_ZBC define
- Remove ISA check macro since another similar commit was merged

Changes in V3:
- Rebased on top of origin/master
- Rename bundle_ext to subset_ext since it is used for superset extensions (Zvbb for instance).
- Add an invalid id for pure lasso extension
- Fix wrong type for check_isa ext, int -> unsigned int
- Use bundled extension for ZVBB/ZVNHB
- Split ZBC hwprobe support from scalar crypto patch
- Fix typos (Evan)
- Added a few Rb: from Evan
- Change Zfh/Zfhmin to Zfh[min] to be more coherent with other commits
- Reword comment about CHECK_ISA_EXT to be more clear

Changes in V2:
- Fix typo in first commit title (fatorize->factorize)
- Add Zfa support
- Fix missing uppercase for Zvkt naming in dt-bindings
- Add Conor Acked-by on dt-bindings commits
- Add scalar crypto support from Conor/Evan.
- Use reporting of bunbled extensions for vector crypto

Clément Léger (19):
riscv: add ISA extension parsing for Zbc
riscv: hwprobe: export missing Zbc ISA extension
riscv: hwprobe: add support for scalar crypto ISA extensions
dt-bindings: riscv: add scalar crypto ISA extensions description
riscv: add ISA extension parsing for vector crypto
riscv: hwprobe: export vector crypto ISA extensions
dt-bindings: riscv: add vector crypto ISA extensions description
riscv: add ISA extension parsing for Zfh/Zfh[min]
riscv: hwprobe: export Zfh[min] ISA extensions
dt-bindings: riscv: add Zfh[min] ISA extensions description
riscv: add ISA extension parsing for Zihintntl
riscv: hwprobe: export Zhintntl ISA extension
dt-bindings: riscv: add Zihintntl ISA extension description
riscv: add ISA extension parsing for Zvfh[min]
riscv: hwprobe: export Zvfh[min] ISA extensions
dt-bindings: riscv: add Zvfh[min] ISA extension description
riscv: add ISA extension parsing for Zfa
riscv: hwprobe: export Zfa ISA extension
dt-bindings: riscv: add Zfa ISA extension description

Evan Green (1):
riscv: add ISA extension parsing for scalar crypto

 Documentation/arch/riscv/hwprobe.rst          |  81 +++++++
 .../devicetree/bindings/riscv/extensions.yaml | 213 ++++++++++++++++++
 arch/riscv/include/asm/cpufeature.h           |   4 +-
 arch/riscv/include/asm/hwcap.h                |  30 ++-
 arch/riscv/include/uapi/asm/hwprobe.h         |  26 +++
 arch/riscv/kernel/cpufeature.c                | 189 ++++++++++++++--
 arch/riscv/kernel/sys_riscv.c                 |  33 +++
 7 files changed, 551 insertions(+), 25 deletions(-)
Signature · 1 line
2.42.0