Use of grant references is accomplished via a hypercall. The grant
table op hypercall takes three arguments:
grant_table_op(unsigned int cmd, void *uop, unsigned int count)
cmd indicates the grant table operation of interest. uop
is a pointer to a structure (or an array of structures) describing the
operation to be performed. The count field describes how many
grant table operations are being batched together.
The core logic is situated in xen/common/grant_table.c. The
grant table operation hypercall can be used to perform the following
actions:
- GNTTABOP_map_grant_ref
- Given a grant reference from another
domain, map the referred page into the caller's address space.
- GNTTABOP_unmap_grant_ref
- Remove a mapping to a granted frame
from the caller's address space. This is used to voluntarily
relinquish a mapping to a granted page.
- GNTTABOP_setup_table
- Setup grant table for caller domain.
- GNTTABOP_dump_table
- Debugging operation.
- GNTTABOP_transfer
- Given a transfer reference from another
domain, transfer ownership of a page frame to that domain.