Message ID | 20221114001238.163209-3-ebiggers@kernel.org |
---|---|
State | New |
Headers | show |
Series | crypto: reduce overhead when self-tests disabled | expand |
On Sun, Nov 13, 2022 at 04:12:34PM -0800, Eric Biggers wrote: > diff --git a/crypto/algboss.c b/crypto/algboss.c > index eb5fe84efb83e..13d37320a66eb 100644 > --- a/crypto/algboss.c > +++ b/crypto/algboss.c > @@ -181,12 +181,8 @@ static int cryptomgr_test(void *data) > goto skiptest; > #endif > > - if (type & CRYPTO_ALG_TESTED) > - goto skiptest; > - > err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED); > > -skiptest: > crypto_alg_tested(param->driver, err); Ard pointed out that there's a bisection hazard here, since this patch deletes the skiptest label, but the last goto to it isn't deleted until patch 6. Sorry about that. Herbert, do you want to fix this by rebasing, or is it too late? - Eric
On Wed, Nov 30, 2022 at 07:04:23PM +0000, Eric Biggers wrote: . > Ard pointed out that there's a bisection hazard here, since this patch deletes > the skiptest label, but the last goto to it isn't deleted until patch 6. Sorry > about that. Herbert, do you want to fix this by rebasing, or is it too late? I don't think it's worth worrying about. Thanks,
diff --git a/crypto/algapi.c b/crypto/algapi.c index 950195e90bfc9..851b247f043d3 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -278,7 +278,8 @@ static struct crypto_larval *crypto_alloc_test_larval(struct crypto_alg *alg) struct crypto_larval *larval; if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER) || - IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)) + IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) || + (alg->cra_flags & CRYPTO_ALG_INTERNAL)) return NULL; /* No self-test needed */ larval = crypto_larval_alloc(alg->cra_name, diff --git a/crypto/algboss.c b/crypto/algboss.c index eb5fe84efb83e..13d37320a66eb 100644 --- a/crypto/algboss.c +++ b/crypto/algboss.c @@ -181,12 +181,8 @@ static int cryptomgr_test(void *data) goto skiptest; #endif - if (type & CRYPTO_ALG_TESTED) - goto skiptest; - err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED); -skiptest: crypto_alg_tested(param->driver, err); kfree(param); @@ -197,7 +193,6 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) { struct task_struct *thread; struct crypto_test_param *param; - u32 type; if (!try_module_get(THIS_MODULE)) goto err; @@ -208,13 +203,7 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) memcpy(param->driver, alg->cra_driver_name, sizeof(param->driver)); memcpy(param->alg, alg->cra_name, sizeof(param->alg)); - type = alg->cra_flags; - - /* Do not test internal algorithms. */ - if (type & CRYPTO_ALG_INTERNAL) - type |= CRYPTO_ALG_TESTED; - - param->type = type; + param->type = alg->cra_flags; thread = kthread_run(cryptomgr_test, param, "cryptomgr_test"); if (IS_ERR(thread))