[PATCH v2 0/3] ARM: vfp: Switch to C API to en/disable softirqs
Guenter Roeck
linux at roeck-us.net
Tue Mar 14 15:34:18 PDT 2023
On Tue, Mar 14, 2023 at 08:27:53PM +0100, Ard Biesheuvel wrote:
> 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/
>
For the series:
Tested-by: Guenter Roeck <linux at roeck-us.net>
Series applied on top of v6.3-rc2. Tested with 300+ boot tests on all
arm qemu machines in my test bed.
Cross-check: Without this series, a warning backtrace is observed
roughly once per ~20 boot attempts.
Thanks,
Guenter
> 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