summaryrefslogtreecommitdiff
path: root/arch/mips/kernel/asm-offsets.c
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2024-03-28 17:27:56 +0300
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2024-04-09 17:52:21 +0300
commit4370b673ccf240bf7587b0cb8e6726a5ccaf1f17 (patch)
tree6ab8e687a241058982a5bf5e49af8d8e90b38906 /arch/mips/kernel/asm-offsets.c
parent4cece764965020c22cff7665b18a012006359095 (diff)
downloadlinux-4370b673ccf240bf7587b0cb8e6726a5ccaf1f17.tar.xz
MIPS: scall: Save thread_info.syscall unconditionally on entry
thread_info.syscall is used by syscall_get_nr to supply syscall nr over a thread stack frame. Previously, thread_info.syscall is only saved at syscall_trace_enter when syscall tracing is enabled. However rest of the kernel code do expect syscall_get_nr to be available without syscall tracing. The previous design breaks collect_syscall. Move saving process to syscall entry to fix it. Reported-by: Xi Ruoyao <xry111@xry111.site> Link: https://github.com/util-linux/util-linux/issues/2867 Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/kernel/asm-offsets.c')
-rw-r--r--arch/mips/kernel/asm-offsets.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index d1b11f66f748..cb1045ebab06 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -101,6 +101,7 @@ void output_thread_info_defines(void)
OFFSET(TI_CPU, thread_info, cpu);
OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
OFFSET(TI_REGS, thread_info, regs);
+ OFFSET(TI_SYSCALL, thread_info, syscall);
DEFINE(_THREAD_SIZE, THREAD_SIZE);
DEFINE(_THREAD_MASK, THREAD_MASK);
DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE);