summaryrefslogtreecommitdiff
path: root/arch/arm/vfp/entry.S
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-03-16 00:51:42 +0100
committerArd Biesheuvel <ardb@kernel.org>2023-05-17 15:08:14 +0200
commit4708fb041346fa9cc6745dafb8c248a3e2f1075b (patch)
treef80f1ea6a8b1084b4e1943a33d4d992f7a2839e2 /arch/arm/vfp/entry.S
parent4a0548c6681cd25b8d76e897e01bfb62ce93916d (diff)
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>
Diffstat (limited to 'arch/arm/vfp/entry.S')
-rw-r--r--arch/arm/vfp/entry.S12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
index 62206ef25037..547c94c62cd3 100644
--- a/arch/arm/vfp/entry.S
+++ b/arch/arm/vfp/entry.S
@@ -22,10 +22,10 @@
@ IRQs enabled.
@
ENTRY(do_vfp)
- mov r1, r10
- str lr, [sp, #-8]!
- add r3, sp, #4
- str r9, [r3]
- bl vfp_entry
- ldr pc, [sp], #8
+ mov r1, r0 @ pass trigger opcode via R1
+ mov r0, sp @ pass struct pt_regs via R0
+ bl vfp_support_entry @ dispatch the VFP exception
+ cmp r0, #0 @ handled successfully?
+ reteq r9 @ then use R9 as return address
+ ret lr @ pass to undef handler
ENDPROC(do_vfp)