All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Junaid Shahid <junaids@google.com>, herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org, andreslc@google.com,
	davem@davemloft.net, gthelen@google.com, ebiggers3@gmail.com
Subject: Re: [PATCH 2/4] crypto: aesni - Enable one-sided zero copy for gcm(aes) request buffers
Date: Tue, 23 Jan 2018 07:06:35 +0100	[thread overview]
Message-ID: <1797684.7ixjphp57z@tauon.chronox.de> (raw)
In-Reply-To: <20180122230403.52572-3-junaids@google.com>

Am Dienstag, 23. Januar 2018, 00:04:01 CET schrieb Junaid Shahid:

Hi Junaid,

> gcmaes_encrypt/decrypt perform zero-copy crypto if both the source and
> destination satisfy certain conditions (single sglist entry located in
> low-mem or within a single high-mem page). But two copies are done
> otherwise, even if one of source or destination still satisfies the
> zero-copy conditions. This optimization is now extended to avoid the
> copy on the side that does satisfy the zero-copy conditions.
> 
> Signed-off-by: Junaid Shahid <junaids@google.com>
> ---
>  arch/x86/crypto/aesni-intel_glue.c | 256
> +++++++++++++++++++------------------ 1 file changed, 134 insertions(+),
> 122 deletions(-)
> 
> diff --git a/arch/x86/crypto/aesni-intel_glue.c
> b/arch/x86/crypto/aesni-intel_glue.c index 3bf3dcf29825..a46eb2d25f71
> 100644
> --- a/arch/x86/crypto/aesni-intel_glue.c
> +++ b/arch/x86/crypto/aesni-intel_glue.c
> @@ -744,136 +744,148 @@ static int generic_gcmaes_set_authsize(struct
> crypto_aead *tfm, return 0;
>  }
> 
> +static bool is_mappable(struct scatterlist *sgl, unsigned long len)
> +{
> +	return (!PageHighMem(sg_page(sgl)) || sgl->offset + len <= PAGE_SIZE)
> +	       && len <= sgl->length;

Please integrate the patch https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg30542.html

@Herbert: If this patch series goes in, then the mentioned patch would not be 
needed for the current implementation, but only for stable.

Ciao
Stephan

  reply	other threads:[~2018-01-23  6:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 23:03 [PATCH 0/4] crypto: aesni - Use zero-copy for gcm(aes) buffers that are partially contiguous Junaid Shahid
2018-01-22 23:04 ` [PATCH 1/4] crypto: aesni - Fix out-of-bounds access of the AAD buffer in AVX gcm-aesni Junaid Shahid
2018-01-22 23:04 ` [PATCH 2/4] crypto: aesni - Enable one-sided zero copy for gcm(aes) request buffers Junaid Shahid
2018-01-23  6:06   ` Stephan Mueller [this message]
2018-01-22 23:04 ` [PATCH 3/4] crypto: aesni - Directly use kmap_atomic instead of scatter_walk object in gcm(aes) Junaid Shahid
2018-01-22 23:04 ` [PATCH 4/4] crypto: aesni - Use zero-copy for gcm(aes) even if the AAD/Data/AuthTag are separate Junaid Shahid

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=1797684.7ixjphp57z@tauon.chronox.de \
    --to=smueller@chronox.de \
    --cc=andreslc@google.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers3@gmail.com \
    --cc=gthelen@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=junaids@google.com \
    --cc=linux-crypto@vger.kernel.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 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.