Skip to content

Commit 9d08738

Browse files
jic23ctmarinas
authored andcommitted
arm64: Kconfig: Enable hotplug CPU on arm64 if ACPI_PROCESSOR is enabled.
In order to move arch_register_cpu() to be called via the same path for initially present CPUs described by ACPI and hotplugged CPUs ACPI_HOTPLUG_CPU needs to be enabled. The protection against invalid IDs in acpi_map_cpu() is needed as at least one production BIOS is in the wild which reports entries in DSDT (with no _STA method, so assumed enabled and present) that don't match MADT. Tested-by: Miguel Luis <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent eba4675 commit 9d08738

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config ARM64
55
select ACPI_CCA_REQUIRED if ACPI
66
select ACPI_GENERIC_GSI if ACPI
77
select ACPI_GTDT if ACPI
8+
select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR
89
select ACPI_IORT if ACPI
910
select ACPI_REDUCED_HARDWARE_ONLY if ACPI
1011
select ACPI_MCFG if (ACPI && PCI)

arch/arm64/kernel/acpi.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/pgtable.h>
3131

3232
#include <acpi/ghes.h>
33+
#include <acpi/processor.h>
3334
#include <asm/cputype.h>
3435
#include <asm/cpu_ops.h>
3536
#include <asm/daifflags.h>
@@ -423,6 +424,27 @@ void arch_reserve_mem_area(acpi_physical_address addr, size_t size)
423424
memblock_mark_nomap(addr, size);
424425
}
425426

427+
#ifdef CONFIG_ACPI_HOTPLUG_CPU
428+
int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 apci_id,
429+
int *pcpu)
430+
{
431+
/* If an error code is passed in this stub can't fix it */
432+
if (*pcpu < 0) {
433+
pr_warn_once("Unable to map CPU to valid ID\n");
434+
return *pcpu;
435+
}
436+
437+
return 0;
438+
}
439+
EXPORT_SYMBOL(acpi_map_cpu);
440+
441+
int acpi_unmap_cpu(int cpu)
442+
{
443+
return 0;
444+
}
445+
EXPORT_SYMBOL(acpi_unmap_cpu);
446+
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
447+
426448
#ifdef CONFIG_ACPI_FFH
427449
/*
428450
* Implements ARM64 specific callbacks to support ACPI FFH Operation Region as

0 commit comments

Comments
 (0)