summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpi_processor.c
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2023-02-15 10:58:05 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-08-29 15:30:10 +0100
commitb317b96c8eca88c80b4d7958cbf9b78cff9e846d (patch)
tree3f2fc488c8e7c9212df405127e65edd5c897996a /drivers/acpi/acpi_processor.c
parent377e6d9f9db43cced193d96569fe3482345e47b0 (diff)
ACPI: Add _OSC bits to advertise OS support for toggling CPU present/enabled
Platform firmware can disabled a CPU, or make it not-present by making an eject-request notification, then waiting for the os to make it offline and call _EJx. After the firmware updates _STA with the new status. Not all operating systems support this. For arm64 making CPUs not-present has never been supported. For all ACPI architectures, making CPUs disabled has recently been added. Firmware can't know what the OS has support for. Add two new _OSC bits to advertise whether the OS supports the _STA enabled or present bits being toggled for CPUs. This will be important for arm64 if systems that support physical CPU hotplug ever appear as arm64 linux doesn't currently support this, so firmware shouldn't try. Advertising this support to firmware is useful for cloud orchestrators to know whether they can scale a particular VM by adding CPUs. Signed-off-by: James Morse <james.morse@arm.com> --- I'm assuming ia64 with physical hotplug machines once existed, and that Loongarch machines with support for this don't. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/acpi/acpi_processor.c')
-rw-r--r--drivers/acpi/acpi_processor.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 39588159cde0..60d5fdb24128 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -177,6 +177,18 @@ static void __init acpi_pcc_cpufreq_init(void)
static void __init acpi_pcc_cpufreq_init(void) {}
#endif /* CONFIG_X86 */
+static bool acpi_processor_hotplug_present_supported(void)
+{
+ if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU))
+ return false;
+
+ /* x86 systems pre-date the _OSC bit */
+ if (IS_ENABLED(CONFIG_ACPI_HOTPLUG_IGNORE_OSC))
+ return true;
+
+ return osc_sb_hotplug_present_support_acked;
+}
+
/* Initialization */
static int acpi_processor_make_present(struct acpi_processor *pr)
{
@@ -184,7 +196,7 @@ static int acpi_processor_make_present(struct acpi_processor *pr)
acpi_status status;
int ret;
- if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU)) {
+ if (!acpi_processor_hotplug_present_supported()) {
pr_err_once("Changing CPU present bit is not supported\n");
return -ENODEV;
}