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@kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Walleij <redacted>
Link: https://lore.kernel.org/all/ZBBYCSZUJOWBg1s8@localhost.localdomain/ (local)
For the series:
Tested-by: Guenter Roeck <linux@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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel