OSDN Git Service

x86/stackframe/32: Provide consistent pt_regs
authorPeter Zijlstra <peterz@infradead.org>
Tue, 7 May 2019 21:25:54 +0000 (23:25 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Jun 2019 08:23:47 +0000 (10:23 +0200)
commit3c88c692c28746473791276f8b42d2c989d6cbe6
tree51cb03ef4cbb611f42ea43c8737be894991b656b
parentea1ed38dba64b64a245ab8ca1406269d17b99485
x86/stackframe/32: Provide consistent pt_regs

Currently pt_regs on x86_32 has an oddity in that kernel regs
(!user_mode(regs)) are short two entries (esp/ss). This means that any
code trying to use them (typically: regs->sp) needs to jump through
some unfortunate hoops.

Change the entry code to fix this up and create a full pt_regs frame.

This then simplifies various trampolines in ftrace and kprobes, the
stack unwinder, ptrace, kdump and kgdb.

Much thanks to Josh for help with the cleanups!

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
15 files changed:
arch/x86/entry/entry_32.S
arch/x86/include/asm/kexec.h
arch/x86/include/asm/ptrace.h
arch/x86/include/asm/stacktrace.h
arch/x86/kernel/crash.c
arch/x86/kernel/ftrace_32.S
arch/x86/kernel/kgdb.c
arch/x86/kernel/kprobes/common.h
arch/x86/kernel/kprobes/core.c
arch/x86/kernel/kprobes/opt.c
arch/x86/kernel/process_32.c
arch/x86/kernel/ptrace.c
arch/x86/kernel/time.c
arch/x86/kernel/unwind_frame.c
arch/x86/kernel/unwind_orc.c