[PATCH 0/8] ARM: vfp: Reimplement dispatch and support logic in C

Ard Biesheuvel ardb at kernel.org
Tue May 9 05:29:30 PDT 2023


This is a follow-up to [0] 'ARM: vfp: Switch to C API to en/disable
softirqs', which fixed some issues introduced by a prior series of mine
that relaxed the requirement for kernel mode NEON to only run in task
context [1]. This is marked as a v1, but carries some acks inherited
from that series, as it contained most of these patches already.

As it turns out, the VFP dispatch logic in the entry code, as well as
the VFP support code that triages the exceptions are good candidates for
receiving the same treatment: we now have the undef_hook API for
matching PSR values and opcodes, and the exceptions are all ultimately
routed to C code anyway, now that we return via __local_bh_enable_ip()
back to the caller. So most of this logic can be moved to C.

So let's clean this up: reimplement the VFP handling in C code, so that
we can get rid of most of the asm code that deals with this.

Changes since [0]:
- drop bogus patch 'fixing' the iWMMXT dispatch logic
- add some acks from Nico and Linus
- rip out even more asm code in patch #6 - there is no need to load the
  opcode from user space at all when entering in Thumb mode

[0] https://lore.kernel.org/all/20230320131845.3138015-1-ardb@kernel.org/
[1] https://lore.kernel.org/all/20221207103936.2198407-1-ardb@kernel.org/

Cc: Linus Walleij <linus.walleij at linaro.org>
Cc: Arnd Bergmann <arnd at arndb.de>
Cc: Russell King <linux at armlinux.org.uk>
Cc: Nicolas Pitre <nico at fluxnic.net>

Ard Biesheuvel (8):
  ARM: vfp: Record VFP bounces as perf emulation faults
  ARM: vfp: Remove workaround for Feroceon CPUs
  ARM: vfp: Reimplement VFP exception entry in C code
  ARM: kernel: Get rid of thread_info::used_cp[] array
  ARM: vfp: Use undef hook for handling VFP exceptions
  ARM: entry: Disregard Thumb undef exception in coproc dispatch
  ARM: iwmmxt: Use undef hook to enable coprocessor for task
  ARM: entry: Make asm coproc dispatch code NWFPE only

 arch/arm/include/asm/thread_info.h |  17 +-
 arch/arm/kernel/asm-offsets.c      |   1 -
 arch/arm/kernel/entry-armv.S       | 186 +++--------------
 arch/arm/kernel/iwmmxt.S           |   9 +
 arch/arm/kernel/pj4-cp0.c          |   1 +
 arch/arm/kernel/process.c          |   1 -
 arch/arm/kernel/ptrace.c           |   2 -
 arch/arm/kernel/xscale-cp0.c       |   1 +
 arch/arm/mm/proc-feroceon.S        |   4 +
 arch/arm/vfp/Makefile              |   2 +-
 arch/arm/vfp/entry.S               |  31 ---
 arch/arm/vfp/vfp.h                 |   1 +
 arch/arm/vfp/vfphw.S               | 208 ++------------------
 arch/arm/vfp/vfpmodule.c           | 208 ++++++++++++++------
 14 files changed, 215 insertions(+), 457 deletions(-)
 delete mode 100644 arch/arm/vfp/entry.S

-- 
2.39.2




More information about the linux-arm-kernel mailing list