From: Peter Zijlstra Date: Tue, 7 May 2019 21:25:50 +0000 (+0200) Subject: x86/stackframe, x86/ftrace: Add pt_regs frame annotations X-Git-Tag: v4.19.104~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cdef3b47a404cb913efb192f280673da6f6e227;p=platform%2Fkernel%2Flinux-rpi.git x86/stackframe, x86/ftrace: Add pt_regs frame annotations commit ea1ed38dba64b64a245ab8ca1406269d17b99485 upstream. When CONFIG_FRAME_POINTER, we should mark pt_regs frames. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Signed-off-by: Ingo Molnar [4.19 backport; added user-visible changelog] Signed-off-by: Dmitry Safonov Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/kernel/ftrace_32.S b/arch/x86/kernel/ftrace_32.S index 4c8440d..83f18e8 100644 --- a/arch/x86/kernel/ftrace_32.S +++ b/arch/x86/kernel/ftrace_32.S @@ -9,6 +9,7 @@ #include #include #include +#include #ifdef CC_USING_FENTRY # define function_hook __fentry__ @@ -131,6 +132,8 @@ ENTRY(ftrace_regs_caller) pushl %ecx pushl %ebx + ENCODE_FRAME_POINTER + movl 12*4(%esp), %eax /* Load ip (1st parameter) */ subl $MCOUNT_INSN_SIZE, %eax /* Adjust ip */ #ifdef CC_USING_FENTRY diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S index 75f2b36..24b9abf 100644 --- a/arch/x86/kernel/ftrace_64.S +++ b/arch/x86/kernel/ftrace_64.S @@ -9,6 +9,7 @@ #include #include #include +#include .code64 .section .entry.text, "ax" @@ -222,6 +223,8 @@ GLOBAL(ftrace_regs_caller_op_ptr) leaq MCOUNT_REG_SIZE+8*2(%rsp), %rcx movq %rcx, RSP(%rsp) + ENCODE_FRAME_POINTER + /* regs go into 4th parameter */ leaq (%rsp), %rcx