From: Eric Biggers <ebiggers@kernel.org> To: linux-crypto@vger.kernel.org, linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, "Albert Ou" <aou@eecs.berkeley.edu>, "Andy Chiu" <andy.chiu@sifive.com>, "Ard Biesheuvel" <ardb@kernel.org>, "Christoph Müllner" <christoph.muellner@vrull.eu>, "Heiko Stuebner" <heiko@sntech.de>, "Jerry Shih" <jerry.shih@sifive.com>, "Palmer Dabbelt" <palmer@dabbelt.com>, "Paul Walmsley" <paul.walmsley@sifive.com>, "Phoebe Chen" <phoebe.chen@sifive.com>, hongrong.hsu@sifive.com Subject: [PATCH v3 02/10] RISC-V: add TOOLCHAIN_HAS_VECTOR_CRYPTO Date: Sun, 21 Jan 2024 16:19:13 -0800 [thread overview] Message-ID: <20240122002024.27477-3-ebiggers@kernel.org> (raw) In-Reply-To: <20240122002024.27477-1-ebiggers@kernel.org> From: Eric Biggers <ebiggers@google.com> Add a kconfig symbol that indicates whether the toolchain supports the vector crypto extensions. This is needed by the RISC-V crypto code. Signed-off-by: Eric Biggers <ebiggers@google.com> --- arch/riscv/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index bffbd869a0682..5613b2bb686ec 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -571,20 +571,27 @@ config RISCV_ISA_V_PREEMPTIVE consumption due to the allocation of per-task's kernel Vector context. config TOOLCHAIN_HAS_ZBB bool default y depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb) depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb) depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900 depends on AS_HAS_OPTION_ARCH +# This symbol indicates that the toolchain supports all v1.0 vector crypto +# extensions, including Zvk*, Zvbb, and Zvbc. LLVM added all of these at once. +# binutils added all except Zvkb, then added Zvkb. So we just check for Zvkb. +config TOOLCHAIN_HAS_VECTOR_CRYPTO + def_bool $(as-instr, .option arch$(comma) +zvkb) + depends on AS_HAS_OPTION_ARCH + config RISCV_ISA_ZBB bool "Zbb extension support for bit manipulation instructions" depends on TOOLCHAIN_HAS_ZBB depends on MMU depends on RISCV_ALTERNATIVE default y help Adds support to dynamically detect the presence of the ZBB extension (basic bit manipulation) and enable its usage. -- 2.43.0
WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org> To: linux-crypto@vger.kernel.org, linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, "Albert Ou" <aou@eecs.berkeley.edu>, "Andy Chiu" <andy.chiu@sifive.com>, "Ard Biesheuvel" <ardb@kernel.org>, "Christoph Müllner" <christoph.muellner@vrull.eu>, "Heiko Stuebner" <heiko@sntech.de>, "Jerry Shih" <jerry.shih@sifive.com>, "Palmer Dabbelt" <palmer@dabbelt.com>, "Paul Walmsley" <paul.walmsley@sifive.com>, "Phoebe Chen" <phoebe.chen@sifive.com>, hongrong.hsu@sifive.com Subject: [PATCH v3 02/10] RISC-V: add TOOLCHAIN_HAS_VECTOR_CRYPTO Date: Sun, 21 Jan 2024 16:19:13 -0800 [thread overview] Message-ID: <20240122002024.27477-3-ebiggers@kernel.org> (raw) In-Reply-To: <20240122002024.27477-1-ebiggers@kernel.org> From: Eric Biggers <ebiggers@google.com> Add a kconfig symbol that indicates whether the toolchain supports the vector crypto extensions. This is needed by the RISC-V crypto code. Signed-off-by: Eric Biggers <ebiggers@google.com> --- arch/riscv/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index bffbd869a0682..5613b2bb686ec 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -571,20 +571,27 @@ config RISCV_ISA_V_PREEMPTIVE consumption due to the allocation of per-task's kernel Vector context. config TOOLCHAIN_HAS_ZBB bool default y depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb) depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb) depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900 depends on AS_HAS_OPTION_ARCH +# This symbol indicates that the toolchain supports all v1.0 vector crypto +# extensions, including Zvk*, Zvbb, and Zvbc. LLVM added all of these at once. +# binutils added all except Zvkb, then added Zvkb. So we just check for Zvkb. +config TOOLCHAIN_HAS_VECTOR_CRYPTO + def_bool $(as-instr, .option arch$(comma) +zvkb) + depends on AS_HAS_OPTION_ARCH + config RISCV_ISA_ZBB bool "Zbb extension support for bit manipulation instructions" depends on TOOLCHAIN_HAS_ZBB depends on MMU depends on RISCV_ALTERNATIVE default y help Adds support to dynamically detect the presence of the ZBB extension (basic bit manipulation) and enable its usage. -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2024-01-22 0:22 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-01-22 0:19 [PATCH v3 00/10] RISC-V crypto with reworked asm files Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-22 0:19 ` [PATCH v3 01/10] RISC-V: add helper function to read the vector VLEN Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-22 0:19 ` Eric Biggers [this message] 2024-01-22 0:19 ` [PATCH v3 02/10] RISC-V: add TOOLCHAIN_HAS_VECTOR_CRYPTO Eric Biggers 2024-01-22 0:19 ` [PATCH v3 03/10] RISC-V: hook new crypto subdir into build-system Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-22 0:19 ` [PATCH v3 04/10] crypto: riscv - add vector crypto accelerated AES-{ECB,CBC,CTR,XTS} Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-22 0:19 ` [PATCH v3 05/10] crypto: riscv - add vector crypto accelerated ChaCha20 Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-04-12 7:59 ` Yangyu Chen 2024-04-12 7:59 ` Yangyu Chen 2024-04-12 8:07 ` Jerry Shih 2024-04-12 8:07 ` Jerry Shih 2024-01-22 0:19 ` [PATCH v3 06/10] crypto: riscv - add vector crypto accelerated GHASH Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-22 0:19 ` [PATCH v3 07/10] crypto: riscv - add vector crypto accelerated SHA-{256,224} Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-22 0:19 ` [PATCH v3 08/10] crypto: riscv - add vector crypto accelerated SHA-{512,384} Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-22 0:19 ` [PATCH v3 09/10] crypto: riscv - add vector crypto accelerated SM3 Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-22 0:19 ` [PATCH v3 10/10] crypto: riscv - add vector crypto accelerated SM4 Eric Biggers 2024-01-22 0:19 ` Eric Biggers 2024-01-23 1:58 ` [PATCH v3 00/10] RISC-V crypto with reworked asm files Palmer Dabbelt 2024-01-23 1:58 ` Palmer Dabbelt 2024-01-23 15:06 ` Christoph Müllner 2024-01-23 15:06 ` Christoph Müllner 2024-01-23 17:50 ` patchwork-bot+linux-riscv 2024-01-23 17:50 ` patchwork-bot+linux-riscv
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=20240122002024.27477-3-ebiggers@kernel.org \ --to=ebiggers@kernel.org \ --cc=andy.chiu@sifive.com \ --cc=aou@eecs.berkeley.edu \ --cc=ardb@kernel.org \ --cc=christoph.muellner@vrull.eu \ --cc=heiko@sntech.de \ --cc=hongrong.hsu@sifive.com \ --cc=jerry.shih@sifive.com \ --cc=linux-crypto@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-riscv@lists.infradead.org \ --cc=palmer@dabbelt.com \ --cc=paul.walmsley@sifive.com \ --cc=phoebe.chen@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.