Skip to content

objtool: vmlinux.o and CLANG LTO support

Josh Poimboeuf lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 10 repliesIn review
  2. v121 patches 30 repliesSuperseded

Changes in v2 from the cover letter

- fix commit description for why xen hypervisor page contents don't matter [Juergen]
- annotate indirect jumps as safe instead of converting them to retpolines [Andrew, Juergen]
- drop patch 1 - fake jumps no longer exist
- add acks

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20objtool: Fix error handling for STD/CLD warningstools/objtool/check.c+6 -20 replies
2/20objtool: Fix retpoline detection in asm codetools/objtool/arch/x86/special.c tools/objtool/check.c tools/objtool/include/objtool/check.h+14 -20 replies
3/20objtool: Fix ".cold" section suffix check for newer versions of GCCtools/objtool/check.c+2 -20 replies
4/20objtool: Support retpoline jump detection for vmlinux.otools/objtool/check.c+4 -40 replies
5/20x86/ftrace: Add UNWIND_HINT_FUNC annotation for ftrace_stubarch/x86/kernel/ftrace_64.S+1 -00 replies
6/20objtool: Assume only ELF functions do sibling callstools/objtool/check.c+22 -140 replies
7/20objtool: Add asm version of STACK_FRAME_NON_STANDARDinclude/linux/objtool.h tools/include/linux/objtool.h+16 -00 replies
8/20objtool: Combine UNWIND_HINT_RET_OFFSET and UNWIND_HINT_FUNCarch/x86/include/asm/unwind_hints.h arch/x86/kernel/ftrace_64.S arch/x86/lib/retpoline.S +5 more+29 -400 replies
9/20objtool: Add xen_start_kernel() to noreturn listtools/objtool/check.c+1 -00 replies
10/20objtool: Move unsuffixed symbol conversion to a helper functiontools/objtool/elf.c+37 -230 replies
11/20objtool: Add CONFIG_CFI_CLANG supporttools/objtool/elf.c tools/objtool/include/objtool/elf.h+29 -10 replies
12/20x86/xen: Support objtool validation in xen-asm.Sarch/x86/xen/Makefile arch/x86/xen/xen-asm.S+19 -110 replies
13/20x86/xen: Support objtool vmlinux.o validation in xen-head.Sarch/x86/xen/xen-head.S+3 -20 replies
14/20x86/xen/pvh: Annotate indirect branch as safearch/x86/platform/pvh/head.S+2 -01 reply
15/20x86/ftrace: Support objtool vmlinux.o validation in ftrace_64.Sarch/x86/kernel/ftrace_64.S+2 -30 replies
16/20x86/acpi: Annotate indirect branch as safearch/x86/kernel/acpi/wakeup_64.S+2 -00 replies
17/20x86/acpi: Support objtool validation in wakeup_64.Sarch/x86/kernel/acpi/Makefile arch/x86/kernel/acpi/wakeup_64.S+2 -10 replies
18/20x86/power: Annotate indirect branches as safearch/x86/power/hibernate_asm_64.S+3 -00 replies
19/20x86/power: Move restore_registers() to top of the filearch/x86/power/hibernate_asm_64.S+46 -460 replies
20/20x86/power: Support objtool validation in hibernate_asm_64.Sarch/x86/power/Makefile arch/x86/power/hibernate_asm_64.S+4 -50 replies

Reviews trailers per patch

5 of 20 patches have a Reviewed-by or Acked-by.

PatchBoris OstrovskySteven Rostedt (VMware)Juergen Gross
1/20
2/20
3/20
4/20
5/20A-b
6/20
7/20
8/20
9/20
10/20
11/20
12/20R-b
13/20R-b
14/20R-b
15/20A-b
16/20
17/20
18/20
19/20
20/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/20] objtool: vmlinux.o and CLANG LTO support

v2:
- fix commit description for why xen hypervisor page contents don't matter [Juergen]
- annotate indirect jumps as safe instead of converting them to retpolines [Andrew, Juergen]
- drop patch 1 - fake jumps no longer exist
- add acks

Based on tip/objtool/core.

Add support for proper vmlinux.o validation, which will be needed for Sami's upcoming x86 LTO set. (And vmlinux validation is the future for objtool anyway, for other reasons.)

This isn't 100% done -- most notably, crypto still needs to be supported -- but I think this gets us most of the way there.

This can also be found at

git://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git objtool-vmlinux

And for more testing it can be combined with Sami's x86 LTO patches:

https://github.com/samitolvanen/linux clang-lto

Josh Poimboeuf (20):
objtool: Fix error handling for STD/CLD warnings
objtool: Fix retpoline detection in asm code
objtool: Fix ".cold" section suffix check for newer versions of GCC
objtool: Support retpoline jump detection for vmlinux.o x86/ftrace: Add UNWIND_HINT_FUNC annotation for ftrace_stub
objtool: Assume only ELF functions do sibling calls
objtool: Add asm version of STACK_FRAME_NON_STANDARD
objtool: Combine UNWIND_HINT_RET_OFFSET and UNWIND_HINT_FUNC
objtool: Add xen_start_kernel() to noreturn list
objtool: Move unsuffixed symbol conversion to a helper function
objtool: Add CONFIG_CFI_CLANG support
x86/xen: Support objtool validation in xen-asm.S x86/xen: Support objtool vmlinux.o validation in xen-head.S x86/xen/pvh: Annotate indirect branch as safe x86/ftrace: Support objtool vmlinux.o validation in ftrace_64.S x86/acpi: Annotate indirect branch as safe
x86/acpi: Support objtool validation in wakeup_64.S x86/power: Annotate indirect branches as safe
x86/power: Move restore_registers() to top of the file x86/power: Support objtool validation in hibernate_asm_64.S

 arch/x86/include/asm/unwind_hints.h   |  13 +---
 arch/x86/kernel/acpi/Makefile         |   1 -
 arch/x86/kernel/acpi/wakeup_64.S      |   4 +
 arch/x86/kernel/ftrace_64.S           |   8 +-
 arch/x86/lib/retpoline.S              |   2 +-
 arch/x86/platform/pvh/head.S          |   2 +
 arch/x86/power/Makefile               |   1 -
 arch/x86/power/hibernate_asm_64.S     | 103 +++++++++++++-------------
 arch/x86/xen/Makefile                 |   1 -
 arch/x86/xen/xen-asm.S                |  29 +++++---
 arch/x86/xen/xen-head.S               |   5 +-
 include/linux/objtool.h               |  13 +++-
 tools/include/linux/objtool.h         |  13 +++-
 tools/objtool/arch/x86/decode.c       |   4 +-
 tools/objtool/arch/x86/special.c      |   2 +-
 tools/objtool/check.c                 |  89 ++++++++++++----------
 tools/objtool/elf.c                   |  88 ++++++++++++++++------
 tools/objtool/include/objtool/check.h |  12 ++-
 tools/objtool/include/objtool/elf.h   |   2 +-
 19 files changed, 240 insertions(+), 152 deletions(-)
Signature · 1 line
2.29.2