linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Ard Biesheuvel <ardb@kernel.org>, Zorro Lang <zlang@redhat.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Bug report] kernel BUG at include/linux/scatterlist.h
Date: Fri, 29 Nov 2024 08:54:35 +0100	[thread overview]
Message-ID: <Z0lzOw7mQGuPrXlD@wunner.de> (raw)
In-Reply-To: <Z0RTgsb5Va9psaIs@gondor.apana.org.au>

On Mon, Nov 25, 2024 at 06:37:54PM +0800, Herbert Xu wrote:
> On Mon, Nov 25, 2024 at 11:29:30AM +0100, Lukas Wunner wrote:
> > I deliberately avoided the crypto_akcipher_sync_encrypt() API
> > in rsassa-pkcs1.c because the extra buffer allocation plus copying
> > data around impacts performance for no benefit.
> 
> This is temporary.  The idea is to convert the akcipher software
> implementations over to use virtual addresses directly so that no
> unnecessary copy occurs.  Have a look at what I did with ahash:
> 
> https://lore.kernel.org/linux-crypto/bffef4bab1bf250bd64a3d02de53eb1fd047a96e.1730021644.git.herbert@gondor.apana.org.au/
> 
> This is what I'd like to do with akcipher as well.
> 
> Longer term there is potentially another unnecessary copy if you
> go from a kmalloced virtual address to an akcipher hardware driver,
> but we could eliminate that by adding a flag to indicate that the
> virtual address is safe for use within an SG list.

I'm proposing an optimized approach which auto-detects whether
duplicating into the linear map is actually necessary:

https://lore.kernel.org/r/3de5d373c86dcaa5abc36f501c1398c4fbf05f2f.1732865109.git.lukas@wunner.de/

I reckon that aside of selftests, duplicating is almost never needed.

Let me know if you have any objections.  My apologies for being
stubborn and rebellious and not always following what I'm told.

Thanks,

Lukas

  reply	other threads:[~2024-11-29  7:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22  4:51 [Bug report] kernel BUG at include/linux/scatterlist.h Zorro Lang
2024-11-22  6:42 ` Ard Biesheuvel
2024-11-22  7:44   ` Herbert Xu
2024-11-22  8:37     ` Herbert Xu
2024-11-24 16:24       ` Lukas Wunner
2024-11-24 23:13         ` Herbert Xu
2024-11-25 10:29           ` Lukas Wunner
2024-11-25 10:37             ` Herbert Xu
2024-11-29  7:54               ` Lukas Wunner [this message]
2024-11-29  8:03                 ` Herbert Xu
2024-11-22 19:28     ` Zorro Lang
2024-11-29  9:53 ` [PATCH] crypto: rsassa-pkcs1 - Copy source data for SG list Herbert Xu
2024-11-30  8:41   ` Lukas Wunner
2024-12-03  7:57     ` Herbert Xu

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=Z0lzOw7mQGuPrXlD@wunner.de \
    --to=lukas@wunner.de \
    --cc=ardb@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zlang@redhat.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;
as well as URLs for NNTP newsgroup(s).