Files
Joe Lawrence 4ab6831574 sched/idle: Mark arch_cpu_idle_dead() __noreturn
JIRA: https://issues.redhat.com/browse/RHEL-114921

Conflicts:
	arch/loongarch/kernel/process.c
	arch/parisc/kernel/process.c
	arch/riscv/kernel/cpu-hotplug.c
	- Drop unsupported cs-9 arches
	tools/objtool/check.c
	- Diff context: cs-9 already has upstream 9ea7e6b62c2bd ("init:
	  Mark [arch_call_]rest_init() __noreturn") and 8ea554c379
	  ("x86/smp: Fix mwait_play_dead() and
	  acpi_processor_ffh_play_dead() noreturn behavior") which
	  introduced arch_call_rest_init and
	  acpi_processor_ffh_play_dead entries.

commit 071c44e4278156f18a6a56958617223b6bffa6ab
Author: Josh Poimboeuf <jpoimboe@kernel.org>
Date:   Mon Feb 13 23:05:58 2023 -0800

    sched/idle: Mark arch_cpu_idle_dead() __noreturn

    Before commit 076cbf5d2163 ("x86/xen: don't let xen_pv_play_dead()
    return"), in Xen, when a previously offlined CPU was brought back
    online, it unexpectedly resumed execution where it left off in the
    middle of the idle loop.

    There were some hacks to make that work, but the behavior was surprising
    as do_idle() doesn't expect an offlined CPU to return from the dead (in
    arch_cpu_idle_dead()).

    Now that Xen has been fixed, and the arch-specific implementations of
    arch_cpu_idle_dead() also don't return, give it a __noreturn attribute.

    This will cause the compiler to complain if an arch-specific
    implementation might return.  It also improves code generation for both
    caller and callee.

    Also fixes the following warning:

      vmlinux.o: warning: objtool: do_idle+0x25f: unreachable instruction

    Reported-by: Paul E. McKenney <paulmck@kernel.org>
    Tested-by: Paul E. McKenney <paulmck@kernel.org>
    Link: https://lore.kernel.org/r/60d527353da8c99d4cf13b6473131d46719ed16d.1676358308.git.jpoimboe@kernel.org
    Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2025-11-04 20:01:07 -05:00
..