[PATCH] crypto: riscv - use real assembler for vector crypto extensions

Eric Biggers ebiggers at kernel.org
Thu Dec 21 20:52:27 PST 2023


On Fri, Dec 22, 2023 at 10:15:04AM +0800, Jerry Shih wrote:
> On Dec 20, 2023, at 14:56, Eric Biggers <ebiggers at kernel.org> wrote:
> > From: Eric Biggers <ebiggers at google.com>
> > 
> > LLVM main and binutils master now both fully support v1.0 of the RISC-V
> > vector crypto extensions.  Therefore, delete riscv.pm and use the real
> > assembler mnemonics for the vector crypto instructions.
> > 
> > Signed-off-by: Eric Biggers <ebiggers at google.com>
> > ---
> > 
> > Hi Jerry, this patch applies to your v3 patchset
> > (https://lore.kernel.org/linux-crypto/20231205092801.1335-1-jerry.shih@sifive.com).
> > Can you consider folding it into your patchset?  Thanks!
> 
> Thank you for the vector crypto asm mnemonics works.
> Do you mean that fold this patch or append this one as the separated
> commit into my next v4 patchset?

Just fold the changes into your individual patches, please.  Thanks!

> > 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 option 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_ZVK
> > +	def_bool $(as-instr, .option arch$(comma) +zvkb)
> > +
> 
> Could we rename to other terms like
> `TOOLCHAIN_HAS_VECTOR_CRYPTO/TOOLCHAIN_HAS_V_CRYPTO `?
> Some ciphers don't use `ZVK*` extensions.

Yes, TOOLCHAIN_HAS_VECTOR_CRYPTO sounds good.

- Eric



More information about the linux-riscv mailing list