x86/cpu: Make sure play_dead() doesn't return
authorJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 14 Feb 2023 07:05:51 +0000 (23:05 -0800)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 8 Mar 2023 16:44:26 +0000 (08:44 -0800)
After commit 076cbf5d2163 ("x86/xen: don't let xen_pv_play_dead()
return"), play_dead() never returns.  Make that more explicit with a
BUG().

BUG() is preferable to unreachable() because BUG() is a more explicit
failure mode and avoids undefined behavior like falling off the edge of
the function into whatever code happens to be next.

Link: https://lore.kernel.org/r/11e6ac1cf10f92967882926e3ac16287b50642f2.1676358308.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
arch/x86/include/asm/smp.h

index b4dbb20dab1a11d509b4f702f4bde6a6269b4d18..8f628e08b25ac8241394e3e7a34377891b414f5b 100644 (file)
@@ -96,6 +96,7 @@ static inline void __cpu_die(unsigned int cpu)
 static inline void play_dead(void)
 {
        smp_ops.play_dead();
+       BUG();
 }
 
 static inline void smp_send_reschedule(int cpu)