|
|
Subscribe / Log in / New account

RISC-V: archrandom support

From:  Samuel Ortiz <sameo-AT-rivosinc.com>
To:  Paul Walmsley <paul.walmsley-AT-sifive.com>, Palmer Dabbelt <palmer-AT-dabbelt.com>, Albert Ou <aou-AT-eecs.berkeley.edu>, linux-riscv-AT-lists.infradead.org
Subject:  [PATCH 0/3] RISC-V: archrandom support
Date:  Tue, 27 Jun 2023 16:37:41 +0200
Message-ID:  <20230627143747.1599218-1-sameo@rivosinc.com>
Cc:  Samuel Ortiz <sameo-AT-rivosinc.com>, linux-AT-rivosinc.com, Conor Dooley <conor.dooley-AT-microchip.com>, Andrew Jones <ajones-AT-ventanamicro.com>, Heiko Stuebner <heiko.stuebner-AT-vrull.eu>, Anup Patel <apatel-AT-ventanamicro.com>, linux-kernel-AT-vger.kernel.org, "Hongren (Zenithal) Zheng" <i-AT-zenithal.me>, Guo Ren <guoren-AT-kernel.org>, Atish Patra <atishp-AT-rivosinc.com>, Björn Töpel <bjorn-AT-rivosinc.com>, Evan Green <evan-AT-rivosinc.com>
Archive-link:  Article

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 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.

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

Samuel Ortiz (2):
  RISC-V: hwprobe: Expose Zbc and the scalar crypto extensions
  RISC-V: Implement archrandom when Zkr is available

 Documentation/riscv/hwprobe.rst       | 33 ++++++++++++++
 arch/riscv/include/asm/archrandom.h   | 66 +++++++++++++++++++++++++++
 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 +++++++++------
 8 files changed, 193 insertions(+), 14 deletions(-)
 create mode 100644 arch/riscv/include/asm/archrandom.h


base-commit: 488833ccdcac118da16701f4ee0673b20ba47fe3
-- 
2.41.0



Copyright © 2023, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds