Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145845
b: refs/heads/master
c: 53152f9
h: refs/heads/master
i:
  145843: cc47db5
v: v3
  • Loading branch information
Ian Campbell authored and Jeremy Fitzhardinge committed Apr 2, 2009
1 parent 6ae5062 commit dfc977c
Show file tree
Hide file tree
Showing 17 changed files with 91 additions and 1,123 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1943689c47acaad7fc7f3dae8d35ef82de5d48f4
refs/heads/master: 53152f957d4a5dfd537d17c823afeb1a2c03753e
20 changes: 0 additions & 20 deletions trunk/drivers/xen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ config XEN_SCRUB_PAGES
secure, but slightly less efficient.
If in doubt, say yes.

config XEN_DEV_EVTCHN
tristate "Xen /dev/xen/evtchn device"
depends on XEN
default y
help
The evtchn driver allows a userspace process to triger event
channels and to receive notification of an event channel
firing.
If in doubt, say yes.

config XENFS
tristate "Xen filesystem"
depends on XEN
Expand All @@ -51,13 +41,3 @@ config XEN_COMPAT_XENFS
a xen platform.
If in doubt, say yes.

config XEN_SYS_HYPERVISOR
bool "Create xen entries under /sys/hypervisor"
depends on XEN && SYSFS
select SYS_HYPERVISOR
default y
help
Create entries under /sys/hypervisor describing the Xen
hypervisor environment. When running native or in another
virtual environment, /sys/hypervisor will still be present,
but will have no xen contents.
4 changes: 1 addition & 3 deletions trunk/drivers/xen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ obj-y += xenbus/
obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
obj-$(CONFIG_XEN_XENCOMM) += xencomm.o
obj-$(CONFIG_XEN_BALLOON) += balloon.o
obj-$(CONFIG_XEN_DEV_EVTCHN) += evtchn.o
obj-$(CONFIG_XENFS) += xenfs/
obj-$(CONFIG_XEN_SYS_HYPERVISOR) += sys-hypervisor.o
obj-$(CONFIG_XENFS) += xenfs/
40 changes: 30 additions & 10 deletions trunk/drivers/xen/cpu_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,41 @@ static void disable_hotplug_cpu(int cpu)
cpu_clear(cpu, cpu_present_map);
}

static void vcpu_hotplug(unsigned int cpu)
static int vcpu_online(unsigned int cpu)
{
int err;
char dir[32], state[32];

if (!cpu_possible(cpu))
return;

sprintf(dir, "cpu/%u", cpu);
err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state);
if (err != 1) {
printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
return;
return err;
}

if (strcmp(state, "online") == 0) {
if (strcmp(state, "online") == 0)
return 1;
else if (strcmp(state, "offline") == 0)
return 0;

printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n", state, cpu);
return -EINVAL;
}
static void vcpu_hotplug(unsigned int cpu)
{
if (!cpu_possible(cpu))
return;

switch (vcpu_online(cpu)) {
case 1:
enable_hotplug_cpu(cpu);
} else if (strcmp(state, "offline") == 0) {
break;
case 0:
(void)cpu_down(cpu);
disable_hotplug_cpu(cpu);
} else {
printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n",
state, cpu);
break;
default:
break;
}
}

Expand All @@ -64,12 +76,20 @@ static void handle_vcpu_hotplug_event(struct xenbus_watch *watch,
static int setup_cpu_watcher(struct notifier_block *notifier,
unsigned long event, void *data)
{
int cpu;
static struct xenbus_watch cpu_watch = {
.node = "cpu",
.callback = handle_vcpu_hotplug_event};

(void)register_xenbus_watch(&cpu_watch);

for_each_possible_cpu(cpu) {
if (vcpu_online(cpu) == 0) {
(void)cpu_down(cpu);
cpu_clear(cpu, cpu_present_map);
}
}

return NOTIFY_DONE;
}

Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ static unsigned int evtchn_from_irq(unsigned irq)
return info_for_irq(irq)->evtchn;
}

unsigned irq_from_evtchn(unsigned int evtchn)
{
return evtchn_to_irq[evtchn];
}
EXPORT_SYMBOL_GPL(irq_from_evtchn);

static enum ipi_vector ipi_from_irq(unsigned irq)
{
struct irq_info *info = info_for_irq(irq);
Expand Down
Loading

0 comments on commit dfc977c

Please sign in to comment.