From: Samuel Ortiz <sameo@rivosinc.com>
To: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-riscv@lists.infradead.org
Cc: "Samuel Ortiz" <sameo@rivosinc.com>,
linux@rivosinc.com, "Conor Dooley" <conor.dooley@microchip.com>,
"Andrew Jones" <ajones@ventanamicro.com>,
"Heiko Stuebner" <heiko.stuebner@vrull.eu>,
"Anup Patel" <apatel@ventanamicro.com>,
linux-kernel@vger.kernel.org,
"Hongren (Zenithal) Zheng" <i@zenithal.me>,
"Guo Ren" <guoren@kernel.org>,
"Atish Patra" <atishp@rivosinc.com>,
"Björn Töpel" <bjorn@rivosinc.com>,
"Evan Green" <evan@rivosinc.com>
Subject: [PATCH v2 0/3] RISC-V: archrandom support
Date: Wed, 28 Jun 2023 15:14:32 +0200 [thread overview]
Message-ID: <20230628131442.3022772-1-sameo@rivosinc.com> (raw)
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.
---
v2:
- Fixed the ISA map setting for zkbx
- Alphanumerically sort the ISA map setting
- Added my SOB on Hongren's patch
- Fixed patch #1 commit message
- Remove printk prefix from the archrandom implementation
- Fix needed_seeds computation (and make it const)
- Replace riscv_isa_extension_available() with
riscv_has_extension_likely()
- Make the get_random_seed_longs implementation more readable
---
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 | 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 ++++++++------
8 files changed, 197 insertions(+), 14 deletions(-)
create mode 100644 arch/riscv/include/asm/archrandom.h
base-commit: 488833ccdcac118da16701f4ee0673b20ba47fe3
--
2.41.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2023-06-28 13:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 13:14 Samuel Ortiz [this message]
2023-06-28 13:14 ` [PATCH v2 1/3] RISC-V: add Bitmanip/Scalar Crypto parsing from DT Samuel Ortiz
2023-06-28 17:22 ` Evan Green
2023-07-06 13:40 ` Conor Dooley
2023-07-09 11:30 ` Heiko Stuebner
2023-06-28 13:14 ` [PATCH v2 2/3] RISC-V: hwprobe: Expose Zbc and the scalar crypto extensions Samuel Ortiz
2023-07-06 13:32 ` Conor Dooley
2023-07-09 11:31 ` Heiko Stuebner
2023-06-28 13:14 ` [PATCH v2 3/3] RISC-V: Implement archrandom when Zkr is available Samuel Ortiz
2023-07-06 13:33 ` Conor Dooley
2023-07-13 0:21 ` Guo Ren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230628131442.3022772-1-sameo@rivosinc.com \
--to=sameo@rivosinc.com \
--cc=ajones@ventanamicro.com \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=atishp@rivosinc.com \
--cc=bjorn@rivosinc.com \
--cc=conor.dooley@microchip.com \
--cc=evan@rivosinc.com \
--cc=guoren@kernel.org \
--cc=heiko.stuebner@vrull.eu \
--cc=i@zenithal.me \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@rivosinc.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).