diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2011-10-06 19:28:53 +0100 |
---|---|---|
committer | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2011-10-06 19:28:53 +0100 |
commit | 1f5552006de96f879ea0bcf342dcf4d9b3b06354 (patch) | |
tree | ea023d0ddf2f20b6590c98f49c83fa4fdb811064 /tools/libxc/xenctrl.h | |
parent | b7ee8d2f432f726a1154d172016d3f2b22757fe3 (diff) | |
download | xen-1f5552006de96f879ea0bcf342dcf4d9b3b06354.tar.gz xen-1f5552006de96f879ea0bcf342dcf4d9b3b06354.tar.bz2 xen-1f5552006de96f879ea0bcf342dcf4d9b3b06354.zip |
libxc: add xc_gnttab_map_grant_ref_notify
Normally, when a userspace process mapping a grant crashes, the domain
providing the reference receives no indication that its peer has
crashed, possibly leading to unexpected freezes or timeouts. This
function provides a notification of the unmap by signalling an event
channel and/or clearing a specific byte in the page.
This also unifies the 3 very similar grant-mapping osdep interfaces into
a single function instead of introducing yet another minor variation.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxc/xenctrl.h')
-rw-r--r-- | tools/libxc/xenctrl.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index 3a6071f114..0e3c25edf1 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -1349,6 +1349,29 @@ void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg, uint32_t *refs, int prot); +/** + * Memory maps a grant reference from one domain to a local address range. + * Mappings should be unmapped with xc_gnttab_munmap. If notify_offset or + * notify_port are not -1, this version will attempt to set up an unmap + * notification at the given offset and event channel. When the page is + * unmapped, the byte at the given offset will be zeroed and a wakeup will be + * sent to the given event channel. Logs errors. + * + * @parm xcg a handle on an open grant table interface + * @parm domid the domain to map memory from + * @parm ref the grant reference ID to map + * @parm prot same flag as in mmap() + * @parm notify_offset The byte offset in the page to use for unmap + * notification; -1 for none. + * @parm notify_port The event channel port to use for unmap notify, or -1 + */ +void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg, + uint32_t domid, + uint32_t ref, + int prot, + uint32_t notify_offset, + evtchn_port_t notify_port); + /* * Unmaps the @count pages starting at @start_address, which were mapped by a * call to xc_gnttab_map_grant_ref or xc_gnttab_map_grant_refs. Never logs. |