Thread (4 messages) flat view 4 messages, 2 authors, 2021-02-03
STALE2062d

[PATCH] MIPS: fix kernel_stack_pointer()

From: Huang Pei <hidden>
Date: 2021-01-29 04:59:10
Also in: linux-mips, linux-mm
Subsystem: mips, ptrace support, the rest · Maintainers: Thomas Bogendoerfer, Oleg Nesterov, Linus Torvalds

MIPS always save kernel stack pointer in regs[29]

Signed-off-by: Huang Pei <redacted>
---
 arch/mips/include/asm/ptrace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index 1e76774b36dd..daf3cf244ea9 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -53,7 +53,7 @@ struct pt_regs {
 
 static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
 {
-	return regs->regs[31];
+	return regs->regs[29];
 }
 
 static inline void instruction_pointer_set(struct pt_regs *regs,
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help