Re: [PATCH 1/6] crypto: SHA1 multibuffer map scatter gather walk's buffer address directly for x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 13, 2014 at 04:19:42PM -0700, Tim Chen wrote:
> For x86_64, it is not necessary to incur the additional overhead in
> kmap_atomic to map the scatter gather buffer to a linear address.
> Mapping the address directly will allow in x86_64 allows multi-buffer
> crypto hash alogrithms to have several unfinished buffers with their
> address stored in job context before switching out of the crypto daemon.
> 
> Signed-off-by: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
> ---
>  crypto/ahash.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/crypto/ahash.c b/crypto/ahash.c
> index a92dc38..556f1fa 100644
> --- a/crypto/ahash.c
> +++ b/crypto/ahash.c
> @@ -46,7 +46,11 @@ static int hash_walk_next(struct crypto_hash_walk *walk)
>  	unsigned int nbytes = min(walk->entrylen,
>  				  ((unsigned int)(PAGE_SIZE)) - offset);
>  
> +#ifdef CONFIG_X86_64
> +	walk->data = page_address(walk->pg);
> +#else
>  	walk->data = kmap_atomic(walk->pg);
> +#endif

Why do we need this patch since kmap_atomic is equivalent to
page_address plus preempt_disable on x86-64?

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux