History

x86/topology: Disable CPU online/offline control for TDX guests

Unlike regular VMs, TDX guests use the firmware hand-off wakeup method to wake up the APs during the boot process. This wakeup model uses a mailbox to communicate with firmware to bring up the APs. As per the design, this mailbox can only be used once for the given AP, which means after the APs are booted, the same mailbox cannot be used to offline/online the given AP. More details about this requirement can be found in Intel TDX Virtual Firmware Design Guide, sec titled "AP initialization in OS" and in sec titled "Hotplug Device". Since the architecture does not support any method of offlining the CPUs, disable CPU hotplug support in the kernel. Since this hotplug disable feature can be re-used by other VM guests, add a new CC attribute CC_ATTR_HOTPLUG_DISABLED and use it to disable the hotplug support. Attempt to offline CPU will fail with -EOPNOTSUPP.

Kuppuswamy Sathyanarayanan committed 4 years ago

Commit bae1a961 parent 77a512e3 files · +18 −0Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/cc_platform.h+10−0
@@ -72,6 +72,16 @@ enum cc_attr { · 71 unmodified lines
7272 * Examples include TDX guest & SEV.
7373 */
7474 CC_ATTR_GUEST_UNROLL_STRING_IO,
75+
76+ /**
77+ * @CC_ATTR_HOTPLUG_DISABLED: Hotplug is not supported or disabled.
78+ *
79+ * The platform/OS is running as a guest/virtual machine does not
80+ * support CPU hotplug feature.
81+ *
82+ * Examples include TDX Guest.
83+ */
84+ CC_ATTR_HOTPLUG_DISABLED,
7585 };
7686
7787 #ifdef CONFIG_ARCH_HAS_CC_PLATFORM