ARM: vfp: Reimplement VFP exception entry in C code
authorArd Biesheuvel <ardb@kernel.org>
Wed, 15 Mar 2023 23:51:42 +0000 (00:51 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Wed, 17 May 2023 13:08:14 +0000 (15:08 +0200)
commit4708fb041346fa9cc6745dafb8c248a3e2f1075b
treef80f1ea6a8b1084b4e1943a33d4d992f7a2839e2
parent4a0548c6681cd25b8d76e897e01bfb62ce93916d
ARM: vfp: Reimplement VFP exception entry in C code

En/disabling softirqs from asm code turned out to be trickier than
expected, so vfp_support_entry now returns by tail calling
__local_enable_bh_ip() and passing the same arguments that a C call to
local_bh_enable() would pass. However, this is slightly hacky, as we
don't want to carry our own implementation of local_bh_enable().

So let's bite the bullet, and get rid of the asm logic in
vfp_support_entry that reasons about whether or not to save and/or
reload the VFP state, and about whether or not an FP exception is
pending, and only keep the VFP loading logic as a function that is
callable from C.

Replicate the removed logic in vfp_entry(), and use the exact same
reasoning as in the asm code. To emphasize the correspondence, retain
some of the asm comments in the C version as well.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/vfp/entry.S
arch/arm/vfp/vfp.h
arch/arm/vfp/vfphw.S
arch/arm/vfp/vfpmodule.c