提交 0ca7d5ba 编写于 作者: J Josh Poimboeuf 提交者: Ingo Molnar

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: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
Cc: Andrew Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180221024214.lhl5jfgw33c4vz3m@trebleSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 9fbcc57a
...@@ -181,12 +181,7 @@ For 32-bit we have the following conventions - kernel is built with ...@@ -181,12 +181,7 @@ For 32-bit we have the following conventions - kernel is built with
*/ */
.macro ENCODE_FRAME_POINTER ptregs_offset=0 .macro ENCODE_FRAME_POINTER ptregs_offset=0
#ifdef CONFIG_FRAME_POINTER #ifdef CONFIG_FRAME_POINTER
.if \ptregs_offset leaq 1+\ptregs_offset(%rsp), %rbp
leaq \ptregs_offset(%rsp), %rbp
.else
mov %rsp, %rbp
.endif
orq $0x1, %rbp
#endif #endif
.endm .endm
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册