Grant Table

From Xen
Jump to: navigation, search

General Idea

Interface for granting foreign access to page frames, and receiving page-ownership transfer. Now there are two versions of grant table ABI. Version 1 is maintained for backward compatibility. New guests should use version 2.

Xen's grant tables provide a generic mechanism to memory sharing between domains. This shared memory interface underpins the split device drivers for block and network IO.

Each domain has its own grant table. This is a data structure that is shared with Xen; it allows the domain to tell Xen what kind of permissions other domains have on its pages. Entries in the grant table are identified by grant references. A grant reference is an integer, which indexes into the grant table. It acts as a capability which the grantee can use to perform operations on the granter’s memory.

This capability-based system allows shared-memory communications between unprivileged domains. A grant reference also encapsulates the details of a shared page, removing the need for a domain to know the real machine address of a page it is sharing. This makes it possible to share memory correctly with domains running in fully virtualised memory.

Reference Implementation

For complete and up-to-date information, please refer to Xen header file include/public/grant_table.h. The content of this page is taken from that header file and slightly modified.