aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/events/events_internal.h
diff options
context:
space:
mode:
authorRoss Lagerwall <ross.lagerwall@citrix.com>2015-07-31 14:30:42 +0100
committerDavid Vrabel <david.vrabel@citrix.com>2015-08-04 15:41:59 +0100
commitfcdf31a7c162de0c93a2bee51df4688ab0a348f8 (patch)
treea93d841ce0104c8e19e6e37253df8512e0113a6e /drivers/xen/events/events_internal.h
parentxen: release lock occasionally during ballooning (diff)
downloadlinux-dev-fcdf31a7c162de0c93a2bee51df4688ab0a348f8.tar.xz
linux-dev-fcdf31a7c162de0c93a2bee51df4688ab0a348f8.zip
xen/events/fifo: Handle linked events when closing a port
An event channel bound to a CPU that was offlined may still be linked on that CPU's queue. If this event channel is closed and reused, subsequent events will be lost because the event channel is never unlinked and thus cannot be linked onto the correct queue. When a channel is closed and the event is still linked into a queue, ensure that it is unlinked before completing. If the CPU to which the event channel bound is online, spin until the event is handled by that CPU. If that CPU is offline, it can't handle the event, so clear the event queue during the close, dropping the events. This fixes the missing interrupts (and subsequent disk stalls etc.) when offlining a CPU. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Cc: <stable@vger.kernel.org> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/events/events_internal.h')
-rw-r--r--drivers/xen/events/events_internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/xen/events/events_internal.h b/drivers/xen/events/events_internal.h
index 50c2050a1e32..d18e12315ec0 100644
--- a/drivers/xen/events/events_internal.h
+++ b/drivers/xen/events/events_internal.h
@@ -68,6 +68,7 @@ struct evtchn_ops {
bool (*test_and_set_mask)(unsigned port);
void (*mask)(unsigned port);
void (*unmask)(unsigned port);
+ void (*close)(unsigned port, unsigned cpu);
void (*handle_events)(unsigned cpu);
void (*resume)(void);
@@ -145,6 +146,12 @@ static inline void xen_evtchn_resume(void)
evtchn_ops->resume();
}
+static inline void xen_evtchn_op_close(unsigned port, unsigned cpu)
+{
+ if (evtchn_ops->close)
+ return evtchn_ops->close(port, cpu);
+}
+
void xen_evtchn_2l_init(void);
int xen_evtchn_fifo_init(void);