From ef92e7caf9901884f19fdeb4d7a24333b33c5f37 Mon Sep 17 00:00:00 2001 From: Liu Jinsong Date: Thu, 24 Jan 2013 20:19:47 +0800 Subject: xen/acpi: ACPI memory hotplug This patch implements real Xen acpi memory hotplug driver as module. When loaded, it replaces Xen stub driver. When an acpi memory device hotadd event occurs, it notifies OS and invokes notification callback, adding related memory device and parsing memory information, finally hypercall to xen hypervisor to add memory. Signed-off-by: Liu Jinsong Signed-off-by: Konrad Rzeszutek Wilk --- include/xen/interface/platform.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'include/xen/interface/platform.h') diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index 5e36932ab407..2c4fb4bb07df 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h @@ -324,10 +324,14 @@ struct xenpf_cpu_ol { }; DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); -/* - * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd, - * which are already occupied at Xen hypervisor side. - */ +#define XENPF_mem_hotadd 59 +struct xenpf_mem_hotadd { + uint64_t spfn; + uint64_t epfn; + uint32_t pxm; + uint32_t flags; +}; + #define XENPF_core_parking 60 struct xenpf_core_parking { /* IN variables */ @@ -357,6 +361,7 @@ struct xen_platform_op { struct xenpf_set_processor_pminfo set_pminfo; struct xenpf_pcpuinfo pcpu_info; struct xenpf_cpu_ol cpu_ol; + struct xenpf_mem_hotadd mem_add; struct xenpf_core_parking core_parking; uint8_t pad[128]; } u; -- cgit v1.2.3 From 39adc483d378f79711f291539f20e3797337892d Mon Sep 17 00:00:00 2001 From: Liu Jinsong Date: Fri, 25 Jan 2013 15:43:34 +0800 Subject: xen/acpi: ACPI cpu hotplug This patch implement real Xen ACPI cpu hotplug driver as module. When loaded, it replaces Xen stub driver. For booting existed cpus, the driver enumerates them. For hotadded cpus, which added at runtime and notify OS via device or container event, the driver is invoked to add them, parsing cpu information, hypercalling to Xen hypervisor to add them, and finally setting up new /sys interface for them. Signed-off-by: Liu Jinsong Signed-off-by: Konrad Rzeszutek Wilk --- include/xen/interface/platform.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/xen/interface/platform.h') diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index 2c4fb4bb07df..c57d5f67f702 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h @@ -324,6 +324,13 @@ struct xenpf_cpu_ol { }; DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); +#define XENPF_cpu_hotadd 58 +struct xenpf_cpu_hotadd { + uint32_t apic_id; + uint32_t acpi_id; + uint32_t pxm; +}; + #define XENPF_mem_hotadd 59 struct xenpf_mem_hotadd { uint64_t spfn; @@ -361,6 +368,7 @@ struct xen_platform_op { struct xenpf_set_processor_pminfo set_pminfo; struct xenpf_pcpuinfo pcpu_info; struct xenpf_cpu_ol cpu_ol; + struct xenpf_cpu_hotadd cpu_add; struct xenpf_mem_hotadd mem_add; struct xenpf_core_parking core_parking; uint8_t pad[128]; -- cgit v1.2.3