linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: qce - add CRYPTO_ALG_KERN_DRIVER_ONLY flag
@ 2019-09-19 21:33 Eneas U de Queiroz
  2019-10-04 15:44 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Eneas U de Queiroz @ 2019-09-19 21:33 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller; +Cc: Eneas U de Queiroz, linux-crypto

Set the CRYPTO_ALG_KERN_DRIVER_ONLY flag to all algorithms exposed by
the qce driver, since they are all hardware accelerated, accessible
through a kernel driver only, and not available directly to userspace.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>

diff --git a/drivers/crypto/qce/ablkcipher.c b/drivers/crypto/qce/ablkcipher.c
index 7a98bf5cc967..f0b59a8bbed0 100644
--- a/drivers/crypto/qce/ablkcipher.c
+++ b/drivers/crypto/qce/ablkcipher.c
@@ -380,7 +380,7 @@ static int qce_ablkcipher_register_one(const struct qce_ablkcipher_def *def,
 
 	alg->cra_priority = 300;
 	alg->cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC |
-			 CRYPTO_ALG_NEED_FALLBACK;
+			 CRYPTO_ALG_NEED_FALLBACK | CRYPTO_ALG_KERN_DRIVER_ONLY;
 	alg->cra_ctxsize = sizeof(struct qce_cipher_ctx);
 	alg->cra_alignmask = 0;
 	alg->cra_type = &crypto_ablkcipher_type;
diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c
index 0853e74583ad..95ab16fc8fd6 100644
--- a/drivers/crypto/qce/sha.c
+++ b/drivers/crypto/qce/sha.c
@@ -495,7 +495,7 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def,
 	base = &alg->halg.base;
 	base->cra_blocksize = def->blocksize;
 	base->cra_priority = 300;
-	base->cra_flags = CRYPTO_ALG_ASYNC;
+	base->cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY;
 	base->cra_ctxsize = sizeof(struct qce_sha_ctx);
 	base->cra_alignmask = 0;
 	base->cra_module = THIS_MODULE;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: qce - add CRYPTO_ALG_KERN_DRIVER_ONLY flag
  2019-09-19 21:33 [PATCH] crypto: qce - add CRYPTO_ALG_KERN_DRIVER_ONLY flag Eneas U de Queiroz
@ 2019-10-04 15:44 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2019-10-04 15:44 UTC (permalink / raw)
  To: Eneas U de Queiroz; +Cc: David S. Miller, linux-crypto

On Thu, Sep 19, 2019 at 06:33:02PM -0300, Eneas U de Queiroz wrote:
> Set the CRYPTO_ALG_KERN_DRIVER_ONLY flag to all algorithms exposed by
> the qce driver, since they are all hardware accelerated, accessible
> through a kernel driver only, and not available directly to userspace.
> 
> Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-04 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 21:33 [PATCH] crypto: qce - add CRYPTO_ALG_KERN_DRIVER_ONLY flag Eneas U de Queiroz
2019-10-04 15:44 ` Herbert Xu

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