diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-12-22 02:24:59 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2016-01-04 06:12:10 -0500 |
commit | 5008efc83bf85b647aa1cbc44718b1675bbb7444 (patch) | |
tree | 728eb22528c2db224e9aec379df4fabec18dfd6a | |
parent | 36f46d6d5cdef2308027261d633e96807d64d098 (diff) |
ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode
The PJ4 inline asm sequence to write to cp15 cannot be built in Thumb-2
mode, due to the way it performs arithmetic on the program counter, so it
is built in ARM mode instead. However, building C files in ARM mode under
CONFIG_THUMB2_KERNEL is problematic, since the instrumentation performed
by subsystems like ftrace does not expect having to deal with interworking
branches.
Since the sequence in question is simply a poor man's ISB instruction,
let's use a straight 'isb' instead when building in Thumb2 mode. Thumb2
implies V7, so 'isb' should always be supported in that case.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/kernel/pj4-cp0.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index af9e59bf3831..3c789496297f 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -73,7 +73,6 @@ obj-$(CONFIG_IWMMXT) += iwmmxt.o | |||
73 | obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o | 73 | obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o |
74 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \ | 74 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \ |
75 | perf_event_v7.o | 75 | perf_event_v7.o |
76 | CFLAGS_pj4-cp0.o := -marm | ||
77 | AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt | 76 | AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt |
78 | obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o | 77 | obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o |
79 | obj-$(CONFIG_VDSO) += vdso.o | 78 | obj-$(CONFIG_VDSO) += vdso.o |
diff --git a/arch/arm/kernel/pj4-cp0.c b/arch/arm/kernel/pj4-cp0.c index 8153e36b2491..7c9248b74d3f 100644 --- a/arch/arm/kernel/pj4-cp0.c +++ b/arch/arm/kernel/pj4-cp0.c | |||
@@ -66,9 +66,13 @@ static void __init pj4_cp_access_write(u32 value) | |||
66 | 66 | ||
67 | __asm__ __volatile__ ( | 67 | __asm__ __volatile__ ( |
68 | "mcr p15, 0, %1, c1, c0, 2\n\t" | 68 | "mcr p15, 0, %1, c1, c0, 2\n\t" |
69 | #ifdef CONFIG_THUMB2_KERNEL | ||
70 | "isb\n\t" | ||
71 | #else | ||
69 | "mrc p15, 0, %0, c1, c0, 2\n\t" | 72 | "mrc p15, 0, %0, c1, c0, 2\n\t" |
70 | "mov %0, %0\n\t" | 73 | "mov %0, %0\n\t" |
71 | "sub pc, pc, #4\n\t" | 74 | "sub pc, pc, #4\n\t" |
75 | #endif | ||
72 | : "=r" (temp) : "r" (value)); | 76 | : "=r" (temp) : "r" (value)); |
73 | } | 77 | } |
74 | 78 | ||