lkml.org 
[lkml]   [2023]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 17/24] x86/cpu: Make sure play_dead() doesn't return
    Date
    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.

    Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
    ---
    arch/x86/include/asm/smp.h | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
    index b4dbb20dab1a..8f628e08b25a 100644
    --- a/arch/x86/include/asm/smp.h
    +++ b/arch/x86/include/asm/smp.h
    @@ -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)
    --
    2.39.1
    \
     
     \ /
      Last update: 2023-03-27 00:21    [W:2.138 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site