From: Heiko Stuebner <heiko@sntech.de>
To: palmer@rivosinc.com
Cc: greentime.hu@sifive.com, conor@kernel.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
christoph.muellner@vrull.eu, heiko@sntech.de,
Heiko Stuebner <heiko.stuebner@vrull.eu>
Subject: [PATCH RFC v2 04/16] RISC-V: add Zbkb extension detection
Date: Tue, 28 Feb 2023 01:05:32 +0100 [thread overview]
Message-ID: <20230228000544.2234136-5-heiko@sntech.de> (raw)
In-Reply-To: <20230228000544.2234136-1-heiko@sntech.de>
From: Heiko Stuebner <heiko.stuebner@vrull.eu>
Add detection for Zbkb extension.
Zbkb is part of the set of scalar cryptography extensions and provides
bitmanip instructions for cryptography, with them being a "subset of the
Zbb extension particularly useful for cryptography".
Zbkb was ratified in january 2022.
Expect code using the extension to pre-encode zbkb instructions, so
don't introduce special toolchain requirements for now.
Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
---
arch/riscv/include/asm/hwcap.h | 1 +
arch/riscv/kernel/cpu.c | 1 +
arch/riscv/kernel/cpufeature.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
index 8673c2146d20..23427b9ed1e6 100644
--- a/arch/riscv/include/asm/hwcap.h
+++ b/arch/riscv/include/asm/hwcap.h
@@ -61,6 +61,7 @@ enum riscv_isa_ext_id {
RISCV_ISA_EXT_SVPBMT,
RISCV_ISA_EXT_ZBB,
RISCV_ISA_EXT_ZBC,
+ RISCV_ISA_EXT_ZBKB,
RISCV_ISA_EXT_ZICBOM,
RISCV_ISA_EXT_ZIHINTPAUSE,
RISCV_ISA_EXT_ID_MAX
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c
index 5d47a0c75c69..6f65aac68018 100644
--- a/arch/riscv/kernel/cpu.c
+++ b/arch/riscv/kernel/cpu.c
@@ -189,6 +189,7 @@ static struct riscv_isa_ext_data isa_ext_arr[] = {
__RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE),
__RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB),
__RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC),
+ __RISCV_ISA_EXT_DATA(zbkb, RISCV_ISA_EXT_ZBKB),
__RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF),
__RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC),
__RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL),
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index 696b39de7e09..8f5434993128 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -235,6 +235,7 @@ void __init riscv_fill_hwcap(void)
SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT);
SET_ISA_EXT_MAP("zbb", RISCV_ISA_EXT_ZBB);
SET_ISA_EXT_MAP("zbc", RISCV_ISA_EXT_ZBC);
+ SET_ISA_EXT_MAP("zbkb", RISCV_ISA_EXT_ZBKB);
SET_ISA_EXT_MAP("zicbom", RISCV_ISA_EXT_ZICBOM);
SET_ISA_EXT_MAP("zihintpause", RISCV_ISA_EXT_ZIHINTPAUSE);
}
--
2.39.0
next prev parent reply other threads:[~2023-02-28 0:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-28 0:05 [PATCH RFC v2 00/16] RISC-V: support some cryptography accelerations Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 01/16] riscv: Add support for kernel mode vector Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 02/16] riscv: Add vector extension XOR implementation Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 03/16] RISC-V: add Zbc extension detection Heiko Stuebner
2023-02-28 0:05 ` Heiko Stuebner [this message]
2023-02-28 0:05 ` [PATCH RFC v2 05/16] RISC-V: hook new crypto subdir into build-system Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 06/16] RISC-V: crypto: add accelerated GCM GHASH implementation Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 07/16] RISC-V: add helper function to read the vector VLEN Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 08/16] RISC-V: add vector crypto extension detection Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 09/16] RISC-V: crypto: update perl include with helpers for vector (crypto) instructions Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 10/16] RISC-V: crypto: add Zvkb accelerated GCM GHASH implementation Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 11/16] RISC-V: crypto: add Zvkg " Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 12/16] RISC-V: crypto: add a vector-crypto-accelerated SHA256 implementation Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 13/16] RISC-V: crypto: add a vector-crypto-accelerated SHA512 implementation Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 14/16] RISC-V: crypto: add Zvkned accelerated AES encryption implementation Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 15/16] RISC-V: crypto: add Zvksed accelerated SM4 " Heiko Stuebner
2023-02-28 0:05 ` [PATCH RFC v2 16/16] RISC-V: crypto: add Zvksh accelerated SM3 hash implementation Heiko Stuebner
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=20230228000544.2234136-5-heiko@sntech.de \
--to=heiko@sntech.de \
--cc=christoph.muellner@vrull.eu \
--cc=conor@kernel.org \
--cc=greentime.hu@sifive.com \
--cc=heiko.stuebner@vrull.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@rivosinc.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
all inboxes | Powered by JetHome®