diff options
| author | David Vrabel <david.vrabel@citrix.com> | 2013-03-15 06:55:41 -0400 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2014-01-06 10:07:52 -0500 |
| commit | bf2bbe07f13846a90d4447521d87566d6f87bc0e (patch) | |
| tree | 930d312f8d74a5892fb37429969de6016cc3eb6a /include/xen/interface | |
| parent | 0dc0064add422bc0ef5165ebe9ece3052bbd457d (diff) | |
xen/events: Add the hypervisor interface for the FIFO-based event channels
Add the hypercall sub-ops and the structures for the shared data used
in the FIFO-based event channel ABI.
The design document for this new ABI is available here:
http://xenbits.xen.org/people/dvrabel/event-channels-H.pdf
In summary, events are reported using a per-domain shared event array
of event words. Each event word has PENDING, LINKED and MASKED bits
and a LINK field for pointing to the next event in the event queue.
There are 16 event queues (with different priorities) per-VCPU.
Key advantages of this new ABI include:
- Support for over 100,000 events (2^17).
- 16 different event priorities.
- Improved fairness in event latency through the use of FIFOs.
The ABI is available in Xen 4.4 and later.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'include/xen/interface')
| -rw-r--r-- | include/xen/interface/event_channel.h | 68 | ||||
| -rw-r--r-- | include/xen/interface/xen.h | 6 |
2 files changed, 68 insertions, 6 deletions
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 | }; |
| 191 | typedef struct evtchn_reset evtchn_reset_t; | 191 | typedef 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 | ||
| 197 | struct 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 | ||
| 211 | struct 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 | ||
| 220 | struct evtchn_set_priority { | ||
| 221 | /* IN parameters. */ | ||
| 222 | uint32_t port; | ||
| 223 | uint32_t priority; | ||
| 224 | }; | ||
| 225 | |||
| 193 | struct evtchn_op { | 226 | struct 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 | }; |
| 208 | DEFINE_GUEST_HANDLE_STRUCT(evtchn_op); | 241 | DEFINE_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 | |||
| 260 | typedef 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 | |||
| 272 | struct 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 | }; |
| 282 | DEFINE_GUEST_HANDLE_STRUCT(multicall_entry); | 282 | DEFINE_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 | |||
| 290 | struct vcpu_time_info { | 284 | struct 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 |
