HomeFreeBSD

armv8_crypto: fix recursive fpu_kern_enter call

Description

armv8_crypto: fix recursive fpu_kern_enter call

Now armv8_crypto is using FPU_KERN_NOCTX, this results in a kernel panic
in armv8_crypto.c:armv8_crypto_cipher_setup:

panic: recursive fpu_kern_enter while in PCB_FP_NOSAVE state

This is because in armv8_crypto.c:armv8_crypto_cipher_process,
directly after calling fpu_kern_enter() a call is made to
armv8_crypto_cipher_setup(), resulting in nested calls to
fpu_kern_enter() without the required fpu_kern_leave() in between.

Move fpu_kern_enter() in armv8_crypto_cipher_process() after the
call to armv8_crypto_cipher_setup() to resolve this.

Reviewed by: markj, andrew
Fixes: 6485286f536f ("armv8_crypto: Switch to using FPU_KERN_NOCTX")
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41671

(cherry picked from commit 565c887a775284bfb1a15eadee2c3f312d288c01)

Details

Provenance
zachary.leaf_arm.comAuthored on Aug 31 2023, 1:11 PM
jhbCommitted on Dec 29 2023, 9:49 PM
Reviewer
rG6485286f536f: armv8_crypto: Switch to using FPU_KERN_NOCTX
Differential Revision
D41671: armv8_crypto: fix recursive fpu_kern_enter call
Parents
rG7945b99a003f: armv8_crypto: Remove dieing flag and rw lock
Branches
Unknown
Tags
Unknown