Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356934
b: refs/heads/master
c: 39adc48
h: refs/heads/master
v: v3
  • Loading branch information
Liu Jinsong authored and Konrad Rzeszutek Wilk committed Feb 20, 2013
1 parent e3a2de1 commit 7939c70
Show file tree
Hide file tree
Showing 7 changed files with 531 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40a58637a4fa10a2faea71f0f30ff0b3d74c6e00
refs/heads/master: 39adc483d378f79711f291539f20e3797337892d
12 changes: 12 additions & 0 deletions trunk/drivers/xen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ config XEN_ACPI_HOTPLUG_MEMORY
to hot-add memory at runtime (the hot-added memory cannot be
removed until machine stop), select Y/M here, otherwise select N.

config XEN_ACPI_HOTPLUG_CPU
tristate "Xen ACPI cpu hotplug"
depends on XEN_DOM0 && XEN_STUB && ACPI
select ACPI_CONTAINER
default n
help
Xen ACPI cpu enumerating and hotplugging

For hotplugging, currently Xen only support ACPI cpu hotadd.
If you want to hotadd cpu at runtime (the hotadded cpu cannot
be removed until machine stop), select Y/M here.

config XEN_ACPI_PROCESSOR
tristate "Xen ACPI processor"
depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/xen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback/
obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o
obj-$(CONFIG_XEN_STUB) += xen-stub.o
obj-$(CONFIG_XEN_ACPI_HOTPLUG_MEMORY) += xen-acpi-memhotplug.o
obj-$(CONFIG_XEN_ACPI_HOTPLUG_CPU) += xen-acpi-cpuhotplug.o
obj-$(CONFIG_XEN_ACPI_PROCESSOR) += xen-acpi-processor.o
xen-evtchn-y := evtchn.o
xen-gntdev-y := gntdev.o
Expand Down
35 changes: 35 additions & 0 deletions trunk/drivers/xen/pcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,41 @@ static irqreturn_t xen_pcpu_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}

/* Sync with Xen hypervisor after cpu hotadded */
void xen_pcpu_hotplug_sync(void)
{
schedule_work(&xen_pcpu_work);
}
EXPORT_SYMBOL_GPL(xen_pcpu_hotplug_sync);

/*
* For hypervisor presented cpu, return logic cpu id;
* For hypervisor non-presented cpu, return -ENODEV.
*/
int xen_pcpu_id(uint32_t acpi_id)
{
int cpu_id = 0, max_id = 0;
struct xen_platform_op op;

op.cmd = XENPF_get_cpuinfo;
while (cpu_id <= max_id) {
op.u.pcpu_info.xen_cpuid = cpu_id;
if (HYPERVISOR_dom0_op(&op)) {
cpu_id++;
continue;
}

if (acpi_id == op.u.pcpu_info.acpi_id)
return cpu_id;
if (op.u.pcpu_info.max_present > max_id)
max_id = op.u.pcpu_info.max_present;
cpu_id++;
}

return -ENODEV;
}
EXPORT_SYMBOL_GPL(xen_pcpu_id);

static int __init xen_pcpu_init(void)
{
int irq, ret;
Expand Down
Loading

0 comments on commit 7939c70

Please sign in to comment.