Commit 1fe56551 authored by David Vrabel's avatar David Vrabel Committed by Konrad Rzeszutek Wilk

xen/events: use the FIFO-based ABI if available

Implement all the event channel port ops for the FIFO-based ABI.

If the hypervisor supports the FIFO-based ABI, enable it by
initializing the control block for the boot VCPU and subsequent VCPUs
as they are brought up and on resume.  The event array is expanded as
required when event ports are setup.

The 'xen.fifo_events=0' command line option may be used to disable use
of the FIFO-based ABI.
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
parent 8785c676
...@@ -2,3 +2,4 @@ obj-y += events.o ...@@ -2,3 +2,4 @@ obj-y += events.o
events-y += events_base.o events-y += events_base.o
events-y += events_2l.o events-y += events_2l.o
events-y += events_fifo.o
...@@ -1563,6 +1563,7 @@ void xen_irq_resume(void) ...@@ -1563,6 +1563,7 @@ void xen_irq_resume(void)
/* New event-channel space is not 'live' yet. */ /* New event-channel space is not 'live' yet. */
xen_evtchn_mask_all(); xen_evtchn_mask_all();
xen_evtchn_resume();
/* No IRQ <-> event-channel mappings. */ /* No IRQ <-> event-channel mappings. */
list_for_each_entry(info, &xen_irq_list_head, list) list_for_each_entry(info, &xen_irq_list_head, list)
...@@ -1659,8 +1660,19 @@ void xen_callback_vector(void) ...@@ -1659,8 +1660,19 @@ void xen_callback_vector(void)
void xen_callback_vector(void) {} void xen_callback_vector(void) {}
#endif #endif
#undef MODULE_PARAM_PREFIX
#define MODULE_PARAM_PREFIX "xen."
static bool fifo_events = true;
module_param(fifo_events, bool, 0);
void __init xen_init_IRQ(void) void __init xen_init_IRQ(void)
{ {
int ret = -EINVAL;
if (fifo_events)
ret = xen_evtchn_fifo_init();
if (ret < 0)
xen_evtchn_2l_init(); xen_evtchn_2l_init();
evtchn_to_irq = kcalloc(EVTCHN_ROW(xen_evtchn_max_channels()), evtchn_to_irq = kcalloc(EVTCHN_ROW(xen_evtchn_max_channels()),
......
This diff is collapsed.
...@@ -69,6 +69,7 @@ struct evtchn_ops { ...@@ -69,6 +69,7 @@ struct evtchn_ops {
void (*unmask)(unsigned port); void (*unmask)(unsigned port);
void (*handle_events)(unsigned cpu); void (*handle_events)(unsigned cpu);
void (*resume)(void);
}; };
extern const struct evtchn_ops *evtchn_ops; extern const struct evtchn_ops *evtchn_ops;
...@@ -137,6 +138,13 @@ static inline void xen_evtchn_handle_events(unsigned cpu) ...@@ -137,6 +138,13 @@ static inline void xen_evtchn_handle_events(unsigned cpu)
return evtchn_ops->handle_events(cpu); return evtchn_ops->handle_events(cpu);
} }
static inline void xen_evtchn_resume(void)
{
if (evtchn_ops->resume)
evtchn_ops->resume();
}
void xen_evtchn_2l_init(void); void xen_evtchn_2l_init(void);
int xen_evtchn_fifo_init(void);
#endif /* #ifndef __EVENTS_INTERNAL_H__ */ #endif /* #ifndef __EVENTS_INTERNAL_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment