Re: [PATCH v4 04/12] ARM: entry: Fix iWMMXT TIF flag handling

From
Linus Walleij <hidden>
Date
2023-03-21 14:32:36
Also in
stable
Reply to
Ard Biesheuvel, 2023-03-20
On Mon, Mar 20, 2023 at 2:19 PM Ard Biesheuvel [off-list ref] wrote:
The conditional MOVS instruction that appears to have been added to test
for the TIF_USING_IWMMXT thread_info flag only sets the N and Z
condition flags and register R7, none of which are referenced in the
subsequent code. This means that the instruction does nothing, which
means that we might misidentify faulting FPE instructions as iWMMXT
instructions on kernels that were built to support both.

This seems to have been part of the original submission of the code, and
so this has never worked as intended, and nobody ever noticed, and so we
might decide to just leave this as-is. However, with the ongoing move
towards multiplatform kernels, the issue becomes more likely to
manifest, and so it is better to fix it.

So check whether we are dealing with an undef exception regarding
coprocessor index #0 or #1, and if so, load the thread_info flag and
only dispatch it as a iWMMXT trap if the flag is set.

Cc: <redacted> # v2.6.9+
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Looks right to me.
Reviewed-by: Linus Walleij <redacted>

The code dates back before git history, but it was introduced in
Linux v2.6.9 and it looks like Nicolas Pitre wrote it so let's just
ping him and see what he remembers about this!

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (32 messages) 32 messages, 6 authors, last reply 2023-04-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help