[PATCH v2 0/3] ARM: vfp: Switch to C API to en/disable softirqs

Ard Biesheuvel ardb at kernel.org
Tue Mar 14 12:27:53 PDT 2023


As it turns out, enabling or disabling softirqs from asm code is more
tricky than it looks. Simply bumping the associated bit in preempt_count
does the trick for uninstrumented kernels, but with lockdep or preempt
debug enabled, we really need to call the C versions, as replicating
their behavior in asm fully is intractible.

So let's rework the existing code a little bit so we can interpose a
little C helper 'vfp_entry()' that disables softirqs before calling the
existing vfpstate handling code in asm. Re-enabling softirqs from asm
code is more straight-forward, as we can simply perform a tail call via
a C routine that is guaranteed to be callable as a function.

Cc: Frederic Weisbecker <frederic at kernel.org>
Cc: Guenter Roeck <linux at roeck-us.net>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Linus Walleij <linus.walleij at linaro.org>
Link: https://lore.kernel.org/all/ZBBYCSZUJOWBg1s8@localhost.localdomain/

Ard Biesheuvel (3):
  ARM: vfp: Pass thread_info pointer to vfp_support_entry
  ARM: vfp: Pass successful return address via register R3
  ARM: vfp: Fix broken softirq handling with instrumentation enabled

 arch/arm/include/asm/assembler.h | 13 ---------
 arch/arm/vfp/entry.S             | 17 ++---------
 arch/arm/vfp/vfphw.S             | 30 +++++++++++---------
 arch/arm/vfp/vfpmodule.c         | 27 ++++++++++++++----
 4 files changed, 42 insertions(+), 45 deletions(-)

-- 
2.39.2




More information about the linux-arm-kernel mailing list