Skip to content

Commit 82e269a

Browse files
Sebastian Andrzej Siewiorherbertx
authored andcommitted
crypto: testmgr - Only disable migration in crypto_disable_simd_for_test()
crypto_disable_simd_for_test() disables preemption in order to receive a stable per-CPU variable which it needs to modify in order to alter crypto_simd_usable() results. This can also be achived by migrate_disable() which forbidds CPU migrations but allows the task to be preempted. The latter is important for PREEMPT_RT since operation like skcipher_walk_first() may allocate memory which must not happen with disabled preemption on PREEMPT_RT. Use migrate_disable() in crypto_disable_simd_for_test() to achieve a stable per-CPU pointer. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 32dfef6 commit 82e269a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crypto/testmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,14 +1061,14 @@ static void generate_random_testvec_config(struct testvec_config *cfg,
10611061

10621062
static void crypto_disable_simd_for_test(void)
10631063
{
1064-
preempt_disable();
1064+
migrate_disable();
10651065
__this_cpu_write(crypto_simd_disabled_for_test, true);
10661066
}
10671067

10681068
static void crypto_reenable_simd_for_test(void)
10691069
{
10701070
__this_cpu_write(crypto_simd_disabled_for_test, false);
1071-
preempt_enable();
1071+
migrate_enable();
10721072
}
10731073

10741074
/*

0 commit comments

Comments
 (0)