Skip to content

Commit faeedb0

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
x86/stackframe/32: Allow int3_emulate_push()
Now that x86_32 has an unconditional gap on the kernel stack frame, the int3_emulate_push() thing will work without further changes. Signed-off-by: Peter Zijlstra (Intel) <[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 3c88c69 commit faeedb0

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

arch/x86/include/asm/text-patching.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static inline void int3_emulate_jmp(struct pt_regs *regs, unsigned long ip)
5151
#define INT3_INSN_SIZE 1
5252
#define CALL_INSN_SIZE 5
5353

54-
#ifdef CONFIG_X86_64
5554
static inline void int3_emulate_push(struct pt_regs *regs, unsigned long val)
5655
{
5756
/*
@@ -69,7 +68,6 @@ static inline void int3_emulate_call(struct pt_regs *regs, unsigned long func)
6968
int3_emulate_push(regs, regs->ip - INT3_INSN_SIZE + CALL_INSN_SIZE);
7069
int3_emulate_jmp(regs, func);
7170
}
72-
#endif /* CONFIG_X86_64 */
7371
#endif /* !CONFIG_UML_X86 */
7472

7573
#endif /* _ASM_X86_TEXT_PATCHING_H */

arch/x86/kernel/ftrace.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ int ftrace_int3_handler(struct pt_regs *regs)
300300

301301
ip = regs->ip - INT3_INSN_SIZE;
302302

303-
#ifdef CONFIG_X86_64
304303
if (ftrace_location(ip)) {
305304
int3_emulate_call(regs, (unsigned long)ftrace_regs_caller);
306305
return 1;
@@ -312,12 +311,6 @@ int ftrace_int3_handler(struct pt_regs *regs)
312311
int3_emulate_call(regs, ftrace_update_func_call);
313312
return 1;
314313
}
315-
#else
316-
if (ftrace_location(ip) || is_ftrace_caller(ip)) {
317-
int3_emulate_jmp(regs, ip + CALL_INSN_SIZE);
318-
return 1;
319-
}
320-
#endif
321314

322315
return 0;
323316
}

0 commit comments

Comments
 (0)