aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/pcpu.c
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 /drivers/xen/pcpu.c
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 'drivers/xen/pcpu.c')
-rw-r--r--drivers/xen/pcpu.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c
index 5a27a4599a4a..6536d5ab1697 100644
--- a/drivers/xen/pcpu.c
+++ b/drivers/xen/pcpu.c
@@ -332,6 +332,41 @@ static irqreturn_t xen_pcpu_interrupt(int irq, void *dev_id)
332 return IRQ_HANDLED; 332 return IRQ_HANDLED;
333} 333}
334 334
335/* Sync with Xen hypervisor after cpu hotadded */
336void xen_pcpu_hotplug_sync(void)
337{
338 schedule_work(&xen_pcpu_work);
339}
340EXPORT_SYMBOL_GPL(xen_pcpu_hotplug_sync);
341
342/*
343 * For hypervisor presented cpu, return logic cpu id;
344 * For hypervisor non-presented cpu, return -ENODEV.
345 */
346int xen_pcpu_id(uint32_t acpi_id)
347{
348 int cpu_id = 0, max_id = 0;
349 struct xen_platform_op op;
350
351 op.cmd = XENPF_get_cpuinfo;
352 while (cpu_id <= max_id) {
353 op.u.pcpu_info.xen_cpuid = cpu_id;
354 if (HYPERVISOR_dom0_op(&op)) {
355 cpu_id++;
356 continue;
357 }
358
359 if (acpi_id == op.u.pcpu_info.acpi_id)
360 return cpu_id;
361 if (op.u.pcpu_info.max_present > max_id)
362 max_id = op.u.pcpu_info.max_present;
363 cpu_id++;
364 }
365
366 return -ENODEV;
367}
368EXPORT_SYMBOL_GPL(xen_pcpu_id);
369
335static int __init xen_pcpu_init(void) 370static int __init xen_pcpu_init(void)
336{ 371{
337 int irq, ret; 372 int irq, ret;