Skip to content

Commit b9920fd

Browse files
ardbiesheuvelRussell King (Oracle)
authored andcommitted
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
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 user threads will have a iWMMXt register context associated with it, even though it is never used. At this point, it is highly unlikely that such GCC support will ever materialize (and Clang does not implement support for iWMMXt to begin with). 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. The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox, d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the first is still widely used, but that one actually doesn't have iWMMXt but instead has only VFPV3-D16, and so it is not impacted by this change. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0] Fixes: 8bcba70 ("ARM: entry: Disregard Thumb undef exception ...") Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Nicolas Pitre <nico@fluxnic.net> Reviewed-by: Jisheng Zhang <jszhang@kernel.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
1 parent c8c178e commit b9920fd

File tree

4 files changed

+15
-177
lines changed

4 files changed

+15
-177
lines changed

arch/arm/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ source "arch/arm/mm/Kconfig"
503503

504504
config IWMMXT
505505
bool "Enable iWMMXt support"
506-
depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B
507-
default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 || CPU_PJ4B
506+
depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK
507+
default y if PXA27x || PXA3xx || ARCH_MMP
508508
help
509509
Enable support for iWMMXt context switching at run time if
510510
running on a CPU that supports it.

arch/arm/kernel/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
7575
obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o
7676
obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
7777
obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
78-
obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o
79-
obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o
8078
obj-$(CONFIG_IWMMXT) += iwmmxt.o
8179
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
8280
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \

arch/arm/kernel/iwmmxt.S

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@
1818
#include <asm/assembler.h>
1919
#include "iwmmxt.h"
2020

21-
#if defined(CONFIG_CPU_PJ4) || defined(CONFIG_CPU_PJ4B)
22-
#define PJ4(code...) code
23-
#define XSC(code...)
24-
#elif defined(CONFIG_CPU_MOHAWK) || \
25-
defined(CONFIG_CPU_XSC3) || \
26-
defined(CONFIG_CPU_XSCALE)
27-
#define PJ4(code...)
28-
#define XSC(code...) code
29-
#else
30-
#error "Unsupported iWMMXt architecture"
31-
#endif
32-
3321
#define MMX_WR0 (0x00)
3422
#define MMX_WR1 (0x08)
3523
#define MMX_WR2 (0x10)
@@ -81,17 +69,13 @@ ENDPROC(iwmmxt_undef_handler)
8169
ENTRY(iwmmxt_task_enable)
8270
inc_preempt_count r10, r3
8371

84-
XSC(mrc p15, 0, r2, c15, c1, 0)
85-
PJ4(mrc p15, 0, r2, c1, c0, 2)
72+
mrc p15, 0, r2, c15, c1, 0
8673
@ CP0 and CP1 accessible?
87-
XSC(tst r2, #0x3)
88-
PJ4(tst r2, #0xf)
74+
tst r2, #0x3
8975
bne 4f @ if so no business here
9076
@ enable access to CP0 and CP1
91-
XSC(orr r2, r2, #0x3)
92-
XSC(mcr p15, 0, r2, c15, c1, 0)
93-
PJ4(orr r2, r2, #0xf)
94-
PJ4(mcr p15, 0, r2, c1, c0, 2)
77+
orr r2, r2, #0x3
78+
mcr p15, 0, r2, c15, c1, 0
9579

9680
ldr r3, =concan_owner
9781
ldr r2, [r0, #S_PC] @ current task pc value
@@ -218,12 +202,9 @@ ENTRY(iwmmxt_task_disable)
218202
bne 1f @ no: quit
219203

220204
@ enable access to CP0 and CP1
221-
XSC(mrc p15, 0, r4, c15, c1, 0)
222-
XSC(orr r4, r4, #0x3)
223-
XSC(mcr p15, 0, r4, c15, c1, 0)
224-
PJ4(mrc p15, 0, r4, c1, c0, 2)
225-
PJ4(orr r4, r4, #0xf)
226-
PJ4(mcr p15, 0, r4, c1, c0, 2)
205+
mrc p15, 0, r4, c15, c1, 0
206+
orr r4, r4, #0x3
207+
mcr p15, 0, r4, c15, c1, 0
227208

228209
mov r0, #0 @ nothing to load
229210
str r0, [r3] @ no more current owner
@@ -232,10 +213,8 @@ ENTRY(iwmmxt_task_disable)
232213
bl concan_save
233214

234215
@ disable access to CP0 and CP1
235-
XSC(bic r4, r4, #0x3)
236-
XSC(mcr p15, 0, r4, c15, c1, 0)
237-
PJ4(bic r4, r4, #0xf)
238-
PJ4(mcr p15, 0, r4, c1, c0, 2)
216+
bic r4, r4, #0x3
217+
mcr p15, 0, r4, c15, c1, 0
239218

240219
mrc p15, 0, r2, c2, c0, 0
241220
mov r2, r2 @ cpwait
@@ -330,11 +309,9 @@ ENDPROC(iwmmxt_task_restore)
330309
*/
331310
ENTRY(iwmmxt_task_switch)
332311

333-
XSC(mrc p15, 0, r1, c15, c1, 0)
334-
PJ4(mrc p15, 0, r1, c1, c0, 2)
312+
mrc p15, 0, r1, c15, c1, 0
335313
@ CP0 and CP1 accessible?
336-
XSC(tst r1, #0x3)
337-
PJ4(tst r1, #0xf)
314+
tst r1, #0x3
338315
bne 1f @ yes: block them for next task
339316

340317
ldr r2, =concan_owner
@@ -344,10 +321,8 @@ ENTRY(iwmmxt_task_switch)
344321
retne lr @ no: leave Concan disabled
345322

346323
1: @ flip Concan access
347-
XSC(eor r1, r1, #0x3)
348-
XSC(mcr p15, 0, r1, c15, c1, 0)
349-
PJ4(eor r1, r1, #0xf)
350-
PJ4(mcr p15, 0, r1, c1, c0, 2)
324+
eor r1, r1, #0x3
325+
mcr p15, 0, r1, c15, c1, 0
351326

352327
mrc p15, 0, r1, c2, c0, 0
353328
sub pc, lr, r1, lsr #32 @ cpwait and return

arch/arm/kernel/pj4-cp0.c

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)