Skip to content

Commit b6f3fef

Browse files
Suresh Siddhaherbertx
authored andcommitted
crypto, tcrypt: remove local_bh_disable/enable() around local_irq_disable/enable()
Ran into this while looking at some new crypto code using FPU hitting a WARN_ON_ONCE(!irq_fpu_usable()) in the kernel_fpu_begin() on a x86 kernel that uses the new eagerfpu model. In short, current eagerfpu changes return 0 for interrupted_kernel_fpu_idle() and the in_interrupt() thinks it is in the interrupt context because of the local_bh_disable(). Thus resulting in the WARN_ON(). Remove the local_bh_disable/enable() calls around the existing local_irq_disable/enable() calls. local_irq_disable/enable() already disables the BH. [ If there are any other legitimate users calling kernel_fpu_begin() from the process context but with BH disabled, then we can look into fixing the irq_fpu_usable() in future. ] Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 35c41db commit b6f3fef

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

‎crypto/tcrypt.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ static int test_cipher_cycles(struct blkcipher_desc *desc, int enc,
9797
int ret = 0;
9898
int i;
9999

100-
local_bh_disable();
101100
local_irq_disable();
102101

103102
/* Warm-up run. */
@@ -130,7 +129,6 @@ static int test_cipher_cycles(struct blkcipher_desc *desc, int enc,
130129

131130
out:
132131
local_irq_enable();
133-
local_bh_enable();
134132

135133
if (ret == 0)
136134
printk("1 operation in %lu cycles (%d bytes)\n",
@@ -300,7 +298,6 @@ static int test_hash_cycles_digest(struct hash_desc *desc,
300298
int i;
301299
int ret;
302300

303-
local_bh_disable();
304301
local_irq_disable();
305302

306303
/* Warm-up run. */
@@ -327,7 +324,6 @@ static int test_hash_cycles_digest(struct hash_desc *desc,
327324

328325
out:
329326
local_irq_enable();
330-
local_bh_enable();
331327

332328
if (ret)
333329
return ret;
@@ -348,7 +344,6 @@ static int test_hash_cycles(struct hash_desc *desc, struct scatterlist *sg,
348344
if (plen == blen)
349345
return test_hash_cycles_digest(desc, sg, blen, out);
350346

351-
local_bh_disable();
352347
local_irq_disable();
353348

354349
/* Warm-up run. */
@@ -391,7 +386,6 @@ static int test_hash_cycles(struct hash_desc *desc, struct scatterlist *sg,
391386

392387
out:
393388
local_irq_enable();
394-
local_bh_enable();
395389

396390
if (ret)
397391
return ret;

0 commit comments

Comments
 (0)