Skip to content

Commit f66d95d

Browse files
committed
Merge tag 'stable/for-linus-3.11-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull Xen fixes from Konrad Rzeszutek Wilk: - Three fixes for ARM/ARM64 to either compile or not certain generic drivers - Fix for avoiding a potential deadlock when an user space event channel is destroyed. - Fix a workqueue resuming multiple times. * tag 'stable/for-linus-3.11-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/tmem: do not allow XEN_TMEM on ARM64 xen/evtchn: avoid a deadlock when unbinding an event channel xen/arm: enable PV control for ARM xen/arm64: Don't compile cpu hotplug xenbus: frontend resume cleanup
2 parents 878d2cd + 741ddbc commit f66d95d

4 files changed

Lines changed: 21 additions & 26 deletions

File tree

drivers/xen/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ config SWIOTLB_XEN
145145

146146
config XEN_TMEM
147147
tristate
148-
depends on !ARM
148+
depends on !ARM && !ARM64
149149
default m if (CLEANCACHE || FRONTSWAP)
150150
help
151151
Shim to interface in-kernel Transcendent Memory hooks

drivers/xen/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
ifneq ($(CONFIG_ARM),y)
2-
obj-y += manage.o
1+
ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)),)
32
obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
43
endif
54
obj-$(CONFIG_X86) += fallback.o
6-
obj-y += grant-table.o features.o events.o balloon.o
5+
obj-y += grant-table.o features.o events.o balloon.o manage.o
76
obj-y += xenbus/
87

98
nostackp := $(call cc-option, -fno-stack-protector)

drivers/xen/evtchn.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,12 @@ static long evtchn_ioctl(struct file *file,
379379
if (unbind.port >= NR_EVENT_CHANNELS)
380380
break;
381381

382-
spin_lock_irq(&port_user_lock);
383-
384382
rc = -ENOTCONN;
385-
if (get_port_user(unbind.port) != u) {
386-
spin_unlock_irq(&port_user_lock);
383+
if (get_port_user(unbind.port) != u)
387384
break;
388-
}
389385

390386
disable_irq(irq_from_evtchn(unbind.port));
391387

392-
spin_unlock_irq(&port_user_lock);
393-
394388
evtchn_unbind_from_user(u, unbind.port);
395389

396390
rc = 0;
@@ -490,26 +484,15 @@ static int evtchn_release(struct inode *inode, struct file *filp)
490484
int i;
491485
struct per_user_data *u = filp->private_data;
492486

493-
spin_lock_irq(&port_user_lock);
494-
495-
free_page((unsigned long)u->ring);
496-
497487
for (i = 0; i < NR_EVENT_CHANNELS; i++) {
498488
if (get_port_user(i) != u)
499489
continue;
500490

501491
disable_irq(irq_from_evtchn(i));
502-
}
503-
504-
spin_unlock_irq(&port_user_lock);
505-
506-
for (i = 0; i < NR_EVENT_CHANNELS; i++) {
507-
if (get_port_user(i) != u)
508-
continue;
509-
510492
evtchn_unbind_from_user(get_port_user(i), i);
511493
}
512494

495+
free_page((unsigned long)u->ring);
513496
kfree(u->name);
514497
kfree(u);
515498

drivers/xen/xenbus/xenbus_probe_frontend.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ static int xenbus_frontend_dev_resume(struct device *dev)
115115
return -EFAULT;
116116
}
117117

118-
INIT_WORK(&xdev->work, xenbus_frontend_delayed_resume);
119118
queue_work(xenbus_frontend_wq, &xdev->work);
120119

121120
return 0;
@@ -124,6 +123,16 @@ static int xenbus_frontend_dev_resume(struct device *dev)
124123
return xenbus_dev_resume(dev);
125124
}
126125

126+
static int xenbus_frontend_dev_probe(struct device *dev)
127+
{
128+
if (xen_store_domain_type == XS_LOCAL) {
129+
struct xenbus_device *xdev = to_xenbus_device(dev);
130+
INIT_WORK(&xdev->work, xenbus_frontend_delayed_resume);
131+
}
132+
133+
return xenbus_dev_probe(dev);
134+
}
135+
127136
static const struct dev_pm_ops xenbus_pm_ops = {
128137
.suspend = xenbus_dev_suspend,
129138
.resume = xenbus_frontend_dev_resume,
@@ -142,7 +151,7 @@ static struct xen_bus_type xenbus_frontend = {
142151
.name = "xen",
143152
.match = xenbus_match,
144153
.uevent = xenbus_uevent_frontend,
145-
.probe = xenbus_dev_probe,
154+
.probe = xenbus_frontend_dev_probe,
146155
.remove = xenbus_dev_remove,
147156
.shutdown = xenbus_dev_shutdown,
148157
.dev_attrs = xenbus_dev_attrs,
@@ -474,7 +483,11 @@ static int __init xenbus_probe_frontend_init(void)
474483

475484
register_xenstore_notifier(&xenstore_notifier);
476485

477-
xenbus_frontend_wq = create_workqueue("xenbus_frontend");
486+
if (xen_store_domain_type == XS_LOCAL) {
487+
xenbus_frontend_wq = create_workqueue("xenbus_frontend");
488+
if (!xenbus_frontend_wq)
489+
pr_warn("create xenbus frontend workqueue failed, S3 resume is likely to fail\n");
490+
}
478491

479492
return 0;
480493
}

0 commit comments

Comments
 (0)