]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: qce - fix priority to be less than ARMv8 CE
authorEric Biggers <ebiggers@google.com>
Tue, 3 Dec 2024 18:05:53 +0000 (10:05 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 14 Dec 2024 09:21:43 +0000 (17:21 +0800)
As QCE is an order of magnitude slower than the ARMv8 Crypto Extensions
on the CPU, and is also less well tested, give it a lower priority.
Previously the QCE SHA algorithms had higher priority than the ARMv8 CE
equivalents, and the ciphers such as AES-XTS had the same priority which
meant the QCE versions were chosen if they happened to be loaded later.

Fixes: ec8f5d8f6f76 ("crypto: qce - Qualcomm crypto engine driver")
Cc: stable@vger.kernel.org
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Thara Gopinath <thara.gopinath@gmail.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qce/aead.c
drivers/crypto/qce/sha.c
drivers/crypto/qce/skcipher.c

index 7d811728f047823c3254c4234ce77ae71719b168..97b56e92ea33f52d77da0ae2d11ddc9be836d98e 100644 (file)
@@ -786,7 +786,7 @@ static int qce_aead_register_one(const struct qce_aead_def *def, struct qce_devi
        alg->init                       = qce_aead_init;
        alg->exit                       = qce_aead_exit;
 
-       alg->base.cra_priority          = 300;
+       alg->base.cra_priority          = 275;
        alg->base.cra_flags             = CRYPTO_ALG_ASYNC |
                                          CRYPTO_ALG_ALLOCATES_MEMORY |
                                          CRYPTO_ALG_KERN_DRIVER_ONLY |
index 916908c04b635c43f87920c7344ef00d15eb8376..c4ddc3b265eedecfd048662dc8935aa3e20fc646 100644 (file)
@@ -482,7 +482,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_priority = 175;
        base->cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY;
        base->cra_ctxsize = sizeof(struct qce_sha_ctx);
        base->cra_alignmask = 0;
index 5b493fdc1e747fd3ec238f2ddeaee2acc445bdc3..ffb334eb5b34615f9488fa4bf55cf9344c0048c7 100644 (file)
@@ -461,7 +461,7 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def,
        alg->encrypt                    = qce_skcipher_encrypt;
        alg->decrypt                    = qce_skcipher_decrypt;
 
-       alg->base.cra_priority          = 300;
+       alg->base.cra_priority          = 275;
        alg->base.cra_flags             = CRYPTO_ALG_ASYNC |
                                          CRYPTO_ALG_ALLOCATES_MEMORY |
                                          CRYPTO_ALG_KERN_DRIVER_ONLY;