diff options
author | James Hogan <jhogan@kernel.org> | 2018-02-02 09:36:40 -0500 |
---|---|---|
committer | James Hogan <jhogan@kernel.org> | 2018-02-05 06:53:06 -0500 |
commit | 8dbc1864b74f5dea5a3f7c30ca8fd358a675132f (patch) | |
tree | 7152f79577384a9a8b8df118b8da3e608503957d | |
parent | d8a5b80568a9cb66810e75b182018e9edb68e8ff (diff) |
MIPS: CPS: Fix MIPS_ISA_LEVEL_RAW fallout
Commit 17278a91e04f ("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: 17278a91e04f ("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
Cc: <stable@vger.kernel.org> # 4.15
Tested-by: Greg Ungerer <gerg@linux-m68k.org>
Patchwork: https://patchwork.linux-mips.org/patch/18578/
-rw-r--r-- | arch/mips/kernel/cps-vec.S | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S index e68e6e04063a..1025f937ab0e 100644 --- a/arch/mips/kernel/cps-vec.S +++ b/arch/mips/kernel/cps-vec.S | |||
@@ -388,15 +388,16 @@ LEAF(mips_cps_boot_vpes) | |||
388 | 388 | ||
389 | #elif defined(CONFIG_MIPS_MT) | 389 | #elif defined(CONFIG_MIPS_MT) |
390 | 390 | ||
391 | .set push | ||
392 | .set MIPS_ISA_LEVEL_RAW | ||
393 | .set mt | ||
394 | |||
395 | /* If the core doesn't support MT then return */ | 391 | /* If the core doesn't support MT then return */ |
396 | has_mt t0, 5f | 392 | has_mt t0, 5f |
397 | 393 | ||
398 | /* Enter VPE configuration state */ | 394 | /* Enter VPE configuration state */ |
395 | .set push | ||
396 | .set MIPS_ISA_LEVEL_RAW | ||
397 | .set mt | ||
399 | dvpe | 398 | dvpe |
399 | .set pop | ||
400 | |||
400 | PTR_LA t1, 1f | 401 | PTR_LA t1, 1f |
401 | jr.hb t1 | 402 | jr.hb t1 |
402 | nop | 403 | nop |
@@ -422,6 +423,10 @@ LEAF(mips_cps_boot_vpes) | |||
422 | mtc0 t0, CP0_VPECONTROL | 423 | mtc0 t0, CP0_VPECONTROL |
423 | ehb | 424 | ehb |
424 | 425 | ||
426 | .set push | ||
427 | .set MIPS_ISA_LEVEL_RAW | ||
428 | .set mt | ||
429 | |||
425 | /* Skip the VPE if its TC is not halted */ | 430 | /* Skip the VPE if its TC is not halted */ |
426 | mftc0 t0, CP0_TCHALT | 431 | mftc0 t0, CP0_TCHALT |
427 | beqz t0, 2f | 432 | beqz t0, 2f |
@@ -495,6 +500,8 @@ LEAF(mips_cps_boot_vpes) | |||
495 | ehb | 500 | ehb |
496 | evpe | 501 | evpe |
497 | 502 | ||
503 | .set pop | ||
504 | |||
498 | /* Check whether this VPE is meant to be running */ | 505 | /* Check whether this VPE is meant to be running */ |
499 | li t0, 1 | 506 | li t0, 1 |
500 | sll t0, t0, a1 | 507 | sll t0, t0, a1 |
@@ -509,7 +516,7 @@ LEAF(mips_cps_boot_vpes) | |||
509 | 1: jr.hb t0 | 516 | 1: jr.hb t0 |
510 | nop | 517 | nop |
511 | 518 | ||
512 | 2: .set pop | 519 | 2: |
513 | 520 | ||
514 | #endif /* CONFIG_MIPS_MT_SMP */ | 521 | #endif /* CONFIG_MIPS_MT_SMP */ |
515 | 522 | ||