Commit 6f612579 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull objtool updates from Ingo Molar:
 "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"

* tag 'objtool-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (42 commits)
  x86/orc: Make the is_callthunk() definition depend on CONFIG_BPF_JIT=y
  objtool: Skip reading DWARF section data
  objtool: Free insns when done
  objtool: Get rid of reloc->rel[a]
  objtool: Shrink elf hash nodes
  objtool: Shrink reloc->sym_reloc_entry
  objtool: Get rid of reloc->jump_table_start
  objtool: Get rid of reloc->addend
  objtool: Get rid of reloc->type
  objtool: Get rid of reloc->offset
  objtool: Get rid of reloc->idx
  objtool: Get rid of reloc->list
  objtool: Allocate relocs in advance for new rela sections
  objtool: Add for_each_reloc()
  objtool: Don't free memory in elf_close()
  objtool: Keep GElf_Rel[a] structs synced
  objtool: Add elf_create_section_pair()
  objtool: Add mark_sec_changed()
  objtool: Fix reloc_hash size
  objtool: Consolidate rel/rela handling
  ...
parents 4d675181 301cf77e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -6598,6 +6598,12 @@
	unknown_nmi_panic
			[X86] Cause panic on unknown NMI.

	unwind_debug	[X86-64]
			Enable unwinder debug output.  This can be
			useful for debugging certain unwinder error
			conditions, including corrupt stacks and
			bad/missing unwinder metadata.

	usbcore.authorized_default=
			[USB] Default USB device authorization:
			(default -1 = authorized except for wireless USB,
+1 −0
Original line number Diff line number Diff line
@@ -1605,6 +1605,7 @@ static void add_cpu_to_masks(int cpu)
}

/* Activate a secondary processor. */
__no_stack_protector
void start_secondary(void *unused)
{
	unsigned int cpu = raw_smp_processor_id();
+8 −12
Original line number Diff line number Diff line
@@ -26,17 +26,7 @@ SYM_FUNC_START(\name)
	pushq %r11

	call \func
	jmp  __thunk_restore
SYM_FUNC_END(\name)
	_ASM_NOKPROBE(\name)
	.endm

	THUNK preempt_schedule_thunk, preempt_schedule
	THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
	EXPORT_SYMBOL(preempt_schedule_thunk)
	EXPORT_SYMBOL(preempt_schedule_notrace_thunk)

SYM_CODE_START_LOCAL(__thunk_restore)
	popq %r11
	popq %r10
	popq %r9
@@ -48,5 +38,11 @@ SYM_CODE_START_LOCAL(__thunk_restore)
	popq %rdi
	popq %rbp
	RET
	_ASM_NOKPROBE(__thunk_restore)
SYM_CODE_END(__thunk_restore)
SYM_FUNC_END(\name)
	_ASM_NOKPROBE(\name)
	.endm

THUNK preempt_schedule_thunk, preempt_schedule
THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
EXPORT_SYMBOL(preempt_schedule_thunk)
EXPORT_SYMBOL(preempt_schedule_notrace_thunk)
+0 −5
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ extern void callthunks_patch_builtin_calls(void);
extern void callthunks_patch_module_calls(struct callthunk_sites *sites,
					  struct module *mod);
extern void *callthunks_translate_call_dest(void *dest);
extern bool is_callthunk(void *addr);
extern int x86_call_depth_emit_accounting(u8 **pprog, void *func);
#else
static __always_inline void callthunks_patch_builtin_calls(void) {}
@@ -124,10 +123,6 @@ static __always_inline void *callthunks_translate_call_dest(void *dest)
{
	return dest;
}
static __always_inline bool is_callthunk(void *addr)
{
	return false;
}
static __always_inline int x86_call_depth_emit_accounting(u8 **pprog,
							  void *func)
{
+9 −0
Original line number Diff line number Diff line
@@ -76,9 +76,18 @@

#else

#define UNWIND_HINT_UNDEFINED \
	UNWIND_HINT(UNWIND_HINT_TYPE_UNDEFINED, 0, 0, 0)

#define UNWIND_HINT_FUNC \
	UNWIND_HINT(UNWIND_HINT_TYPE_FUNC, ORC_REG_SP, 8, 0)

#define UNWIND_HINT_SAVE \
	UNWIND_HINT(UNWIND_HINT_TYPE_SAVE, 0, 0, 0)

#define UNWIND_HINT_RESTORE \
	UNWIND_HINT(UNWIND_HINT_TYPE_RESTORE, 0, 0, 0)

#endif /* __ASSEMBLY__ */

#endif /* _ASM_X86_UNWIND_HINTS_H */
Loading