A.8 Inter-Domain Communication
Xen provides a simple asynchronous notification mechanism via
event channels. Each domain has a set of end-points (or
ports) which may be bound to an event source (e.g. a physical
IRQ, a virtual IRQ, or an port in another domain). When a pair of
end-points in two different domains are bound together, then a `send'
operation on one will cause an event to be received by the destination
domain.
The control and use of event channels involves the following hypercall:
event_channel_op(evtchn_op_t *op)
Inter-domain event-channel management; op is a discriminated
union which allows the following 7 operations:
- alloc_unbound:
- allocate a free (unbound) local
port and prepare for connection from a specified domain.
- bind_virq:
- bind a local port to a virtual
IRQ; any particular VIRQ can be bound to at most one port per domain.
- bind_pirq:
- bind a local port to a physical IRQ;
once more, a given pIRQ can be bound to at most one port per
domain. Furthermore the calling domain must be sufficiently
privileged.
- bind_interdomain:
- construct an interdomain event
channel; in general, the target domain must have previously allocated
an unbound port for this channel, although this can be bypassed by
privileged domains during domain setup.
- close:
- close an interdomain event channel.
- send:
- send an event to the remote end of a
interdomain event channel.
- status:
- determine the current status of a local port.
For more details see
xen/include/public/event_channel.h.
Event channels are the fundamental communication primitive between
Xen domains and seamlessly support SMP. However they provide little
bandwidth for communication per se, and hence are typically
married with a piece of shared memory to produce effective and
high-performance inter-domain communication.
Safe sharing of memory pages between guest OSes is carried out by
granting access on a per page basis to individual domains. This is
achieved by using the grant_table_op() hypercall.
grant_table_op(unsigned int cmd, void *uop, unsigned int count)
Used to invoke operations on a grant reference, to setup the grant
table and to dump the tables' contents for debugging.