summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuo Ren <guoren@linux.alibaba.com>2020-05-24 10:44:38 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-17 16:40:21 +0200
commit108681048cf728a8570e036c34ebd7daa43133b4 (patch)
tree433789d25d0978cdbfc5294d3ccc25df8fd2f975 /arch
parent16d902821bb7c3c248bb079ae3493c5c2cba98e6 (diff)
downloadlinux-stable-108681048cf728a8570e036c34ebd7daa43133b4.tar.gz
linux-stable-108681048cf728a8570e036c34ebd7daa43133b4.tar.bz2
linux-stable-108681048cf728a8570e036c34ebd7daa43133b4.zip
csky: Fixup abiv2 syscall_trace break a4 & a5
[ Upstream commit e0bbb53843b5fdfe464b099217e3b9d97e8a75d7 ] Current implementation could destory a4 & a5 when strace, so we need to get them from pt_regs by SAVE_ALL. Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/csky/abiv2/inc/abi/entry.h2
-rw-r--r--arch/csky/kernel/entry.S6
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/csky/abiv2/inc/abi/entry.h b/arch/csky/abiv2/inc/abi/entry.h
index 9023828ede97..ac8f65a3e75a 100644
--- a/arch/csky/abiv2/inc/abi/entry.h
+++ b/arch/csky/abiv2/inc/abi/entry.h
@@ -13,6 +13,8 @@
#define LSAVE_A1 28
#define LSAVE_A2 32
#define LSAVE_A3 36
+#define LSAVE_A4 40
+#define LSAVE_A5 44
#define KSPTOUSP
#define USPTOKSP
diff --git a/arch/csky/kernel/entry.S b/arch/csky/kernel/entry.S
index 65c55f22532a..4349528fbf38 100644
--- a/arch/csky/kernel/entry.S
+++ b/arch/csky/kernel/entry.S
@@ -170,8 +170,10 @@ csky_syscall_trace:
ldw a3, (sp, LSAVE_A3)
#if defined(__CSKYABIV2__)
subi sp, 8
- stw r5, (sp, 0x4)
- stw r4, (sp, 0x0)
+ ldw r9, (sp, LSAVE_A4)
+ stw r9, (sp, 0x0)
+ ldw r9, (sp, LSAVE_A5)
+ stw r9, (sp, 0x4)
#else
ldw r6, (sp, LSAVE_A4)
ldw r7, (sp, LSAVE_A5)