Skip to content

Commit

Permalink
MIPS: CPS: Fix MIPS_ISA_LEVEL_RAW fallout
Browse files Browse the repository at this point in the history
commit 8dbc186 upstream.

Commit 17278a9 ("MIPS: CPS: Fix r1 .set mt assembler warning")
added .set MIPS_ISA_LEVEL_RAW to silence warnings about .set mt on r1,
however this can result in a MOVE being encoded as a 64-bit DADDU
instruction on certain version of binutils (e.g. 2.22), and reserved
instruction exceptions at runtime on 32-bit hardware.

Reduce the sizes of the push/pop sections to include only instructions
that are part of the MT ASE or which won't convert to 64-bit
instructions after .set mips64r2/mips64r6.

Reported-by: Greg Ungerer <gerg@linux-m68k.org>
Fixes: 17278a9 ("MIPS: CPS: Fix r1 .set mt assembler warning")
Signed-off-by: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@linux-mips.org
Tested-by: Greg Ungerer <gerg@linux-m68k.org>
Patchwork: https://patchwork.linux-mips.org/patch/18578/
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
James Hogan authored and Ben Hutchings committed Mar 3, 2018
1 parent b11db6e commit 9645511
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions arch/mips/kernel/cps-vec.S
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,13 @@ LEAF(mips_cps_boot_vpes)
jr ra
nop

1: /* Enter VPE configuration state */
.set push
.set MIPS_ISA_LEVEL_RAW
.set mt

1: /* Enter VPE configuration state */
dvpe
.set pop

la t1, 1f
jr.hb t1
nop
Expand All @@ -379,6 +380,10 @@ LEAF(mips_cps_boot_vpes)
mtc0 t0, CP0_VPECONTROL
ehb

.set push
.set MIPS_ISA_LEVEL_RAW
.set mt

/* Skip the VPE if its TC is not halted */
mftc0 t0, CP0_TCHALT
beqz t0, 2f
Expand Down Expand Up @@ -437,6 +442,8 @@ LEAF(mips_cps_boot_vpes)
ehb
evpe

.set pop

/* Check whether this VPE is meant to be running */
li t0, 1
sll t0, t0, t9
Expand All @@ -451,7 +458,7 @@ LEAF(mips_cps_boot_vpes)
1: jr.hb t0
nop

2: .set pop
2:

#endif /* CONFIG_MIPS_MT_SMP */

Expand Down

0 comments on commit 9645511

Please sign in to comment.