Skip to contentSkip to conversation

objtool changes for v6.5

GIT PULL New Ingo Molnar 2 participants 4 messages Jun 27, 2023 – Jun 28, 2023 objtool

lore
Share & tools
lore
#0 lore raw

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

[email protected] (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
#1 lore raw
Quoted 7 lines · Ingo Molnar

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

I forgot to mention that there's a new conflict when you merge this, in tools/objtool/check.c, plus a semantic conflict in the new tools/objtool/noreturns.h file - to remove the 'btrfs_assertfail' entry from the new tools/objtool/noreturns.h file.

Our -tip CI conflict resolution can be double checked here:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/merge

Thanks,

Ingo

#2 lore raw

PATCH 1/1 objtool: Remove btrfs_assertfail() from the noreturn exceptions list

Quoted 11 lines · Ingo Molnar
Quoted 7 lines · Ingo Molnar

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
Quoted 8 lines

I forgot to mention that there's a new conflict when you merge this, in tools/objtool/check.c, plus a semantic conflict in the new tools/objtool/noreturns.h file - to remove the 'btrfs_assertfail' entry from the new tools/objtool/noreturns.h file.

Our -tip CI conflict resolution can be double checked here:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/merge

I believe the (minor & silent) semantic conflict was overlooked in your upstream merge:

      6f612579be9d Merge tag 'objtool-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

I've fixed it up with the attached patch.

[ There was no harm done to build correctness or functionality AFAICS,
because the extra leftover entry in upstream tools/objtool/noreturns.h is now meaningless, as btrfs_assertfail() has become a macro that will not show up as an ELF symbol. ]

Thanks,

Ingo

======================>
From: Ingo Molnar <[email protected]>
Date: Wed, 28 Jun 2023 11:16:03 +0200
Subject: [PATCH] objtool: Remove btrfs_assertfail() from the noreturn
exceptions list

Upstream merge commit:

6f612579be9d Merge tag 'objtool-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

... generated a (minor) semantic conflict that was not resolved: the btrfs_assertfail() entry that was removed from the list in tools/objtool/check.c in:

b831306b3b7d ("btrfs: print assertion failure report and stack trace from the same line")

... because btrfs_assertfail() was changed from a noreturn function into a macro.

But the list was moved to a different file, in a different enumeration format:

6245ce4ab670 ("objtool: Move noreturn function list to separate file")

And has to be removed from tools/objtool/noreturns.h post-merge as well.

Do it explicitly.

Cc David Sterba <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/objtool/noreturns.h | 1 -
 1 file changed, 1 deletion(-)
tools/objtool/noreturns.h +0 -1
index 1514e84d5cc4..e45c7cb1d5bc 100644
@@ -14,7 +14,6 @@ NORETURN(__stack_chk_fail)
 NORETURN(__ubsan_handle_builtin_unreachable)
 NORETURN(arch_call_rest_init)
 NORETURN(arch_cpu_idle_dead)
-NORETURN(btrfs_assertfail)
 NORETURN(cpu_bringup_and_idle)
 NORETURN(cpu_startup_entry)
 NORETURN(do_exit)
merge bot Merged
#3 lore raw
In reply to Ingo Molnar
The pull request you sent on Tue, 27 Jun 2023 13:20:57 +0200:

The pull request you sent on Tue, 27 Jun 2023 13:20:57 +0200:

Quoted 1 line

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

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/6f612579be9d0ff527ca2e517e10bfaf08cc1860

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html