x86/smpboot: Fix the parallel bringup decision
authorThomas Gleixner <tglx@linutronix.de>
Wed, 31 May 2023 07:44:26 +0000 (09:44 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 31 May 2023 14:49:34 +0000 (16:49 +0200)
commitff3cfcb0d46adc541283a507560f88b7d7114dbe
tree9c43e3980fd9024613e93cb8bf6cef13aa4ce430
parent33e20b07bec4991c169e3c6ff28c2126583724fc
x86/smpboot: Fix the parallel bringup decision

The decision to allow parallel bringup of secondary CPUs checks
CC_ATTR_GUEST_STATE_ENCRYPT to detect encrypted guests. Those cannot use
parallel bootup because accessing the local APIC is intercepted and raises
a #VC or #VE, which cannot be handled at that point.

The check works correctly, but only for AMD encrypted guests. TDX does not
set that flag.

As there is no real connection between CC attributes and the inability to
support parallel bringup, replace this with a generic control flag in
x86_cpuinit and let SEV-ES and TDX init code disable it.

Fixes: 0c7ffa32dbd6 ("x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it")
Reported-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Link: https://lore.kernel.org/r/87ilc9gd2d.ffs@tglx
arch/x86/coco/tdx/tdx.c
arch/x86/include/asm/x86_init.h
arch/x86/kernel/smpboot.c
arch/x86/kernel/x86_init.c
arch/x86/mm/mem_encrypt_amd.c