diff options
author | James Morse <james.morse@arm.com> | 2023-02-15 10:58:05 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-01-31 16:29:17 +0000 |
commit | 9f4cf0a313913847d90f37e05be157630afa3052 (patch) | |
tree | 7102f0aee3ff51927fe82ce4d9254600f7e4070d /drivers/acpi/acpi_processor.c | |
parent | f54786e7421919ad8e227a85c82f5f987c96923e (diff) |
ACPI: Add _OSC bits to advertise OS support for toggling CPU present/enabledaarch64/hotplug-vcpu/head
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>
Tested-by: Miguel Luis <miguel.luis@oracle.com>
Tested-by: Vishnu Pajjuri <vishnu@os.amperecomputing.com>
Tested-by: Jianyong Wu <jianyong.wu@arm.com>
---
I'm assuming Loongarch machines do not support physical CPU hotplug.
Changes since RFC v3:
* Drop ia64 changes
* Update James' comment below "---" to remove reference to ia64
Outstanding commentis:
https://lore.kernel.org/r/20230914175021.000018fd@Huawei.com
https://lore.kernel.org/r/20231215171227.00006550@Huawei.com
Also see:
https://bugzilla.tianocore.org/show_bug.cgi?id=4481
Diffstat (limited to 'drivers/acpi/acpi_processor.c')
-rw-r--r-- | drivers/acpi/acpi_processor.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 7a928777ad1a..72046a4d1d33 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -182,6 +182,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) { @@ -189,7 +201,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; } |