History

Merge tag 'x86_entry_for_v5.11_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fix from Borislav Petkov: "A single fix for objtool to generate proper unwind info for newer toolchains which do not generate section symbols anymore. And a cleanup ontop. This was originally going to go during the next merge window but people can already trigger a build error with binutils-2.36 which doesn't emit section symbols - something which objtool relies on - so let's expedite it" * tag 'x86_entry_for_v5.11_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/entry: Remove put_ret_addr_in_rdi THUNK macro argument x86/entry: Emit a symbol for register restoring thunk

Linus Torvalds committed 5 years ago

Commit f5a376e2 parents 17b756d 0bab9cb3 files · +15 −10Browse files

Unified · Split

3 files
  1. Documentation/asm-annotations.rst +5 −0
  2. arch/x86/entry/thunk_64.S +5 −10
  3. include/linux/linkage.h +5 −0
Documentation/asm-annotations.rst+5−0
@@ -100,6 +100,11 @@ Instruction Macros · 99 unmodified lines
100~~~~~~~~~~~~~~~~~~100~~~~~~~~~~~~~~~~~~
101This section covers ``SYM_FUNC_*`` and ``SYM_CODE_*`` enumerated above.101This section covers ``SYM_FUNC_*`` and ``SYM_CODE_*`` enumerated above.
102 102
103``objtool`` requires that all code must be contained in an ELF symbol. Symbol
104names that have a ``.L`` prefix do not emit symbol table entries. ``.L``
105prefixed symbols can be used within a code region, but should be avoided for
106denoting a range of code via ``SYM_*_START/END`` annotations.
107
103* ``SYM_FUNC_START`` and ``SYM_FUNC_START_LOCAL`` are supposed to be **the108* ``SYM_FUNC_START`` and ``SYM_FUNC_START_LOCAL`` are supposed to be **the
104 most frequent markings**. They are used for functions with standard calling109 most frequent markings**. They are used for functions with standard calling
105 conventions -- global and local. Like in C, they both align the functions to110 conventions -- global and local. Like in C, they both align the functions to
arch/x86/entry/thunk_64.S+5−10
@@ -10,7 +10,7 @@ · 9 unmodified lines
10#include <asm/export.h>10#include <asm/export.h>
11 11
12 /* rdi: arg1 ... normal C conventions. rax is saved/restored. */12 /* rdi: arg1 ... normal C conventions. rax is saved/restored. */
13 .macro THUNK name, func, put_ret_addr_in_rdi=013 .macro THUNK name, func
14SYM_FUNC_START_NOALIGN(\name)14SYM_FUNC_START_NOALIGN(\name)
15 pushq %rbp15 pushq %rbp
16 movq %rsp, %rbp16 movq %rsp, %rbp
@@ -25,13 +25,8 @@ SYM_FUNC_START_NOALIGN(\name) · 8 unmodified lines
25 pushq %r1025 pushq %r10
26 pushq %r1126 pushq %r11
27 27
28 .if \put_ret_addr_in_rdi
29 /* 8(%rbp) is return addr on stack */
30 movq 8(%rbp), %rdi
31 .endif
32
33 call \func28 call \func
34 jmp .L_restore29 jmp __thunk_restore
35SYM_FUNC_END(\name)30SYM_FUNC_END(\name)
36 _ASM_NOKPROBE(\name)31 _ASM_NOKPROBE(\name)
37 .endm32 .endm
@@ -44,7 +39,7 @@ SYM_FUNC_END(\name) · 6 unmodified lines
44#endif39#endif
45 40
46#ifdef CONFIG_PREEMPTION41#ifdef CONFIG_PREEMPTION
47SYM_CODE_START_LOCAL_NOALIGN(.L_restore)42SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore)
48 popq %r1143 popq %r11
49 popq %r1044 popq %r10
50 popq %r945 popq %r9
@@ -56,6 +51,6 @@ SYM_CODE_START_LOCAL_NOALIGN(.L_restore) · 5 unmodified lines
56 popq %rdi51 popq %rdi
57 popq %rbp52 popq %rbp
58 ret53 ret
59 _ASM_NOKPROBE(.L_restore)54 _ASM_NOKPROBE(__thunk_restore)
60SYM_CODE_END(.L_restore)55SYM_CODE_END(__thunk_restore)
61#endif56#endif
include/linux/linkage.h+5−0
@@ -178,6 +178,11 @@ · 177 unmodified lines
178 * Objtool generates debug info for both FUNC & CODE, but needs special178 * Objtool generates debug info for both FUNC & CODE, but needs special
179 * annotations for each CODE's start (to describe the actual stack frame).179 * annotations for each CODE's start (to describe the actual stack frame).
180 *180 *
181 * Objtool requires that all code must be contained in an ELF symbol. Symbol
182 * names that have a .L prefix do not emit symbol table entries. .L
183 * prefixed symbols can be used within a code region, but should be avoided for
184 * denoting a range of code via ``SYM_*_START/END`` annotations.
185 *
181 * ALIAS -- does not generate debug info -- the aliased function will186 * ALIAS -- does not generate debug info -- the aliased function will
182 */187 */
183 188