[GIT PULL] objtool changes for v6.5

Ingo Molnar
2023-06-27T11:21:06Z

Linus,

Please pull the latest objtool/core git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git objtool-core-2023-06-27

# HEAD: 301cf77e21317b3465c5e2bb0188df24bbf1c2e2 x86/orc: Make the is_callthunk() definition depend on CONFIG_BPF_JIT=y

objtool changes for v6.5:

- Build footprint & performance improvements:

- Reduce memory usage with CONFIG_DEBUG_INFO=y

In the worst case of an allyesconfig+CONFIG_DEBUG_INFO=y kernel, DWARF
creates almost 200 million relocations, ballooning objtool's peak heap
usage to 53GB. These patches reduce that to 25GB.

On a distro-type kernel with kernel IBT enabled, they reduce objtool's
peak heap usage from 4.2GB to 2.8GB.

These changes also improve the runtime significantly.

- Debuggability improvements:

- Add the unwind_debug command-line option, for more extend unwinding
debugging output.
- Limit unreachable warnings to once per function
- Add verbose option for disassembling affected functions
- Include backtrace in verbose mode
- Detect missing __noreturn annotations
- Ignore exc_double_fault() __noreturn warnings
- Remove superfluous global_noreturns entries
- Move noreturn function list to separate file
- Add __kunit_abort() to noreturns

- Unwinder improvements:

- Allow stack operations in UNWIND_HINT_UNDEFINED regions
- drm/vmwgfx: Add unwind hints around RBP clobber

- Cleanups:

- Move the x86 entry thunk restore code into thunk functions
- x86/unwind/orc: Use swap() instead of open coding it
- Remove unnecessary/unused variables

- Fixes for modern stack canary handling

Thanks,

Ingo

------------------>
Ingo Molnar (1):
x86/orc: Make the is_callthunk() definition depend on CONFIG_BPF_JIT=y

Jiapeng Chong (1):
x86/unwind/orc: Use swap() instead of open coding it

Josh Poimboeuf (36):
x86/unwind/orc: Add 'unwind_debug' cmdline option
objtool: Limit unreachable warnings to once per function
objtool: Add verbose option for disassembling affected functions
objtool: Include backtrace in verbose mode
objtool: Detect missing __noreturn annotations
objtool: Ignore exc_double_fault() __noreturn warnings
objtool: Remove superfluous global_noreturns entries
tools/lib/subcmd: Replace NORETURN usage with __noreturn
objtool: Move noreturn function list to separate file
objtool: Add __kunit_abort() to noreturns
Revert "x86/orc: Make it callthunk aware"
x86/entry: Move thunk restore code into thunk functions
objtool: Allow stack operations in UNWIND_HINT_UNDEFINED regions
drm/vmwgfx: Add unwind hints around RBP clobber
objtool: Tidy elf.h
objtool: Remove flags argument from elf_create_section()
objtool: Improve reloc naming
objtool: Consolidate rel/rela handling
objtool: Fix reloc_hash size
objtool: Add mark_sec_changed()
objtool: Add elf_create_section_pair()
objtool: Keep GElf_Rel[a] structs synced
objtool: Don't free memory in elf_close()
objtool: Add for_each_reloc()
objtool: Allocate relocs in advance for new rela sections
objtool: Get rid of reloc->list
objtool: Get rid of reloc->idx
objtool: Get rid of reloc->offset
objtool: Get rid of reloc->type
objtool: Get rid of reloc->addend
objtool: Get rid of reloc->jump_table_start
objtool: Shrink reloc->sym_reloc_entry
objtool: Shrink elf hash nodes
objtool: Get rid of reloc->rel[a]
objtool: Free insns when done
objtool: Skip reading DWARF section data

Lu Hongfei (1):
tools: Remove unnecessary variables

Peter Zijlstra (1):
lkdtm: Avoid objtool/ibt warning

ndesaulniers@google.com (2):
start_kernel: Add __no_stack_protector function attribute
start_kernel: Omit prevent_tail_call_optimization() for newer toolchains

Documentation/admin-guide/kernel-parameters.txt | 6 +
arch/powerpc/kernel/smp.c | 1 +
arch/x86/entry/thunk_64.S | 20 +-
arch/x86/include/asm/alternative.h | 5 -
arch/x86/include/asm/unwind_hints.h | 9 +
arch/x86/kernel/callthunks.c | 4 +-
arch/x86/kernel/unwind_orc.c | 75 ++-
drivers/gpu/drm/vmwgfx/vmwgfx_msg_x86.h | 16 +-
drivers/misc/lkdtm/bugs.c | 1 +
include/linux/compiler_attributes.h | 12 +
init/main.c | 9 +-
tools/lib/subcmd/parse-options.h | 8 +-
tools/lib/subcmd/subcmd-util.h | 5 +-
tools/objtool/Documentation/objtool.txt | 10 +
tools/objtool/arch/powerpc/include/arch/elf.h | 11 +-
tools/objtool/arch/x86/decode.c | 6 +-
tools/objtool/arch/x86/include/arch/elf.h | 11 +-
tools/objtool/arch/x86/special.c | 6 +-
tools/objtool/builtin-check.c | 5 +
tools/objtool/check.c | 643 ++++++++++++++----------
tools/objtool/elf.c | 537 ++++++++------------
tools/objtool/include/objtool/builtin.h | 1 +
tools/objtool/include/objtool/cfi.h | 1 +
tools/objtool/include/objtool/elf.h | 327 ++++++++----
tools/objtool/include/objtool/warn.h | 21 +-
tools/objtool/noreturns.h | 46 ++
tools/objtool/orc_gen.c | 8 +-
tools/objtool/special.c | 4 +-
28 files changed, 1038 insertions(+), 770 deletions(-)
create mode 100644 tools/objtool/noreturns.h