aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-24 19:06:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-24 19:18:31 -0500
commit77be36de8b07027a70fbc8f02703ccd76cd16d09 (patch)
treee2310718e39cb0dcfe93942d4c990df9154a7ecd /include
parent89f883372fa60f604d136924baf3e89ff1870e9e (diff)
parentc81611c4e96f595a80d8be9367c385d2c116428b (diff)
Merge tag 'stable/for-linus-3.9-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
Pull Xen update from Konrad Rzeszutek Wilk: "This has two new ACPI drivers for Xen - a physical CPU offline/online and a memory hotplug. The way this works is that ACPI kicks the drivers and they make the appropiate hypercall to the hypervisor to tell it that there is a new CPU or memory. There also some changes to the Xen ARM ABIs and couple of fixes. One particularly nasty bug in the Xen PV spinlock code was fixed by Stefan Bader - and has been there since the 2.6.32! Features: - Xen ACPI memory and CPU hotplug drivers - allowing Xen hypervisor to be aware of new CPU and new DIMMs - Cleanups Bug-fixes: - Fixes a long-standing bug in the PV spinlock wherein we did not kick VCPUs that were in a tight loop. - Fixes in the error paths for the event channel machinery" Fix up a few semantic conflicts with the ACPI interface changes in drivers/xen/xen-acpi-{cpu,mem}hotplug.c. * tag 'stable/for-linus-3.9-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen: event channel arrays are xen_ulong_t and not unsigned long xen: Send spinlock IPI to all waiters xen: introduce xen_remap, use it instead of ioremap xen: close evtchn port if binding to irq fails xen-evtchn: correct comment and error output xen/tmem: Add missing %s in the printk statement. xen/acpi: move xen_acpi_get_pxm under CONFIG_XEN_DOM0 xen/acpi: ACPI cpu hotplug xen/acpi: Move xen_acpi_get_pxm to Xen's acpi.h xen/stub: driver for CPU hotplug xen/acpi: ACPI memory hotplug xen/stub: driver for memory hotplug xen: implement updated XENMEM_add_to_physmap_range ABI xen/smp: Move the common CPU init code a bit to prep for PVH patch.
Diffstat (limited to 'include')
-rw-r--r--include/xen/acpi.h35
-rw-r--r--include/xen/interface/memory.h6
-rw-r--r--include/xen/interface/platform.h21
-rw-r--r--include/xen/interface/xen.h8
4 files changed, 62 insertions, 8 deletions
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 48a9c0171b65..68d73d09b770 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -40,6 +40,41 @@
40#include <xen/xen.h> 40#include <xen/xen.h>
41#include <linux/acpi.h> 41#include <linux/acpi.h>
42 42
43#define ACPI_MEMORY_DEVICE_CLASS "memory"
44#define ACPI_MEMORY_DEVICE_HID "PNP0C80"
45#define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device"
46
47int xen_stub_memory_device_init(void);
48void xen_stub_memory_device_exit(void);
49
50#define ACPI_PROCESSOR_CLASS "processor"
51#define ACPI_PROCESSOR_DEVICE_HID "ACPI0007"
52#define ACPI_PROCESSOR_DEVICE_NAME "Processor"
53
54int xen_stub_processor_init(void);
55void xen_stub_processor_exit(void);
56
57void xen_pcpu_hotplug_sync(void);
58int xen_pcpu_id(uint32_t acpi_id);
59
60static inline int xen_acpi_get_pxm(acpi_handle h)
61{
62 unsigned long long pxm;
63 acpi_status status;
64 acpi_handle handle;
65 acpi_handle phandle = h;
66
67 do {
68 handle = phandle;
69 status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
70 if (ACPI_SUCCESS(status))
71 return pxm;
72 status = acpi_get_parent(handle, &phandle);
73 } while (ACPI_SUCCESS(status));
74
75 return -ENXIO;
76}
77
43int xen_acpi_notify_hypervisor_state(u8 sleep_state, 78int xen_acpi_notify_hypervisor_state(u8 sleep_state,
44 u32 pm1a_cnt, u32 pm1b_cnd); 79 u32 pm1a_cnt, u32 pm1b_cnd);
45 80
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
index b40a4315cb8b..2ecfe4f700d9 100644
--- a/include/xen/interface/memory.h
+++ b/include/xen/interface/memory.h
@@ -190,6 +190,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap);
190 190
191#define XENMEM_add_to_physmap_range 23 191#define XENMEM_add_to_physmap_range 23
192struct xen_add_to_physmap_range { 192struct xen_add_to_physmap_range {
193 /* IN */
193 /* Which domain to change the mapping for. */ 194 /* Which domain to change the mapping for. */
194 domid_t domid; 195 domid_t domid;
195 uint16_t space; /* => enum phys_map_space */ 196 uint16_t space; /* => enum phys_map_space */
@@ -203,6 +204,11 @@ struct xen_add_to_physmap_range {
203 204
204 /* GPFN in domid where the source mapping page should appear. */ 205 /* GPFN in domid where the source mapping page should appear. */
205 GUEST_HANDLE(xen_pfn_t) gpfns; 206 GUEST_HANDLE(xen_pfn_t) gpfns;
207
208 /* OUT */
209
210 /* Per index error code. */
211 GUEST_HANDLE(int) errs;
206}; 212};
207DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range); 213DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range);
208 214
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
index 5e36932ab407..c57d5f67f702 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,10 +324,21 @@ struct xenpf_cpu_ol {
324}; 324};
325DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); 325DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
326 326
327/* 327#define XENPF_cpu_hotadd 58
328 * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd, 328struct xenpf_cpu_hotadd {
329 * which are already occupied at Xen hypervisor side. 329 uint32_t apic_id;
330 */ 330 uint32_t acpi_id;
331 uint32_t pxm;
332};
333
334#define XENPF_mem_hotadd 59
335struct xenpf_mem_hotadd {
336 uint64_t spfn;
337 uint64_t epfn;
338 uint32_t pxm;
339 uint32_t flags;
340};
341
331#define XENPF_core_parking 60 342#define XENPF_core_parking 60
332struct xenpf_core_parking { 343struct xenpf_core_parking {
333 /* IN variables */ 344 /* IN variables */
@@ -357,6 +368,8 @@ struct xen_platform_op {
357 struct xenpf_set_processor_pminfo set_pminfo; 368 struct xenpf_set_processor_pminfo set_pminfo;
358 struct xenpf_pcpuinfo pcpu_info; 369 struct xenpf_pcpuinfo pcpu_info;
359 struct xenpf_cpu_ol cpu_ol; 370 struct xenpf_cpu_ol cpu_ol;
371 struct xenpf_cpu_hotadd cpu_add;
372 struct xenpf_mem_hotadd mem_add;
360 struct xenpf_core_parking core_parking; 373 struct xenpf_core_parking core_parking;
361 uint8_t pad[128]; 374 uint8_t pad[128];
362 } u; 375 } u;
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 886a5d80a18f..53ec4167bd0b 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -285,7 +285,7 @@ DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
285 * Event channel endpoints per domain: 285 * Event channel endpoints per domain:
286 * 1024 if a long is 32 bits; 4096 if a long is 64 bits. 286 * 1024 if a long is 32 bits; 4096 if a long is 64 bits.
287 */ 287 */
288#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64) 288#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
289 289
290struct vcpu_time_info { 290struct vcpu_time_info {
291 /* 291 /*
@@ -341,7 +341,7 @@ struct vcpu_info {
341 */ 341 */
342 uint8_t evtchn_upcall_pending; 342 uint8_t evtchn_upcall_pending;
343 uint8_t evtchn_upcall_mask; 343 uint8_t evtchn_upcall_mask;
344 unsigned long evtchn_pending_sel; 344 xen_ulong_t evtchn_pending_sel;
345 struct arch_vcpu_info arch; 345 struct arch_vcpu_info arch;
346 struct pvclock_vcpu_time_info time; 346 struct pvclock_vcpu_time_info time;
347}; /* 64 bytes (x86) */ 347}; /* 64 bytes (x86) */
@@ -384,8 +384,8 @@ struct shared_info {
384 * per-vcpu selector word to be set. Each bit in the selector covers a 384 * per-vcpu selector word to be set. Each bit in the selector covers a
385 * 'C long' in the PENDING bitfield array. 385 * 'C long' in the PENDING bitfield array.
386 */ 386 */
387 unsigned long evtchn_pending[sizeof(unsigned long) * 8]; 387 xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8];
388 unsigned long evtchn_mask[sizeof(unsigned long) * 8]; 388 xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8];
389 389
390 /* 390 /*
391 * Wallclock time: updated only by control software. Guests should base 391 * Wallclock time: updated only by control software. Guests should base