Commit f229454d authored by Paul Burton's avatar Paul Burton Committed by James Hogan

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
7170bdc7 ("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: 7170bdc7 ("MIPS: Add return errors to protected cache ops")
Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
Reviewed-by: default avatarMaciej 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: default avatarJames Hogan <james.hogan@imgtec.com>
parent f700a420
...@@ -154,7 +154,8 @@ static inline void flush_scache_line(unsigned long addr) ...@@ -154,7 +154,8 @@ static inline void flush_scache_line(unsigned long addr)
" .set noreorder \n" \ " .set noreorder \n" \
" .set "MIPS_ISA_ARCH_LEVEL" \n" \ " .set "MIPS_ISA_ARCH_LEVEL" \n" \
"1: cache %1, (%2) \n" \ "1: cache %1, (%2) \n" \
"2: .set pop \n" \ "2: .insn \n" \
" .set pop \n" \
" .section .fixup,\"ax\" \n" \ " .section .fixup,\"ax\" \n" \
"3: li %0, %3 \n" \ "3: li %0, %3 \n" \
" j 2b \n" \ " j 2b \n" \
...@@ -177,7 +178,8 @@ static inline void flush_scache_line(unsigned long addr) ...@@ -177,7 +178,8 @@ static inline void flush_scache_line(unsigned long addr)
" .set mips0 \n" \ " .set mips0 \n" \
" .set eva \n" \ " .set eva \n" \
"1: cachee %1, (%2) \n" \ "1: cachee %1, (%2) \n" \
"2: .set pop \n" \ "2: .insn \n" \
" .set pop \n" \
" .section .fixup,\"ax\" \n" \ " .section .fixup,\"ax\" \n" \
"3: li %0, %3 \n" \ "3: li %0, %3 \n" \
" j 2b \n" \ " j 2b \n" \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment