From: Greg KH <greg@kroah.com>
To: Ard Biesheuvel <ardb@google.com>
Cc: stable@vger.kernel.org, linux-crypto@vger.kernel.org, tmb@tmb.nu,
sashal@kernel.org, Ard Biesheuvel <ardb@kernel.org>,
Eric Biggers <ebiggers@google.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH for-stable-5.4] crypto: x86/aes-ni-xts - use direct calls to and 4-way stride
Date: Fri, 19 Mar 2021 11:32:47 +0100 [thread overview]
Message-ID: <YFR9z5xqrsq0gZAS@kroah.com> (raw)
In-Reply-To: <20210318174151.2164335-1-ardb@google.com>
On Thu, Mar 18, 2021 at 05:41:51PM +0000, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
>
> Upstream commit 86ad60a65f29dd862a11c22bb4b5be28d6c5cef1
>
> The XTS asm helper arrangement is a bit odd: the 8-way stride helper
> consists of back-to-back calls to the 4-way core transforms, which
> are called indirectly, based on a boolean that indicates whether we
> are performing encryption or decryption.
>
> Given how costly indirect calls are on x86, let's switch to direct
> calls, and given how the 8-way stride doesn't really add anything
> substantial, use a 4-way stride instead, and make the asm core
> routine deal with any multiple of 4 blocks. Since 512 byte sectors
> or 4 KB blocks are the typical quantities XTS operates on, increase
> the stride exported to the glue helper to 512 bytes as well.
>
> As a result, the number of indirect calls is reduced from 3 per 64 bytes
> of in/output to 1 per 512 bytes of in/output, which produces a 65% speedup
> when operating on 1 KB blocks (measured on a Intel(R) Core(TM) i7-8650U CPU)
>
> Fixes: 9697fa39efd3f ("x86/retpoline/crypto: Convert crypto assembler indirect jumps")
> Tested-by: Eric Biggers <ebiggers@google.com> # x86_64
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> [ardb: rebase onto stable/linux-5.4.y]
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
>
> Please apply on top of backports of
>
> 9c1e8836edbb crypto: x86 - Regularize glue function prototypes
> 032d049ea0f4 crypto: aesni - Use TEST %reg,%reg instead of CMP $0,%reg
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2021-03-19 10:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 17:41 [PATCH for-stable-5.4] crypto: x86/aes-ni-xts - use direct calls to and 4-way stride Ard Biesheuvel
2021-03-19 10:32 ` Greg KH [this message]
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=YFR9z5xqrsq0gZAS@kroah.com \
--to=greg@kroah.com \
--cc=ardb@google.com \
--cc=ardb@kernel.org \
--cc=ebiggers@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tmb@tmb.nu \
/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