Commit 2aff7c70 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull objtool updates from Ingo Molnar:

 - Mark arch_cpu_idle_dead() __noreturn, make all architectures &
   drivers that did this inconsistently follow this new, common
   convention, and fix all the fallout that objtool can now detect
   statically

 - Fix/improve the ORC unwinder becoming unreliable due to
   UNWIND_HINT_EMPTY ambiguity, split it into UNWIND_HINT_END_OF_STACK
   and UNWIND_HINT_UNDEFINED to resolve it

 - Fix noinstr violations in the KCSAN code and the lkdtm/stackleak code

 - Generate ORC data for __pfx code

 - Add more __noreturn annotations to various kernel startup/shutdown
   and panic functions

 - Misc improvements & fixes

* tag 'objtool-core-2023-04-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits)
  x86/hyperv: Mark hv_ghcb_terminate() as noreturn
  scsi: message: fusion: Mark mpt_halt_firmware() __noreturn
  x86/cpu: Mark {hlt,resume}_play_dead() __noreturn
  btrfs: Mark btrfs_assertfail() __noreturn
  objtool: Include weak functions in global_noreturns check
  cpu: Mark nmi_panic_self_stop() __noreturn
  cpu: Mark panic_smp_self_stop() __noreturn
  arm64/cpu: Mark cpu_park_loop() and friends __noreturn
  x86/head: Mark *_start_kernel() __noreturn
  init: Mark start_kernel() __noreturn
  init: Mark [arch_call_]rest_init() __noreturn
  objtool: Generate ORC data for __pfx code
  x86/linkage: Fix padding for typed functions
  objtool: Separate prefix code from stack validation code
  objtool: Remove superfluous dead_end_function() check
  objtool: Add symbol iteration helpers
  objtool: Add WARN_INSN()
  scripts/objdump-func: Support multiple functions
  context_tracking: Fix KCSAN noinstr violation
  objtool: Add stackleak instrumentation to uaccess safe list
  ...
parents 22b8cc3e 611d4c71
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ trampoline or return trampoline. For example, considering the x86_64
.. code-block:: none

   SYM_CODE_START(return_to_handler)
           UNWIND_HINT_EMPTY
           UNWIND_HINT_UNDEFINED
           subq  $24, %rsp

           /* Save the return values */
+1 −1
Original line number Diff line number Diff line
@@ -15180,8 +15180,8 @@ OBJTOOL
M:	Josh Poimboeuf <jpoimboe@kernel.org>
M:	Peter Zijlstra <peterz@infradead.org>
S:	Supported
F:	include/linux/objtool*.h
F:	tools/objtool/
F:	include/linux/objtool.h
OCELOT ETHERNET SWITCH DRIVER
M:	Vladimir Oltean <vladimir.oltean@nxp.com>
+3 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
 * This file handles the architecture-dependent parts of process handling.
 */

#include <linux/cpu.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/sched.h>
@@ -59,9 +60,10 @@ void arch_cpu_idle(void)
	wtint(0);
}

void arch_cpu_idle_dead(void)
void __noreturn arch_cpu_idle_dead(void)
{
	wtint(INT_MAX);
	BUG();
}
#endif /* ALPHA_WTINT */

+4 −2
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ void __cpu_die(unsigned int cpu)
 * of the other hotplug-cpu capable cores, so presumably coming
 * out of idle fixes this.
 */
void arch_cpu_idle_dead(void)
void __noreturn arch_cpu_idle_dead(void)
{
	unsigned int cpu = smp_processor_id();

@@ -382,6 +382,8 @@ void arch_cpu_idle_dead(void)
		: "r" (task_stack_page(current) + THREAD_SIZE - 8),
		  "r" (current)
		: "r0");

	unreachable();
}
#endif /* CONFIG_HOTPLUG_CPU */

@@ -777,7 +779,7 @@ void smp_send_stop(void)
 * kdump fails. So split out the panic_smp_self_stop() and add
 * set_cpu_online(smp_processor_id(), false).
 */
void panic_smp_self_stop(void)
void __noreturn panic_smp_self_stop(void)
{
	pr_debug("CPU %u will stop doing anything useful since another CPU has paniced\n",
	         smp_processor_id());
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ static inline unsigned long disr_to_esr(u64 disr)
	return esr;
}

asmlinkage void handle_bad_stack(struct pt_regs *regs);
asmlinkage void __noreturn handle_bad_stack(struct pt_regs *regs);

asmlinkage void el1t_64_sync_handler(struct pt_regs *regs);
asmlinkage void el1t_64_irq_handler(struct pt_regs *regs);
@@ -80,5 +80,5 @@ void do_el1_fpac(struct pt_regs *regs, unsigned long esr);
void do_serror(struct pt_regs *regs, unsigned long esr);
void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags);

void panic_bad_stack(struct pt_regs *regs, unsigned long esr, unsigned long far);
void __noreturn panic_bad_stack(struct pt_regs *regs, unsigned long esr, unsigned long far);
#endif	/* __ASM_EXCEPTION_H */
Loading