Lines Matching +full:current +full:- +full:reference +full:- +full:control
1 /* SPDX-License-Identifier: MIT */
7 * page-ownership transfers.
45 * table are identified by grant references. A grant reference is an
50 * This capability-based system allows shared-memory communications
51 * between unprivileged domains. A grant reference also encapsulates
62 /* Some rough guidelines on accessing and updating grant-table entries
63 * in a concurrency-safe manner. For more information, Linux contains a
64 * reference implementation for guest OSes (drivers/xen/grant_table.c, see
65 …* http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/xen/grant-table.c;…
67 * NB. WMB is a no-op on current-generation x86 processors. However, a
71 * 1. Write ent->domid.
72 * 2. Write ent->frame:
74 * GTF_accept_transfer: Pseudo-phys frame slot being filled by new
77 * 4. Write ent->flags, inc. valid type.
80 * 1. flags = ent->flags.
82 * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
83 * NB. No need for WMB as reuse of entry is control-dependent on success of
84 * step 3, and all architectures guarantee ordering of ctrl-dep writes.
86 * Invalidating an in-use GTF_permit_access entry:
92 * 1. flags = ent->flags.
94 * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
95 * NB. No need for WMB as reuse of entry is control-dependent on success of
96 * step 3, and all architectures guarantee ordering of ctrl-dep writes.
101 * ent->flags).
104 * 1. Wait for (ent->flags & GTF_transfer_completed).
106 * Changing a GTF_permit_access from writable to read-only:
107 * Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
109 * Changing a GTF_permit_access from read-only to writable:
110 * Use SMP-safe bit-setting instruction.
114 * Reference to a grant entry in a specified domain's grant table.
142 * (non-translated guests only). [XEN]
149 * version changes and may be pre-populated at domain creation by tools.
172 * GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
203 * GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
222 * @args points to an array of a per-command data structure. The array
245 * Handle to track a mapping created via a grant reference.
258 * either a host virtual address in the current address space, or at
264 * to be accounted to the correct grant reference!
281 * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
283 * field is ignored. If non-zero, they must refer to a device/host mapping
308 * 2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
309 * 3. Xen may not support more than a single grant-table page per domain.
338 /* Accesses to the granted frame will be restricted to read-only access. */
344 * 1 => The host mapping is usable by guest OS + current application.
365 * Values for error status returns. All errors are -ve.
369 #define GNTST_general_error (-1) /* General undefined error */
370 #define GNTST_bad_domain (-2) /* Unrecognsed domain id */
371 #define GNTST_bad_gntref (-3) /* Unrecognised or inappropriate gntref */
372 #define GNTST_bad_handle (-4) /* Unrecognised or inappropriate handle */
373 #define GNTST_bad_virt_addr (-5) /* Inappropriate virtual address to map */
374 #define GNTST_bad_dev_addr (-6) /* Inappropriate device address to unmap */
375 #define GNTST_no_device_space (-7) /* Out of space in I/O MMU */
376 #define GNTST_permission_denied (-8) /* Not enough privilege for operation */
377 #define GNTST_bad_page (-9) /* Specified page was invalid for op */
378 #define GNTST_bad_copy_arg (-10) /* copy arguments cross page boundary */
379 #define GNTST_address_too_big (-11) /* transfer page address too large */
380 #define GNTST_eagain (-12) /* Operation not done; try again */
387 "invalid grant reference", \