aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/events/events_2l.c8
-rw-r--r--include/xen/interface/event_channel.h68
-rw-r--r--include/xen/interface/xen.h6
3 files changed, 72 insertions, 10 deletions
diff --git a/drivers/xen/events/events_2l.c b/drivers/xen/events/events_2l.c
index ecb402a149e3..d7ff91757307 100644
--- a/drivers/xen/events/events_2l.c
+++ b/drivers/xen/events/events_2l.c
@@ -38,12 +38,12 @@
38/* Find the first set bit in a evtchn mask */ 38/* Find the first set bit in a evtchn mask */
39#define EVTCHN_FIRST_BIT(w) find_first_bit(BM(&(w)), BITS_PER_EVTCHN_WORD) 39#define EVTCHN_FIRST_BIT(w) find_first_bit(BM(&(w)), BITS_PER_EVTCHN_WORD)
40 40
41static DEFINE_PER_CPU(xen_ulong_t [NR_EVENT_CHANNELS/BITS_PER_EVTCHN_WORD], 41static DEFINE_PER_CPU(xen_ulong_t [EVTCHN_2L_NR_CHANNELS/BITS_PER_EVTCHN_WORD],
42 cpu_evtchn_mask); 42 cpu_evtchn_mask);
43 43
44static unsigned evtchn_2l_max_channels(void) 44static unsigned evtchn_2l_max_channels(void)
45{ 45{
46 return NR_EVENT_CHANNELS; 46 return EVTCHN_2L_NR_CHANNELS;
47} 47}
48 48
49static void evtchn_2l_bind_to_cpu(struct irq_info *info, unsigned cpu) 49static void evtchn_2l_bind_to_cpu(struct irq_info *info, unsigned cpu)
@@ -316,7 +316,7 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
316 i % 8 == 0 ? "\n " : " "); 316 i % 8 == 0 ? "\n " : " ");
317 317
318 printk("\nlocal cpu%d mask:\n ", cpu); 318 printk("\nlocal cpu%d mask:\n ", cpu);
319 for (i = (NR_EVENT_CHANNELS/BITS_PER_EVTCHN_WORD)-1; i >= 0; i--) 319 for (i = (EVTCHN_2L_NR_CHANNELS/BITS_PER_EVTCHN_WORD)-1; i >= 0; i--)
320 printk("%0*"PRI_xen_ulong"%s", (int)(sizeof(cpu_evtchn[0])*2), 320 printk("%0*"PRI_xen_ulong"%s", (int)(sizeof(cpu_evtchn[0])*2),
321 cpu_evtchn[i], 321 cpu_evtchn[i],
322 i % 8 == 0 ? "\n " : " "); 322 i % 8 == 0 ? "\n " : " ");
@@ -332,7 +332,7 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
332 } 332 }
333 333
334 printk("\npending list:\n"); 334 printk("\npending list:\n");
335 for (i = 0; i < NR_EVENT_CHANNELS; i++) { 335 for (i = 0; i < EVTCHN_2L_NR_CHANNELS; i++) {
336 if (sync_test_bit(i, BM(sh->evtchn_pending))) { 336 if (sync_test_bit(i, BM(sh->evtchn_pending))) {
337 int word_idx = i / BITS_PER_EVTCHN_WORD; 337 int word_idx = i / BITS_PER_EVTCHN_WORD;
338 printk(" %d: event %d -> irq %d%s%s%s\n", 338 printk(" %d: event %d -> irq %d%s%s%s\n",
diff --git a/include/xen/interface/event_channel.h b/include/xen/interface/event_channel.h
index f4942921e202..7e6acef5415b 100644
--- a/include/xen/interface/event_channel.h
+++ b/include/xen/interface/event_channel.h
@@ -190,6 +190,39 @@ struct evtchn_reset {
190}; 190};
191typedef struct evtchn_reset evtchn_reset_t; 191typedef struct evtchn_reset evtchn_reset_t;
192 192
193/*
194 * EVTCHNOP_init_control: initialize the control block for the FIFO ABI.
195 */
196#define EVTCHNOP_init_control 11
197struct evtchn_init_control {
198 /* IN parameters. */
199 uint64_t control_gfn;
200 uint32_t offset;
201 uint32_t vcpu;
202 /* OUT parameters. */
203 uint8_t link_bits;
204 uint8_t _pad[7];
205};
206
207/*
208 * EVTCHNOP_expand_array: add an additional page to the event array.
209 */
210#define EVTCHNOP_expand_array 12
211struct evtchn_expand_array {
212 /* IN parameters. */
213 uint64_t array_gfn;
214};
215
216/*
217 * EVTCHNOP_set_priority: set the priority for an event channel.
218 */
219#define EVTCHNOP_set_priority 13
220struct evtchn_set_priority {
221 /* IN parameters. */
222 uint32_t port;
223 uint32_t priority;
224};
225
193struct evtchn_op { 226struct evtchn_op {
194 uint32_t cmd; /* EVTCHNOP_* */ 227 uint32_t cmd; /* EVTCHNOP_* */
195 union { 228 union {
@@ -207,4 +240,39 @@ struct evtchn_op {
207}; 240};
208DEFINE_GUEST_HANDLE_STRUCT(evtchn_op); 241DEFINE_GUEST_HANDLE_STRUCT(evtchn_op);
209 242
243/*
244 * 2-level ABI
245 */
246
247#define EVTCHN_2L_NR_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
248
249/*
250 * FIFO ABI
251 */
252
253/* Events may have priorities from 0 (highest) to 15 (lowest). */
254#define EVTCHN_FIFO_PRIORITY_MAX 0
255#define EVTCHN_FIFO_PRIORITY_DEFAULT 7
256#define EVTCHN_FIFO_PRIORITY_MIN 15
257
258#define EVTCHN_FIFO_MAX_QUEUES (EVTCHN_FIFO_PRIORITY_MIN + 1)
259
260typedef uint32_t event_word_t;
261
262#define EVTCHN_FIFO_PENDING 31
263#define EVTCHN_FIFO_MASKED 30
264#define EVTCHN_FIFO_LINKED 29
265#define EVTCHN_FIFO_BUSY 28
266
267#define EVTCHN_FIFO_LINK_BITS 17
268#define EVTCHN_FIFO_LINK_MASK ((1 << EVTCHN_FIFO_LINK_BITS) - 1)
269
270#define EVTCHN_FIFO_NR_CHANNELS (1 << EVTCHN_FIFO_LINK_BITS)
271
272struct evtchn_fifo_control_block {
273 uint32_t ready;
274 uint32_t _rsvd;
275 event_word_t head[EVTCHN_FIFO_MAX_QUEUES];
276};
277
210#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */ 278#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 53ec4167bd0b..0cd5ca333fac 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -281,12 +281,6 @@ struct multicall_entry {
281}; 281};
282DEFINE_GUEST_HANDLE_STRUCT(multicall_entry); 282DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
283 283
284/*
285 * Event channel endpoints per domain:
286 * 1024 if a long is 32 bits; 4096 if a long is 64 bits.
287 */
288#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
289
290struct vcpu_time_info { 284struct vcpu_time_info {
291 /* 285 /*
292 * Updates to the following values are preceded and followed 286 * Updates to the following values are preceded and followed