[3.16.y-ckt stable] Patch "MIPS: asm: asmmacro: Replace "add" instructions with "addu"" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Mar 2 13:37:54 UTC 2015


This is a note to let you know that I have just added a patch titled

    MIPS: asm: asmmacro: Replace "add" instructions with "addu"

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt8.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 7d7301e2d4207fa13b6b839d69ceae0cfb2c0e97 Mon Sep 17 00:00:00 2001
From: Markos Chandras <markos.chandras at imgtec.com>
Date: Wed, 5 Nov 2014 14:17:52 +0000
Subject: MIPS: asm: asmmacro: Replace "add" instructions with "addu"

commit 98a833c1fa4de0695830f77b2d13fd86693da298 upstream.

The "add" instruction is actually a macro in binutils and depending on
the size of the immediate it can expand to an "addi" instruction.
However, the "addi" instruction traps on overflows which is not
something we want on address calculation.

Link: http://www.linux-mips.org/archives/linux-mips/2015-01/msg00121.html
Cc: Paul Burton <paul.burton at imgtec.com>
Cc: Maciej W. Rozycki <macro at linux-mips.org>
Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 arch/mips/include/asm/asmmacro.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h
index 935543f14538..9dbc454ad14e 100644
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -293,7 +293,7 @@
 	.macro	ld_d	wd, off, base
 	.set	push
 	.set	noat
-	add	$1, \base, \off
+	addu	$1, \base, \off
 	.word	LDD_MSA_INSN | (\wd << 6)
 	.set	pop
 	.endm
@@ -301,7 +301,7 @@
 	.macro	st_d	wd, off, base
 	.set	push
 	.set	noat
-	add	$1, \base, \off
+	addu	$1, \base, \off
 	.word	STD_MSA_INSN | (\wd << 6)
 	.set	pop
 	.endm




More information about the kernel-team mailing list