Hypercalls are invoked in a manner analogous to system calls in a
conventional operating system; a software interrupt is issued which
vectors to an entry point within Xen. On x86/32 machines the
instruction required is int $82; the (real) IDT is setup so
that this may only be issued from within ring 1. The particular
hypercall to be invoked is contained in EAX -- a list
mapping these values to symbolic hypercall names can be found
in xen/include/public/xen.h.
On some occasions a set of hypercalls will be required to carry
out a higher-level function; a good example is when a guest
operating wishes to context switch to a new process which
requires updating various privileged CPU state. As an optimization
for these cases, there is a generic mechanism to issue a set of
hypercalls as a batch:
multicall(void *call_list, int nr_calls)
Execute a series of hypervisor calls; nr_calls is the length of
the array of multicall_entry_t structures pointed to be call_list. Each entry contains the hypercall operation code followed
by up to 7 word-sized arguments.
Note that multicalls are provided purely as an optimization; there is
no requirement to use them when first porting a guest operating
system.