From: Josh Poimboeuf Date: Wed, 21 Feb 2018 02:42:14 +0000 (-0600) Subject: x86/entry/64: Simplify ENCODE_FRAME_POINTER X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0ca7d5baa1787e5f2a7abd6bfca3303b1bbb48ac;p=linux.git x86/entry/64: Simplify ENCODE_FRAME_POINTER On 64-bit, the stack pointer is always aligned on interrupt, so instead of setting the LSB of the pt_regs address, we can just add 1 to it. Suggested-by: Linus Torvalds Signed-off-by: Josh Poimboeuf Cc: Andrew Lutomirski Cc: Brian Gerst Cc: Dan Williams Cc: Dominik Brodowski Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180221024214.lhl5jfgw33c4vz3m@treble Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h index 5d10b7a85cadd..be63330c55112 100644 --- a/arch/x86/entry/calling.h +++ b/arch/x86/entry/calling.h @@ -181,12 +181,7 @@ For 32-bit we have the following conventions - kernel is built with */ .macro ENCODE_FRAME_POINTER ptregs_offset=0 #ifdef CONFIG_FRAME_POINTER - .if \ptregs_offset - leaq \ptregs_offset(%rsp), %rbp - .else - mov %rsp, %rbp - .endif - orq $0x1, %rbp + leaq 1+\ptregs_offset(%rsp), %rbp #endif .endm