Commit 2eb3daf6 authored by James Morse's avatar James Morse Committed by liwei
Browse files

ACPI: Rename ACPI_HOTPLUG_CPU to include 'present'

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8XMTL


CVE: NA

---------------------------------

The code behind ACPI_HOTPLUG_CPU allows a not-present CPU to become
present. This isn't the only use of HOTPLUG_CPU. On arm64 and riscv
CPUs can be taken offline as a power saving measure.

On arm64 an offline CPU may be disabled by firmware, preventing it from
being brought back online, but it remains present throughout.

Adding code to prevent user-space trying to online these disabled CPUs
needs some additional terminology.

Rename the Kconfig symbol CONFIG_ACPI_HOTPLUG_PRESENT_CPU to reflect
that it makes possible CPUs present.

HOTPLUG_CPU is untouched as this is only about the ACPI mechanism.

Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Tested-by: default avatarMiguel Luis <miguel.luis@oracle.com>
Tested-by: default avatarVishnu Pajjuri <vishnu@os.amperecomputing.com>
Tested-by: default avatarJianyong Wu <jianyong.wu@arm.com>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>

Conflicts:
	arch/loongarch/configs/loongson3_defconfig
Signed-off-by: default avatarliwei <liwei728@huawei.com>
parent 734ada1b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +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_HOTPLUG_PRESENT_CPU if ACPI_PROCESSOR && HOTPLUG_CPU
	select ACPI_PPTT if ACPI
	select ACPI_SYSTEM_POWER_STATES_SUPPORT	if ACPI
	select ARCH_BINFMT_ELF_STATE
+2 −2
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size)
	memblock_reserve(addr, size);
}

#ifdef CONFIG_ACPI_HOTPLUG_CPU
#ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU

#include <acpi/processor.h>

@@ -343,4 +343,4 @@ int acpi_unmap_cpu(int cpu)
}
EXPORT_SYMBOL(acpi_unmap_cpu);

#endif /* CONFIG_ACPI_HOTPLUG_CPU */
#endif /* CONFIG_ACPI_HOTPLUG_PRESENT_CPU */
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,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 ACPI_HOTPLUG_PRESENT_CPU		if ACPI_PROCESSOR && HOTPLUG_CPU
	select ARCH_32BIT_OFF_T			if X86_32
	select ARCH_CLOCKSOURCE_INIT
	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
+2 −2
Original line number Diff line number Diff line
@@ -817,7 +817,7 @@ static void __init acpi_set_irq_model_ioapic(void)
/*
 *  ACPI based hotplug support for CPU
 */
#ifdef CONFIG_ACPI_HOTPLUG_CPU
#ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU
#include <acpi/processor.h>

static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
@@ -866,7 +866,7 @@ int acpi_unmap_cpu(int cpu)
	return (0);
}
EXPORT_SYMBOL(acpi_unmap_cpu);
#endif				/* CONFIG_ACPI_HOTPLUG_CPU */
#endif				/* CONFIG_ACPI_HOTPLUG_PRESENT_CPU */

int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
{
+2 −2
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ config ACPI_IPMI
	  To compile this driver as a module, choose M here:
	  the module will be called as acpi_ipmi.

config ACPI_HOTPLUG_CPU
config ACPI_HOTPLUG_PRESENT_CPU
	bool
	depends on ACPI_PROCESSOR && HOTPLUG_CPU
	select ACPI_CONTAINER
@@ -399,7 +399,7 @@ config ACPI_PCI_SLOT

config ACPI_CONTAINER
	bool "Container and Module Devices"
	default (ACPI_HOTPLUG_MEMORY || ACPI_HOTPLUG_CPU)
	default (ACPI_HOTPLUG_MEMORY || ACPI_HOTPLUG_PRESENT_CPU)
	help
	  This driver supports ACPI Container and Module devices (IDs
	  ACPI0004, PNP0A05, and PNP0A06).
Loading