049efb92e33c62fe24e527a36b9a2a37d385d15c
[openwrt.git] / target / linux / ramips / patches-4.3 / 0055-MIPS-CPS-drop-.set-mips64r2-directives.patch
1 From patchwork Wed Aug  5 22:42:40 2015
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 Subject: [6/6] MIPS: CPS: drop .set mips64r2 directives
6 From: Paul Burton <paul.burton@imgtec.com>
7 X-Patchwork-Id: 10869
8 Message-Id: <1438814560-19821-7-git-send-email-paul.burton@imgtec.com>
9 To: <linux-mips@linux-mips.org>
10 Cc: Paul Burton <paul.burton@imgtec.com>,
11  Markos Chandras <markos.chandras@imgtec.com>,
12  <stable@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
13  James Hogan <james.hogan@imgtec.com>, "Ralf Baechle" <ralf@linux-mips.org>
14 Date: Wed, 5 Aug 2015 15:42:40 -0700
15
16 Commit 977e043d5ea1 ("MIPS: kernel: cps-vec: Replace mips32r2 ISA level
17 with mips64r2") leads to .set mips64r2 directives being present in 32
18 bit (ie. CONFIG_32BIT=y) kernels. This is incorrect & leads to MIPS64
19 instructions being emitted by the assembler when expanding
20 pseudo-instructions. For example the "move" instruction can legitimately
21 be expanded to a "daddu". This causes problems when the kernel is run on
22 a MIPS32 CPU, as CONFIG_32BIT kernels of course often are...
23
24 Fix this by dropping the .set <ISA> directives entirely now that Kconfig
25 should be ensuring that kernels including this code are built with a
26 suitable -march= compiler flag.
27
28 Signed-off-by: Paul Burton <paul.burton@imgtec.com>
29 Cc: Markos Chandras <markos.chandras@imgtec.com>
30 Cc: <stable@vger.kernel.org> # 3.16+
31 ---
32
33  arch/mips/kernel/cps-vec.S | 2 --
34  1 file changed, 2 deletions(-)
35
36 --- a/arch/mips/kernel/cps-vec.S
37 +++ b/arch/mips/kernel/cps-vec.S
38 @@ -229,7 +229,6 @@ LEAF(mips_cps_core_init)
39         has_mt  t0, 3f
40  
41         .set    push
42 -       .set    mips64r2
43         .set    mt
44  
45         /* Only allow 1 TC per VPE to execute... */
46 @@ -348,7 +347,6 @@ LEAF(mips_cps_boot_vpes)
47          nop
48  
49         .set    push
50 -       .set    mips64r2
51         .set    mt
52  
53  1:     /* Enter VPE configuration state */