Commit 59ffbf43 authored by Leonid Yegoshin's avatar Leonid Yegoshin Committed by Kamal Mostafa

MIPS64: R6: R2 emulation bugfix

commit 41fa29e4 upstream.

Error recovery pointers for fixups was improperly set as ".word"
which is unsuitable for MIPS64.

Replaced by STR(PTR)

[ralf@linux-mips.org: Apply changes as requested in the review process.]
Signed-off-by: default avatarLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
Reviewed-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
Fixes: b0a668fb ("MIPS: kernel: mips-r2-to-r6-emul: Add R2 emulator for MIPS R6")
Cc: macro@linux-mips.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9911/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 886419c7
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <asm/inst.h> #include <asm/inst.h>
#include <asm/mips-r2-to-r6-emul.h> #include <asm/mips-r2-to-r6-emul.h>
#include <asm/local.h> #include <asm/local.h>
#include <asm/mipsregs.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -1250,10 +1251,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1250,10 +1251,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
" j 10b\n" " j 10b\n"
" .previous\n" " .previous\n"
" .section __ex_table,\"a\"\n" " .section __ex_table,\"a\"\n"
" .word 1b,8b\n" STR(PTR) " 1b,8b\n"
" .word 2b,8b\n" STR(PTR) " 2b,8b\n"
" .word 3b,8b\n" STR(PTR) " 3b,8b\n"
" .word 4b,8b\n" STR(PTR) " 4b,8b\n"
" .previous\n" " .previous\n"
" .set pop\n" " .set pop\n"
: "+&r"(rt), "=&r"(rs), : "+&r"(rt), "=&r"(rs),
...@@ -1325,10 +1326,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1325,10 +1326,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
" j 10b\n" " j 10b\n"
" .previous\n" " .previous\n"
" .section __ex_table,\"a\"\n" " .section __ex_table,\"a\"\n"
" .word 1b,8b\n" STR(PTR) " 1b,8b\n"
" .word 2b,8b\n" STR(PTR) " 2b,8b\n"
" .word 3b,8b\n" STR(PTR) " 3b,8b\n"
" .word 4b,8b\n" STR(PTR) " 4b,8b\n"
" .previous\n" " .previous\n"
" .set pop\n" " .set pop\n"
: "+&r"(rt), "=&r"(rs), : "+&r"(rt), "=&r"(rs),
...@@ -1396,10 +1397,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1396,10 +1397,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
" j 9b\n" " j 9b\n"
" .previous\n" " .previous\n"
" .section __ex_table,\"a\"\n" " .section __ex_table,\"a\"\n"
" .word 1b,8b\n" STR(PTR) " 1b,8b\n"
" .word 2b,8b\n" STR(PTR) " 2b,8b\n"
" .word 3b,8b\n" STR(PTR) " 3b,8b\n"
" .word 4b,8b\n" STR(PTR) " 4b,8b\n"
" .previous\n" " .previous\n"
" .set pop\n" " .set pop\n"
: "+&r"(rt), "=&r"(rs), : "+&r"(rt), "=&r"(rs),
...@@ -1466,10 +1467,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1466,10 +1467,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
" j 9b\n" " j 9b\n"
" .previous\n" " .previous\n"
" .section __ex_table,\"a\"\n" " .section __ex_table,\"a\"\n"
" .word 1b,8b\n" STR(PTR) " 1b,8b\n"
" .word 2b,8b\n" STR(PTR) " 2b,8b\n"
" .word 3b,8b\n" STR(PTR) " 3b,8b\n"
" .word 4b,8b\n" STR(PTR) " 4b,8b\n"
" .previous\n" " .previous\n"
" .set pop\n" " .set pop\n"
: "+&r"(rt), "=&r"(rs), : "+&r"(rt), "=&r"(rs),
...@@ -1581,14 +1582,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1581,14 +1582,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
" j 9b\n" " j 9b\n"
" .previous\n" " .previous\n"
" .section __ex_table,\"a\"\n" " .section __ex_table,\"a\"\n"
" .word 1b,8b\n" STR(PTR) " 1b,8b\n"
" .word 2b,8b\n" STR(PTR) " 2b,8b\n"
" .word 3b,8b\n" STR(PTR) " 3b,8b\n"
" .word 4b,8b\n" STR(PTR) " 4b,8b\n"
" .word 5b,8b\n" STR(PTR) " 5b,8b\n"
" .word 6b,8b\n" STR(PTR) " 6b,8b\n"
" .word 7b,8b\n" STR(PTR) " 7b,8b\n"
" .word 0b,8b\n" STR(PTR) " 0b,8b\n"
" .previous\n" " .previous\n"
" .set pop\n" " .set pop\n"
: "+&r"(rt), "=&r"(rs), : "+&r"(rt), "=&r"(rs),
...@@ -1700,14 +1701,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1700,14 +1701,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
" j 9b\n" " j 9b\n"
" .previous\n" " .previous\n"
" .section __ex_table,\"a\"\n" " .section __ex_table,\"a\"\n"
" .word 1b,8b\n" STR(PTR) " 1b,8b\n"
" .word 2b,8b\n" STR(PTR) " 2b,8b\n"
" .word 3b,8b\n" STR(PTR) " 3b,8b\n"
" .word 4b,8b\n" STR(PTR) " 4b,8b\n"
" .word 5b,8b\n" STR(PTR) " 5b,8b\n"
" .word 6b,8b\n" STR(PTR) " 6b,8b\n"
" .word 7b,8b\n" STR(PTR) " 7b,8b\n"
" .word 0b,8b\n" STR(PTR) " 0b,8b\n"
" .previous\n" " .previous\n"
" .set pop\n" " .set pop\n"
: "+&r"(rt), "=&r"(rs), : "+&r"(rt), "=&r"(rs),
...@@ -1819,14 +1820,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1819,14 +1820,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
" j 9b\n" " j 9b\n"
" .previous\n" " .previous\n"
" .section __ex_table,\"a\"\n" " .section __ex_table,\"a\"\n"
" .word 1b,8b\n" STR(PTR) " 1b,8b\n"
" .word 2b,8b\n" STR(PTR) " 2b,8b\n"
" .word 3b,8b\n" STR(PTR) " 3b,8b\n"
" .word 4b,8b\n" STR(PTR) " 4b,8b\n"
" .word 5b,8b\n" STR(PTR) " 5b,8b\n"
" .word 6b,8b\n" STR(PTR) " 6b,8b\n"
" .word 7b,8b\n" STR(PTR) " 7b,8b\n"
" .word 0b,8b\n" STR(PTR) " 0b,8b\n"
" .previous\n" " .previous\n"
" .set pop\n" " .set pop\n"
: "+&r"(rt), "=&r"(rs), : "+&r"(rt), "=&r"(rs),
...@@ -1937,14 +1938,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1937,14 +1938,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
" j 9b\n" " j 9b\n"
" .previous\n" " .previous\n"
" .section __ex_table,\"a\"\n" " .section __ex_table,\"a\"\n"
" .word 1b,8b\n" STR(PTR) " 1b,8b\n"
" .word 2b,8b\n" STR(PTR) " 2b,8b\n"
" .word 3b,8b\n" STR(PTR) " 3b,8b\n"
" .word 4b,8b\n" STR(PTR) " 4b,8b\n"
" .word 5b,8b\n" STR(PTR) " 5b,8b\n"
" .word 6b,8b\n" STR(PTR) " 6b,8b\n"
" .word 7b,8b\n" STR(PTR) " 7b,8b\n"
" .word 0b,8b\n" STR(PTR) " 0b,8b\n"
" .previous\n" " .previous\n"
" .set pop\n" " .set pop\n"
: "+&r"(rt), "=&r"(rs), : "+&r"(rt), "=&r"(rs),
...@@ -1999,7 +2000,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -1999,7 +2000,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
"j 2b\n" "j 2b\n"
".previous\n" ".previous\n"
".section __ex_table,\"a\"\n" ".section __ex_table,\"a\"\n"
".word 1b, 3b\n" STR(PTR) " 1b,3b\n"
".previous\n" ".previous\n"
: "=&r"(res), "+&r"(err) : "=&r"(res), "+&r"(err)
: "r"(vaddr), "i"(SIGSEGV) : "r"(vaddr), "i"(SIGSEGV)
...@@ -2057,7 +2058,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -2057,7 +2058,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
"j 2b\n" "j 2b\n"
".previous\n" ".previous\n"
".section __ex_table,\"a\"\n" ".section __ex_table,\"a\"\n"
".word 1b, 3b\n" STR(PTR) " 1b,3b\n"
".previous\n" ".previous\n"
: "+&r"(res), "+&r"(err) : "+&r"(res), "+&r"(err)
: "r"(vaddr), "i"(SIGSEGV)); : "r"(vaddr), "i"(SIGSEGV));
...@@ -2118,7 +2119,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -2118,7 +2119,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
"j 2b\n" "j 2b\n"
".previous\n" ".previous\n"
".section __ex_table,\"a\"\n" ".section __ex_table,\"a\"\n"
".word 1b, 3b\n" STR(PTR) " 1b,3b\n"
".previous\n" ".previous\n"
: "=&r"(res), "+&r"(err) : "=&r"(res), "+&r"(err)
: "r"(vaddr), "i"(SIGSEGV) : "r"(vaddr), "i"(SIGSEGV)
...@@ -2181,7 +2182,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) ...@@ -2181,7 +2182,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
"j 2b\n" "j 2b\n"
".previous\n" ".previous\n"
".section __ex_table,\"a\"\n" ".section __ex_table,\"a\"\n"
".word 1b, 3b\n" STR(PTR) " 1b,3b\n"
".previous\n" ".previous\n"
: "+&r"(res), "+&r"(err) : "+&r"(res), "+&r"(err)
: "r"(vaddr), "i"(SIGSEGV)); : "r"(vaddr), "i"(SIGSEGV));
......
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