Skip to content

Commit ea1ed38

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
x86/stackframe, x86/ftrace: Add pt_regs frame annotations
When CONFIG_FRAME_POINTER, we should mark pt_regs frames. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 4201311 commit ea1ed38

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

arch/x86/kernel/ftrace_32.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <asm/export.h>
1010
#include <asm/ftrace.h>
1111
#include <asm/nospec-branch.h>
12+
#include <asm/frame.h>
1213

1314
# define function_hook __fentry__
1415
EXPORT_SYMBOL(__fentry__)
@@ -116,6 +117,8 @@ ENTRY(ftrace_regs_caller)
116117
pushl %ecx
117118
pushl %ebx
118119

120+
ENCODE_FRAME_POINTER
121+
119122
movl 12*4(%esp), %eax /* Load ip (1st parameter) */
120123
subl $MCOUNT_INSN_SIZE, %eax /* Adjust ip */
121124
movl 15*4(%esp), %edx /* Load parent ip (2nd parameter) */

arch/x86/kernel/ftrace_64.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <asm/export.h>
1010
#include <asm/nospec-branch.h>
1111
#include <asm/unwind_hints.h>
12+
#include <asm/frame.h>
1213

1314
.code64
1415
.section .entry.text, "ax"
@@ -203,6 +204,8 @@ GLOBAL(ftrace_regs_caller_op_ptr)
203204
leaq MCOUNT_REG_SIZE+8*2(%rsp), %rcx
204205
movq %rcx, RSP(%rsp)
205206

207+
ENCODE_FRAME_POINTER
208+
206209
/* regs go into 4th parameter */
207210
leaq (%rsp), %rcx
208211

0 commit comments

Comments
 (0)