public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: "Christoph Müllner" <christoph.muellner@vrull.eu>
Cc: Jerry Shih <jerry.shih@sifive.com>,
	linux-crypto@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] crypto: riscv - use real assembler for vector crypto extensions
Date: Wed, 20 Dec 2023 09:31:55 -0600	[thread overview]
Message-ID: <20231220153155.GA817@quark.localdomain> (raw)
In-Reply-To: <CAEg0e7hh-qY9eF1nW5U32j7XYV2RLEdqRP1LzRi+eZHKtKR-aQ@mail.gmail.com>

On Wed, Dec 20, 2023 at 08:52:45AM +0100, Christoph Müllner wrote:
> On Wed, Dec 20, 2023 at 7:57 AM Eric Biggers <ebiggers@kernel.org> wrote:
> >
> > From: Eric Biggers <ebiggers@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@google.com>
> 
> For OpenSSL, these hand-written assembler functions were mainly written
> to make OpenSSL's CI builds happy, which run on the latest Ubuntu LTS.
> 
> I'm happy to see these functions disappear, but I wonder if there is a
> guideline or best-practice for assembly optimizations like this.
>
> The upcoming Binutils release (presumably available in Jan 24) will
> (presumably) be available in Ubuntu 24.10.
> And until then most users won't be even building the code.
>
> 
> 
> Reviewed-by: Christoph Müllner <christoph.muellner@vrull.eu>

As far as I can tell, kernel code usually just relies on assembler support for
new instructions.  See e.g. CONFIG_AS_AVX512 for x86's AVX-512.  You can't build
the AVX-512 optimized crypto code unless your assembler supports AVX-512.
Beyond that observation, I don't think there's a specific guideline.

The kernel doesn't have CI on Ubuntu, at least not officially for upstream.
Either way, it's possible to install newer LLVM and binutils on old Linux
distros anyway.  Also, the RISC-V crypto code won't make it into v6.8 since it
depends on a separate patch that adds support for kernel mode vector.  It will
be merged into v6.9 at the earliest.

So my vote is to just rely on the LLVM and binutils support.

- Eric

  reply	other threads:[~2023-12-20 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  6:56 [PATCH] crypto: riscv - use real assembler for vector crypto extensions Eric Biggers
2023-12-20  7:48 ` Ard Biesheuvel
2023-12-20  7:52 ` Christoph Müllner
2023-12-20 15:31   ` Eric Biggers [this message]
2023-12-22  2:05 ` Jerry Shih
2023-12-22  2:15 ` Jerry Shih
2023-12-22  4:52   ` Eric Biggers

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=20231220153155.GA817@quark.localdomain \
    --to=ebiggers@kernel.org \
    --cc=christoph.muellner@vrull.eu \
    --cc=jerry.shih@sifive.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    /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