x86/idle: Sanitize X86_BUG_AMD_E400 handling
authorThomas Gleixner <tglx@linutronix.de>
Wed, 28 Feb 2024 22:13:00 +0000 (23:13 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 4 Mar 2024 16:38:06 +0000 (17:38 +0100)
commitcb81deefb59de01325ab822f900c13941bfaf67f
tree9f20489c94cdd3270937b41dd0f974952d1eb471
parent2be2a197ff6c3a659ab9285e1d88cbdc609ac6de
x86/idle: Sanitize X86_BUG_AMD_E400 handling

amd_e400_idle(), the idle routine for AMD CPUs which are affected by
erratum 400 violates the RCU constraints by invoking tick_broadcast_enter()
and tick_broadcast_exit() after the core code has marked RCU non-idle.  The
functions can end up in lockdep or tracing, which rightfully triggers a
RCU warning.

The core code provides now a static branch conditional invocation of the
broadcast functions.

Remove amd_e400_idle(), enforce default_idle() and enable the static branch
on affected CPUs to cure this.

  [ bp: Fold in a fix for a IS_ENABLED() check fail missing a "CONFIG_"
    prefix which tglx spotted. ]

Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/877cim6sis.ffs@tglx
arch/x86/Kconfig
arch/x86/kernel/process.c