From: Ard Biesheuvel <ardb@kernel.org>
To: linux-arm-kernel@lists.infradead.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Russell King <linux@armlinux.org.uk>,
Nicolas Pitre <nico@fluxnic.net>
Subject: [PATCH v2 0/8] ARM: vfp: Reimplement dispatch and support logic in C
Date: Wed, 17 May 2023 23:28:00 +0200 [thread overview]
Message-ID: <20230517212808.3895190-1-ardb@kernel.org> (raw)
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].
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 v1:
- rebase onto v6.4-rc2
- add Arnd's ack to #2
- fix issue in #7 regarding access to struct pt_regs to update the user
PC
- move residual FPE-only undef dispatch asm code to nwfpe/entry.S (#8)
This v2 can be found at [2]. KernelCI test results for this version of
the series can be found at [3].
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/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=arm-vfp-softirq-fixes
[3] https://linux.kernelci.org/test/job/ardb/branch/for-kernelci/kernel/arm-vfp-refactor-for-rmk/
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Nicolas Pitre <nico@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 | 254 +-------------------
arch/arm/kernel/iwmmxt.S | 18 +-
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/nwfpe/entry.S | 77 ++++++
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 +++++++++++-----
15 files changed, 286 insertions(+), 540 deletions(-)
delete mode 100644 arch/arm/vfp/entry.S
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-05-17 21:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 21:28 Ard Biesheuvel [this message]
2023-05-17 21:28 ` [PATCH v2 1/8] ARM: vfp: Record VFP bounces as perf emulation faults Ard Biesheuvel
2023-05-17 21:28 ` [PATCH v2 2/8] ARM: vfp: Remove workaround for Feroceon CPUs Ard Biesheuvel
2023-05-17 21:28 ` [PATCH v2 3/8] ARM: vfp: Reimplement VFP exception entry in C code Ard Biesheuvel
2023-05-17 21:28 ` [PATCH v2 4/8] ARM: kernel: Get rid of thread_info::used_cp[] array Ard Biesheuvel
2023-05-17 21:28 ` [PATCH v2 5/8] ARM: vfp: Use undef hook for handling VFP exceptions Ard Biesheuvel
2023-05-17 21:28 ` [PATCH v2 6/8] ARM: entry: Disregard Thumb undef exception in coproc dispatch Ard Biesheuvel
2023-05-17 21:28 ` [PATCH v2 7/8] ARM: iwmmxt: Use undef hook to enable coprocessor for task Ard Biesheuvel
2023-05-17 21:28 ` [PATCH v2 8/8] ARM: entry: Make asm coproc dispatch code NWFPE only Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230517212808.3895190-1-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=nico@fluxnic.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).