]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
csky: Fixup abiv2 syscall_trace break a4 & a5
authorGuo Ren <guoren@linux.alibaba.com>
Sun, 24 May 2020 10:44:38 +0000 (10:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jun 2020 14:41:50 +0000 (16:41 +0200)
[ 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>
arch/csky/abiv2/inc/abi/entry.h
arch/csky/kernel/entry.S

index 9023828ede97a8a5fe5ba084fcd43b5f0365cf62..ac8f65a3e75a207766bc01ff6ab76422f4d09006 100644 (file)
@@ -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
index 9718388448a4b7c523014256cb168f4ffa101cc8..ff908d28f0a070e5799ffe0da810d8cd821328e9 100644 (file)
@@ -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)