[PATCH] ARM: iwmmxt: Remove support for PJ4/PJ4B cores

Linus Walleij linus.walleij at linaro.org
Fri Feb 9 05:54:32 PST 2024


On Fri, Feb 9, 2024 at 12:09 PM Ard Biesheuvel <ardb+git at google.com> wrote:

> From: Ard Biesheuvel <ardb at kernel.org>
>
> PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
> does not support this combination (its iWMMXt configuration always
> implies v5te), and so there is no v6/v7 user space that actually makes
> use of this, beyond generic support for things like setjmp() that
> preserve/restore the iWMMXt register file using generic LDC/STC
> instructions emitted in assembler. As [0] appears to imply, this logic
> is triggered for the init process at boot, and so most processes will
> have a iWMMXt register context associated with it, even though it is
> never used.
>
> This means that advertising iWMMXt support on these cores results in
> context switch overhead without any associated benefit, and so it is
> better to simply ignore the iWMMXt unit on these systems. So rip out the
> support. Doing so also fixes the issue reported in [0] related to UNDEF
> handling of co-processor #0/#1 instructions issued from user space
> running in Thumb2 mode.
>
> Cc: Arnd Bergmann <arnd at arndb.de>
> Cc: Nicolas Pitre <nico at fluxnic.net>
> Cc: Russell King <linux at armlinux.org.uk>
> Cc: Linus Walleij <linus.walleij at linaro.org>
> Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
> Signed-off-by: Ard Biesheuvel <ardb at kernel.org>

Acked-by: Linus Walleij <linus.walleij at linaro.org>

I would probably say in the commit message that the window for enabling
this in GCC and userspace was when the core was introduced and it
has long since passed; whoever was supposed to do this didn't exist
or care and thus the job never got done.

I was worried about some assembly in userspace making use of this,
so I checked libavcodec and it does not seem to have any iWMMX
optimizations at all. (Don't know what else to check.)

CC to Lubomir who made the Dell WYSE port which use MMP3 with PJ4
so he can check that he doesn't have userspace using this either and
can ACK this commit.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list