]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPI: Move ACPI_HOTPLUG_CPU to be disabled on arm64 and riscv
authorJames Morse <james.morse@arm.com>
Tue, 21 Nov 2023 13:44:15 +0000 (13:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Dec 2023 03:41:48 +0000 (12:41 +0900)
Neither arm64 nor riscv support physical hotadd of CPUs that were not
present at boot. For arm64 much of the platform description is in static
tables which do not have update methods. arm64 does support HOTPLUG_CPU,
which is backed by a firmware interface to turn CPUs on and off.

acpi_processor_hotadd_init() and acpi_processor_remove() are for adding
and removing CPUs that were not present at boot. arm64 systems that do this
are not supported as there is currently insufficient information in the
platform description. (e.g. did the GICR get removed too?)

arm64 currently relies on the MADT enabled flag check in map_gicc_mpidr()
to prevent CPUs that were not described as present at boot from being
added to the system. Similarly, riscv relies on the same check in
map_rintc_hartid(). Both architectures also rely on the weak 'always fails'
definitions of acpi_map_cpu() and arch_register_cpu().

Subsequent changes will redefine ACPI_HOTPLUG_CPU as making possible
CPUs present. Neither arm64 nor riscv support this.

Disable ACPI_HOTPLUG_CPU for arm64 and riscv by removing 'default y' and
selecting it on the other three ACPI architectures. This allows the weak
definitions of some symbols to be removed.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/E1r5R31-00Csyt-Jq@rmk-PC.armlinux.org.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/Kconfig
arch/x86/Kconfig
drivers/acpi/Kconfig
drivers/acpi/acpi_processor.c

index ee123820a4760ad38296ecc3c94da8a06068b33c..331becb2cb4f736db7429c5a994a6f5d76d8dce1 100644 (file)
@@ -5,6 +5,7 @@ config LOONGARCH
        select ACPI
        select ACPI_GENERIC_GSI if ACPI
        select ACPI_MCFG if ACPI
+       select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU
        select ACPI_PPTT if ACPI
        select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
        select ARCH_BINFMT_ELF_STATE
index 3762f41bb092971e3f6180f057b49742014e5f11..dbdcfc708369a63a38c624517473260ccab88e09 100644 (file)
@@ -59,6 +59,7 @@ config X86
        #
        select ACPI_LEGACY_TABLES_LOOKUP        if ACPI
        select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
+       select ACPI_HOTPLUG_CPU                 if ACPI_PROCESSOR && HOTPLUG_CPU
        select ARCH_32BIT_OFF_T                 if X86_32
        select ARCH_CLOCKSOURCE_INIT
        select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
index f819e760ff195a902aba7e8fd5073c0dc4d67a4c..a3acfc750fce05a2543c1ce5765fbb56e385aeb5 100644 (file)
@@ -310,7 +310,6 @@ config ACPI_HOTPLUG_CPU
        bool
        depends on ACPI_PROCESSOR && HOTPLUG_CPU
        select ACPI_CONTAINER
-       default y
 
 config ACPI_PROCESSOR_AGGREGATOR
        tristate "Processor Aggregator"
index 0f5218e361df5c2d8e05d9a5e6d7fa205c1e6376..4fe2ef54088c65234ace0f111a0ffe93f40f8fb0 100644 (file)
@@ -184,24 +184,6 @@ static void __init acpi_pcc_cpufreq_init(void) {}
 
 /* Initialization */
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
-int __weak acpi_map_cpu(acpi_handle handle,
-               phys_cpuid_t physid, u32 acpi_id, int *pcpu)
-{
-       return -ENODEV;
-}
-
-int __weak acpi_unmap_cpu(int cpu)
-{
-       return -ENODEV;
-}
-
-int __weak arch_register_cpu(int cpu)
-{
-       return -ENODEV;
-}
-
-void __weak arch_unregister_cpu(int cpu) {}
-
 static int acpi_processor_hotadd_init(struct acpi_processor *pr)
 {
        unsigned long long sta;