Commit Graph

7 Commits

Author SHA1 Message Date
Jeremy Fitzhardinge
3f5e554f66 xen/evtchn: don't do unbind_from_irqhandler under spinlock
unbind_from_irqhandler can end up doing /proc operations, which can't
happen under a spinlock.  So before removing the IRQ handler,
disable the irq under the port_user lock (masking the underlying event
channel and making sure the irq handler isn't running concurrently and
won't start running), then remove the handler without the lock.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-05-28 15:28:27 -07:00
Jeremy Fitzhardinge
1a1a17cddb xen/evtchn: remove spurious barrier
evtchn_unbind_from_user() is called under a lock, so there's no need to
worry about the ordering of unbind_from_irqhandler vs clearing the port
per-user data.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2009-09-18 17:13:41 -07:00
Jeremy Fitzhardinge
0edce91dcd xen/evtchn: ports start enabled
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2009-09-18 17:13:18 -07:00
Jeremy Fitzhardinge
93afe0b75e xen/evtchn: dynamically allocate port_user array
We only need the array when running as a Xen domain, so dynamically
allocate it as needed to save on bss space.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2009-09-18 17:13:17 -07:00
Jeremy Fitzhardinge
e3cc067b0a xen/evtchn: track enabled state for each port
enable/disable_irq() complain if the enables/disables are unbalanced,
so keep track of the state and avoid redundant enables.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2009-09-18 17:13:14 -07:00
Jeremy Fitzhardinge
0a4666b539 xen/dev-evtchn: clean up locking in evtchn
Define a new per_user_data mutex to serialize bind/unbind operations
to prevent them from racing with each other.  Fix error returns
and don't do a bind while holding a spinlock.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2009-03-30 09:26:49 -07:00
Ian Campbell
f7116284c7 xen: add /dev/xen/evtchn driver
This driver is used by application which wish to receive notifications
from the hypervisor or other guests via Xen's event channel
mechanism. In particular it is used by the xenstore daemon in domain
0.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2009-03-30 09:26:49 -07:00