[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]

 



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
 	walk->data += offset;
 
 	if (offset & alignmask) {
@@ -93,7 +97,9 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
 		return nbytes;
 	}
 
+#ifndef CONFIG_X86_64
 	kunmap_atomic(walk->data);
+#endif
 	crypto_yield(walk->flags);
 
 	if (err)
-- 
1.7.11.7



--
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