Skip to content

RISC-V: archrandom support

Samuel Ortiz linux-devicetree linux-riscv lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 10 repliesIn review
  2. v34 patches 11 repliesSuperseded
  3. v23 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches24 repliesSuperseded

Changes in v4 from the cover letter

- Documented the USEED and SSEED requirements when Zkr is enabled

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4RISC-V: Add Bitmanip/Scalar Crypto parsing from DTarch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpu.c arch/riscv/kernel/cpufeature.c+52 -010 replies
2/4dt-bindings: riscv: Document the 1.0 scalar cryptography extensionsDocumentation/devicetree/bindings/riscv/extensions.yaml+87 -00 replies
3/4RISC-V: hwprobe: Expose Zbc and the scalar crypto extensionsDocumentation/riscv/hwprobe.rst arch/riscv/include/uapi/asm/hwprobe.h arch/riscv/kernel/sys_riscv.c+68 -140 replies
4/4RISC-V: Implement archrandom when Zkr is availablearch/riscv/include/asm/archrandom.h arch/riscv/include/asm/csr.h+79 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJiatai HeHeiko StuebnerEvan GreenConor Dooley
1/4T-b T-b R-b R-b R-b
2/4R-b R-b
3/4R-b T-b R-b R-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/4] RISC-V: archrandom support

This patchset adds support for the archrandom API to the RISC-V architecture.

The ratified crypto scalar extensions provide entropy bits via the seed CSR, as exposed by the Zkr extension.

The first patch of this patchset allows for detecting support of the Zbc and all scalar crypto extensions. The second patch documents the corresponding dt-bindings.

The third patch exposes the Zbc and scalar crypto extensions through the hwprobe syscall.

The last patch relies on the first ones to check for the Zkr support, and implements get_random_seed_longs by looping through a seed CSR read-write to return one long worth of entropy.

---
v4:

- Documented the USEED and SSEED requirements when Zkr is enabled

v3:

- Increased the CSR SEED retry loop max iterations to 100
- Documented the added extensions in the related dt-bindings file

v2:

- Fixed the ISA map setting for zkbx
- Alphanumerically sorted the ISA map setting
- Added my SOB on Hongren's patch
- Fixed patch #1 commit message
- Removed printk prefix from the archrandom implementation
- Fixed needed_seeds computation (and make it const)
- Replaced riscv_isa_extension_available() with riscv_has_extension_likely()
- Made the get_random_seed_longs implementation more readable

---

Hongren (Zenithal) Zheng (1):
RISC-V: Add Bitmanip/Scalar Crypto parsing from DT

Samuel Ortiz (3):
dt-bindings: riscv: Document the 1.0 scalar cryptography extensions
RISC-V: hwprobe: Expose Zbc and the scalar crypto extensions
RISC-V: Implement archrandom when Zkr is available

 .../devicetree/bindings/riscv/extensions.yaml | 87 +++++++++++++++++++
 Documentation/riscv/hwprobe.rst               | 35 ++++++++
 arch/riscv/include/asm/archrandom.h           | 70 +++++++++++++++
 arch/riscv/include/asm/csr.h                  |  9 ++
 arch/riscv/include/asm/hwcap.h                | 11 +++
 arch/riscv/include/uapi/asm/hwprobe.h         | 11 +++
 arch/riscv/kernel/cpu.c                       | 11 +++
 arch/riscv/kernel/cpufeature.c                | 30 +++++++
 arch/riscv/kernel/sys_riscv.c                 | 36 +++++---
 9 files changed, 286 insertions(+), 14 deletions(-)
 create mode 100644 arch/riscv/include/asm/archrandom.h

base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5

Signature · 1 line
2.41.0