提交 2875d85b 编写于 作者: X Xiongfeng Wang 提交者: Xie XiuQi

arm64: Add CPU hotplug support

hulk inclusion
category: feature
bugzilla: 20208
CVE: NA
---------------------------

To support CPU hotplug, we need to implement 'acpi_(un)map_cpu()' and
'arch_(un)register_cpu()' for ARM64. These functions are called in
'acpi_processor_hotadd_init()/acpi_processor_remove()' when the CPU is hot
added into or hot removed from the system.

Note: This patch only support core hotplug and does not support socket
hotplug because we don't support live configuration of GIC.
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Acked-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 fbcc048a
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <acpi/processor.h>
#include <asm/cputype.h> #include <asm/cputype.h>
#include <asm/cpu_ops.h> #include <asm/cpu_ops.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -261,3 +262,31 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr) ...@@ -261,3 +262,31 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
return __pgprot(PROT_NORMAL_NC); return __pgprot(PROT_NORMAL_NC);
return __pgprot(PROT_DEVICE_nGnRnE); return __pgprot(PROT_DEVICE_nGnRnE);
} }
int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id,
int *pcpu)
{
int cpu, nid;
cpu = acpi_map_cpuid(physid, acpi_id);
nid = acpi_get_node(handle);
if (nid != NUMA_NO_NODE) {
set_cpu_numa_node(cpu, nid);
numa_add_cpu(cpu);
}
*pcpu = cpu;
set_cpu_present(cpu, true);
return 0;
}
EXPORT_SYMBOL(acpi_map_cpu);
int acpi_unmap_cpu(int cpu)
{
set_cpu_present(cpu, false);
numa_clear_node(cpu);
return 0;
}
EXPORT_SYMBOL(acpi_unmap_cpu);
...@@ -429,3 +429,20 @@ static int __init register_kernel_offset_dumper(void) ...@@ -429,3 +429,20 @@ static int __init register_kernel_offset_dumper(void)
return 0; return 0;
} }
__initcall(register_kernel_offset_dumper); __initcall(register_kernel_offset_dumper);
int arch_register_cpu(int num)
{
struct cpu *cpu = &per_cpu(cpu_data.cpu, num);
cpu->hotpluggable = 1;
return register_cpu(cpu, num);
}
EXPORT_SYMBOL(arch_register_cpu);
void arch_unregister_cpu(int num)
{
struct cpu *cpu = &per_cpu(cpu_data.cpu, num);
unregister_cpu(cpu);
}
EXPORT_SYMBOL(arch_unregister_cpu);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册