xen/arm: Enable cpu_hotplug.c
Build cpu_hotplug for ARM and ARM64 guests. Rename arch_(un)register_cpu to xen_(un)register_cpu and provide an empty implementation on ARM and ARM64. On x86 just call arch_(un)register_cpu as we are already doing. Initialize cpu_hotplug on ARM. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Julien Grall <julien.grall@citrix.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
This commit is contained in:
committed by
David Vrabel
parent
89bf4b4e4a
commit
a314e3eb84
@@ -26,4 +26,14 @@ void __init xen_early_init(void);
|
|||||||
static inline void xen_early_init(void) { return; }
|
static inline void xen_early_init(void) { return; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
|
static inline void xen_arch_register_cpu(int num)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void xen_arch_unregister_cpu(int num)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _ASM_ARM_XEN_HYPERVISOR_H */
|
#endif /* _ASM_ARM_XEN_HYPERVISOR_H */
|
||||||
|
|||||||
@@ -57,4 +57,9 @@ static inline bool xen_x2apic_para_available(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
|
void xen_arch_register_cpu(int num);
|
||||||
|
void xen_arch_unregister_cpu(int num);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _ASM_X86_XEN_HYPERVISOR_H */
|
#endif /* _ASM_X86_XEN_HYPERVISOR_H */
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
#include <asm/mwait.h>
|
#include <asm/mwait.h>
|
||||||
#include <asm/pci_x86.h>
|
#include <asm/pci_x86.h>
|
||||||
#include <asm/pat.h>
|
#include <asm/pat.h>
|
||||||
|
#include <asm/cpu.h>
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI
|
#ifdef CONFIG_ACPI
|
||||||
#include <linux/acpi.h>
|
#include <linux/acpi.h>
|
||||||
@@ -1899,3 +1900,17 @@ const struct hypervisor_x86 x86_hyper_xen = {
|
|||||||
.set_cpu_features = xen_set_cpu_features,
|
.set_cpu_features = xen_set_cpu_features,
|
||||||
};
|
};
|
||||||
EXPORT_SYMBOL(x86_hyper_xen);
|
EXPORT_SYMBOL(x86_hyper_xen);
|
||||||
|
|
||||||
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
|
void xen_arch_register_cpu(int num)
|
||||||
|
{
|
||||||
|
arch_register_cpu(num);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(xen_arch_register_cpu);
|
||||||
|
|
||||||
|
void xen_arch_unregister_cpu(int num)
|
||||||
|
{
|
||||||
|
arch_unregister_cpu(num);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(xen_arch_unregister_cpu);
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)),)
|
|
||||||
obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
|
obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
|
||||||
endif
|
|
||||||
obj-$(CONFIG_X86) += fallback.o
|
obj-$(CONFIG_X86) += fallback.o
|
||||||
obj-y += grant-table.o features.o balloon.o manage.o preempt.o
|
obj-y += grant-table.o features.o balloon.o manage.o preempt.o
|
||||||
obj-y += events/
|
obj-y += events/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
static void enable_hotplug_cpu(int cpu)
|
static void enable_hotplug_cpu(int cpu)
|
||||||
{
|
{
|
||||||
if (!cpu_present(cpu))
|
if (!cpu_present(cpu))
|
||||||
arch_register_cpu(cpu);
|
xen_arch_register_cpu(cpu);
|
||||||
|
|
||||||
set_cpu_present(cpu, true);
|
set_cpu_present(cpu, true);
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ static void enable_hotplug_cpu(int cpu)
|
|||||||
static void disable_hotplug_cpu(int cpu)
|
static void disable_hotplug_cpu(int cpu)
|
||||||
{
|
{
|
||||||
if (cpu_present(cpu))
|
if (cpu_present(cpu))
|
||||||
arch_unregister_cpu(cpu);
|
xen_arch_unregister_cpu(cpu);
|
||||||
|
|
||||||
set_cpu_present(cpu, false);
|
set_cpu_present(cpu, false);
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,11 @@ static int __init setup_vcpu_hotplug_event(void)
|
|||||||
static struct notifier_block xsn_cpu = {
|
static struct notifier_block xsn_cpu = {
|
||||||
.notifier_call = setup_cpu_watcher };
|
.notifier_call = setup_cpu_watcher };
|
||||||
|
|
||||||
|
#ifdef CONFIG_X86
|
||||||
if (!xen_pv_domain())
|
if (!xen_pv_domain())
|
||||||
|
#else
|
||||||
|
if (!xen_domain())
|
||||||
|
#endif
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
register_xenstore_notifier(&xsn_cpu);
|
register_xenstore_notifier(&xsn_cpu);
|
||||||
|
|||||||
Reference in New Issue
Block a user