Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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) <peterz@infradead.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>

authored by

Peter Zijlstra and committed by
Ingo Molnar
faeedb06 3c88c692

-9
-2
arch/x86/include/asm/text-patching.h
··· 51 51 #define INT3_INSN_SIZE 1 52 52 #define CALL_INSN_SIZE 5 53 53 54 - #ifdef CONFIG_X86_64 55 54 static inline void int3_emulate_push(struct pt_regs *regs, unsigned long val) 56 55 { 57 56 /* ··· 68 69 int3_emulate_push(regs, regs->ip - INT3_INSN_SIZE + CALL_INSN_SIZE); 69 70 int3_emulate_jmp(regs, func); 70 71 } 71 - #endif /* CONFIG_X86_64 */ 72 72 #endif /* !CONFIG_UML_X86 */ 73 73 74 74 #endif /* _ASM_X86_TEXT_PATCHING_H */
-7
arch/x86/kernel/ftrace.c
··· 300 300 301 301 ip = regs->ip - INT3_INSN_SIZE; 302 302 303 - #ifdef CONFIG_X86_64 304 303 if (ftrace_location(ip)) { 305 304 int3_emulate_call(regs, (unsigned long)ftrace_regs_caller); 306 305 return 1; ··· 311 312 int3_emulate_call(regs, ftrace_update_func_call); 312 313 return 1; 313 314 } 314 - #else 315 - if (ftrace_location(ip) || is_ftrace_caller(ip)) { 316 - int3_emulate_jmp(regs, ip + CALL_INSN_SIZE); 317 - return 1; 318 - } 319 - #endif 320 315 321 316 return 0; 322 317 }