aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2017-02-06 14:03:15 -0500
committerJames Hogan <james.hogan@imgtec.com>2017-02-13 13:57:33 -0500
commitf229454d34e000e714280e767811304e29d96bea (patch)
tree4ab87a724fecfc6e202e7f0ef083851ed6ceaa7c
parentf700a420088624671ed955bf818c17012bb57bca (diff)
MIPS: Fix protected_cache(e)_op() for microMIPS
When building for microMIPS we need to ensure that the assembler always knows that there is code at the target of a branch or jump. Commit 7170bdc77755 ("MIPS: Add return errors to protected cache ops") introduced a fixup path to protected_cache(e)_op() which does not meet this requirement. The fixup path jumps to the "2" label but the .section pseudo-op immediately following it causes the label to be marked as data. Linking then fails with: mips-img-linux-gnu-ld: arch/mips/mm/c-r4k.o: .fixup+0x0: Unsupported jump between ISA modes; consider recompiling with interlinking enabled. Fix this by declaring that "2" labels code using the .insn directive. Fixes: 7170bdc77755 ("MIPS: Add return errors to protected cache ops") Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: Maciej W. Rozycki <macro@imgtec.com> Cc: linux-mips@linux-mips.org Cc: Ralf Baechle <ralf@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/15274/ Signed-off-by: James Hogan <james.hogan@imgtec.com>
-rw-r--r--arch/mips/include/asm/r4kcache.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h
index 7227c158cbf8..55fd94e6cd0b 100644
--- a/arch/mips/include/asm/r4kcache.h
+++ b/arch/mips/include/asm/r4kcache.h
@@ -154,7 +154,8 @@ static inline void flush_scache_line(unsigned long addr)
154 " .set noreorder \n" \ 154 " .set noreorder \n" \
155 " .set "MIPS_ISA_ARCH_LEVEL" \n" \ 155 " .set "MIPS_ISA_ARCH_LEVEL" \n" \
156 "1: cache %1, (%2) \n" \ 156 "1: cache %1, (%2) \n" \
157 "2: .set pop \n" \ 157 "2: .insn \n" \
158 " .set pop \n" \
158 " .section .fixup,\"ax\" \n" \ 159 " .section .fixup,\"ax\" \n" \
159 "3: li %0, %3 \n" \ 160 "3: li %0, %3 \n" \
160 " j 2b \n" \ 161 " j 2b \n" \
@@ -177,7 +178,8 @@ static inline void flush_scache_line(unsigned long addr)
177 " .set mips0 \n" \ 178 " .set mips0 \n" \
178 " .set eva \n" \ 179 " .set eva \n" \
179 "1: cachee %1, (%2) \n" \ 180 "1: cachee %1, (%2) \n" \
180 "2: .set pop \n" \ 181 "2: .insn \n" \
182 " .set pop \n" \
181 " .section .fixup,\"ax\" \n" \ 183 " .section .fixup,\"ax\" \n" \
182 "3: li %0, %3 \n" \ 184 "3: li %0, %3 \n" \
183 " j 2b \n" \ 185 " j 2b \n" \