grant_table.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. /******************************************************************************
  2. * grant_table.h
  3. *
  4. * Interface for granting foreign access to page frames, and receiving
  5. * page-ownership transfers.
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8. * of this software and associated documentation files (the "Software"), to
  9. * deal in the Software without restriction, including without limitation the
  10. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  11. * sell copies of the Software, and to permit persons to whom the Software is
  12. * furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in
  15. * all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. * DEALINGS IN THE SOFTWARE.
  24. *
  25. * Copyright (c) 2004, K A Fraser
  26. */
  27. #ifndef __XEN_PUBLIC_GRANT_TABLE_H__
  28. #define __XEN_PUBLIC_GRANT_TABLE_H__
  29. #include <xen/interface/xen.h>
  30. /***********************************
  31. * GRANT TABLE REPRESENTATION
  32. */
  33. /* Some rough guidelines on accessing and updating grant-table entries
  34. * in a concurrency-safe manner. For more information, Linux contains a
  35. * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
  36. *
  37. * NB. WMB is a no-op on current-generation x86 processors. However, a
  38. * compiler barrier will still be required.
  39. *
  40. * Introducing a valid entry into the grant table:
  41. * 1. Write ent->domid.
  42. * 2. Write ent->frame:
  43. * GTF_permit_access: Frame to which access is permitted.
  44. * GTF_accept_transfer: Pseudo-phys frame slot being filled by new
  45. * frame, or zero if none.
  46. * 3. Write memory barrier (WMB).
  47. * 4. Write ent->flags, inc. valid type.
  48. *
  49. * Invalidating an unused GTF_permit_access entry:
  50. * 1. flags = ent->flags.
  51. * 2. Observe that !(flags & (GTF_reading|GTF_writing)).
  52. * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
  53. * NB. No need for WMB as reuse of entry is control-dependent on success of
  54. * step 3, and all architectures guarantee ordering of ctrl-dep writes.
  55. *
  56. * Invalidating an in-use GTF_permit_access entry:
  57. * This cannot be done directly. Request assistance from the domain controller
  58. * which can set a timeout on the use of a grant entry and take necessary
  59. * action. (NB. This is not yet implemented!).
  60. *
  61. * Invalidating an unused GTF_accept_transfer entry:
  62. * 1. flags = ent->flags.
  63. * 2. Observe that !(flags & GTF_transfer_committed). [*]
  64. * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
  65. * NB. No need for WMB as reuse of entry is control-dependent on success of
  66. * step 3, and all architectures guarantee ordering of ctrl-dep writes.
  67. * [*] If GTF_transfer_committed is set then the grant entry is 'committed'.
  68. * The guest must /not/ modify the grant entry until the address of the
  69. * transferred frame is written. It is safe for the guest to spin waiting
  70. * for this to occur (detect by observing GTF_transfer_completed in
  71. * ent->flags).
  72. *
  73. * Invalidating a committed GTF_accept_transfer entry:
  74. * 1. Wait for (ent->flags & GTF_transfer_completed).
  75. *
  76. * Changing a GTF_permit_access from writable to read-only:
  77. * Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
  78. *
  79. * Changing a GTF_permit_access from read-only to writable:
  80. * Use SMP-safe bit-setting instruction.
  81. */
  82. /*
  83. * Reference to a grant entry in a specified domain's grant table.
  84. */
  85. typedef uint32_t grant_ref_t;
  86. /*
  87. * A grant table comprises a packed array of grant entries in one or more
  88. * page frames shared between Xen and a guest.
  89. * [XEN]: This field is written by Xen and read by the sharing guest.
  90. * [GST]: This field is written by the guest and read by Xen.
  91. */
  92. /*
  93. * Version 1 of the grant table entry structure is maintained purely
  94. * for backwards compatibility. New guests should use version 2.
  95. */
  96. struct grant_entry_v1 {
  97. /* GTF_xxx: various type and flag information. [XEN,GST] */
  98. uint16_t flags;
  99. /* The domain being granted foreign privileges. [GST] */
  100. domid_t domid;
  101. /*
  102. * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
  103. * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
  104. */
  105. uint32_t frame;
  106. };
  107. /*
  108. * Type of grant entry.
  109. * GTF_invalid: This grant entry grants no privileges.
  110. * GTF_permit_access: Allow @domid to map/access @frame.
  111. * GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
  112. * to this guest. Xen writes the page number to @frame.
  113. * GTF_transitive: Allow @domid to transitively access a subrange of
  114. * @trans_grant in @trans_domid. No mappings are allowed.
  115. */
  116. #define GTF_invalid (0U<<0)
  117. #define GTF_permit_access (1U<<0)
  118. #define GTF_accept_transfer (2U<<0)
  119. #define GTF_transitive (3U<<0)
  120. #define GTF_type_mask (3U<<0)
  121. /*
  122. * Subflags for GTF_permit_access.
  123. * GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
  124. * GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  125. * GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
  126. * GTF_sub_page: Grant access to only a subrange of the page. @domid
  127. * will only be allowed to copy from the grant, and not
  128. * map it. [GST]
  129. */
  130. #define _GTF_readonly (2)
  131. #define GTF_readonly (1U<<_GTF_readonly)
  132. #define _GTF_reading (3)
  133. #define GTF_reading (1U<<_GTF_reading)
  134. #define _GTF_writing (4)
  135. #define GTF_writing (1U<<_GTF_writing)
  136. #define _GTF_sub_page (8)
  137. #define GTF_sub_page (1U<<_GTF_sub_page)
  138. /*
  139. * Subflags for GTF_accept_transfer:
  140. * GTF_transfer_committed: Xen sets this flag to indicate that it is committed
  141. * to transferring ownership of a page frame. When a guest sees this flag
  142. * it must /not/ modify the grant entry until GTF_transfer_completed is
  143. * set by Xen.
  144. * GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
  145. * after reading GTF_transfer_committed. Xen will always write the frame
  146. * address, followed by ORing this flag, in a timely manner.
  147. */
  148. #define _GTF_transfer_committed (2)
  149. #define GTF_transfer_committed (1U<<_GTF_transfer_committed)
  150. #define _GTF_transfer_completed (3)
  151. #define GTF_transfer_completed (1U<<_GTF_transfer_completed)
  152. /*
  153. * Version 2 grant table entries. These fulfil the same role as
  154. * version 1 entries, but can represent more complicated operations.
  155. * Any given domain will have either a version 1 or a version 2 table,
  156. * and every entry in the table will be the same version.
  157. *
  158. * The interface by which domains use grant references does not depend
  159. * on the grant table version in use by the other domain.
  160. */
  161. /*
  162. * Version 1 and version 2 grant entries share a common prefix. The
  163. * fields of the prefix are documented as part of struct
  164. * grant_entry_v1.
  165. */
  166. struct grant_entry_header {
  167. uint16_t flags;
  168. domid_t domid;
  169. };
  170. /*
  171. * Version 2 of the grant entry structure, here is an union because three
  172. * different types are suppotted: full_page, sub_page and transitive.
  173. */
  174. union grant_entry_v2 {
  175. struct grant_entry_header hdr;
  176. /*
  177. * This member is used for V1-style full page grants, where either:
  178. *
  179. * -- hdr.type is GTF_accept_transfer, or
  180. * -- hdr.type is GTF_permit_access and GTF_sub_page is not set.
  181. *
  182. * In that case, the frame field has the same semantics as the
  183. * field of the same name in the V1 entry structure.
  184. */
  185. struct {
  186. struct grant_entry_header hdr;
  187. uint32_t pad0;
  188. uint64_t frame;
  189. } full_page;
  190. /*
  191. * If the grant type is GTF_grant_access and GTF_sub_page is set,
  192. * @domid is allowed to access bytes [@page_off,@page_off+@length)
  193. * in frame @frame.
  194. */
  195. struct {
  196. struct grant_entry_header hdr;
  197. uint16_t page_off;
  198. uint16_t length;
  199. uint64_t frame;
  200. } sub_page;
  201. /*
  202. * If the grant is GTF_transitive, @domid is allowed to use the
  203. * grant @gref in domain @trans_domid, as if it was the local
  204. * domain. Obviously, the transitive access must be compatible
  205. * with the original grant.
  206. */
  207. struct {
  208. struct grant_entry_header hdr;
  209. domid_t trans_domid;
  210. uint16_t pad0;
  211. grant_ref_t gref;
  212. } transitive;
  213. uint32_t __spacer[4]; /* Pad to a power of two */
  214. };
  215. typedef uint16_t grant_status_t;
  216. /***********************************
  217. * GRANT TABLE QUERIES AND USES
  218. */
  219. /*
  220. * Handle to track a mapping created via a grant reference.
  221. */
  222. typedef uint32_t grant_handle_t;
  223. /*
  224. * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
  225. * by devices and/or host CPUs. If successful, <handle> is a tracking number
  226. * that must be presented later to destroy the mapping(s). On error, <handle>
  227. * is a negative status code.
  228. * NOTES:
  229. * 1. If GNTMAP_device_map is specified then <dev_bus_addr> is the address
  230. * via which I/O devices may access the granted frame.
  231. * 2. If GNTMAP_host_map is specified then a mapping will be added at
  232. * either a host virtual address in the current address space, or at
  233. * a PTE at the specified machine address. The type of mapping to
  234. * perform is selected through the GNTMAP_contains_pte flag, and the
  235. * address is specified in <host_addr>.
  236. * 3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
  237. * host mapping is destroyed by other means then it is *NOT* guaranteed
  238. * to be accounted to the correct grant reference!
  239. */
  240. #define GNTTABOP_map_grant_ref 0
  241. struct gnttab_map_grant_ref {
  242. /* IN parameters. */
  243. uint64_t host_addr;
  244. uint32_t flags; /* GNTMAP_* */
  245. grant_ref_t ref;
  246. domid_t dom;
  247. /* OUT parameters. */
  248. int16_t status; /* GNTST_* */
  249. grant_handle_t handle;
  250. uint64_t dev_bus_addr;
  251. };
  252. DEFINE_GUEST_HANDLE_STRUCT(gnttab_map_grant_ref);
  253. /*
  254. * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
  255. * tracked by <handle>. If <host_addr> or <dev_bus_addr> is zero, that
  256. * field is ignored. If non-zero, they must refer to a device/host mapping
  257. * that is tracked by <handle>
  258. * NOTES:
  259. * 1. The call may fail in an undefined manner if either mapping is not
  260. * tracked by <handle>.
  261. * 3. After executing a batch of unmaps, it is guaranteed that no stale
  262. * mappings will remain in the device or host TLBs.
  263. */
  264. #define GNTTABOP_unmap_grant_ref 1
  265. struct gnttab_unmap_grant_ref {
  266. /* IN parameters. */
  267. uint64_t host_addr;
  268. uint64_t dev_bus_addr;
  269. grant_handle_t handle;
  270. /* OUT parameters. */
  271. int16_t status; /* GNTST_* */
  272. };
  273. DEFINE_GUEST_HANDLE_STRUCT(gnttab_unmap_grant_ref);
  274. /*
  275. * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
  276. * <nr_frames> pages. The frame addresses are written to the <frame_list>.
  277. * Only <nr_frames> addresses are written, even if the table is larger.
  278. * NOTES:
  279. * 1. <dom> may be specified as DOMID_SELF.
  280. * 2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  281. * 3. Xen may not support more than a single grant-table page per domain.
  282. */
  283. #define GNTTABOP_setup_table 2
  284. struct gnttab_setup_table {
  285. /* IN parameters. */
  286. domid_t dom;
  287. uint32_t nr_frames;
  288. /* OUT parameters. */
  289. int16_t status; /* GNTST_* */
  290. GUEST_HANDLE(xen_pfn_t) frame_list;
  291. };
  292. DEFINE_GUEST_HANDLE_STRUCT(gnttab_setup_table);
  293. /*
  294. * GNTTABOP_dump_table: Dump the contents of the grant table to the
  295. * xen console. Debugging use only.
  296. */
  297. #define GNTTABOP_dump_table 3
  298. struct gnttab_dump_table {
  299. /* IN parameters. */
  300. domid_t dom;
  301. /* OUT parameters. */
  302. int16_t status; /* GNTST_* */
  303. };
  304. DEFINE_GUEST_HANDLE_STRUCT(gnttab_dump_table);
  305. /*
  306. * GNTTABOP_transfer_grant_ref: Transfer <frame> to a foreign domain. The
  307. * foreign domain has previously registered its interest in the transfer via
  308. * <domid, ref>.
  309. *
  310. * Note that, even if the transfer fails, the specified page no longer belongs
  311. * to the calling domain *unless* the error is GNTST_bad_page.
  312. */
  313. #define GNTTABOP_transfer 4
  314. struct gnttab_transfer {
  315. /* IN parameters. */
  316. xen_pfn_t mfn;
  317. domid_t domid;
  318. grant_ref_t ref;
  319. /* OUT parameters. */
  320. int16_t status;
  321. };
  322. DEFINE_GUEST_HANDLE_STRUCT(gnttab_transfer);
  323. /*
  324. * GNTTABOP_copy: Hypervisor based copy
  325. * source and destinations can be eithers MFNs or, for foreign domains,
  326. * grant references. the foreign domain has to grant read/write access
  327. * in its grant table.
  328. *
  329. * The flags specify what type source and destinations are (either MFN
  330. * or grant reference).
  331. *
  332. * Note that this can also be used to copy data between two domains
  333. * via a third party if the source and destination domains had previously
  334. * grant appropriate access to their pages to the third party.
  335. *
  336. * source_offset specifies an offset in the source frame, dest_offset
  337. * the offset in the target frame and len specifies the number of
  338. * bytes to be copied.
  339. */
  340. #define _GNTCOPY_source_gref (0)
  341. #define GNTCOPY_source_gref (1<<_GNTCOPY_source_gref)
  342. #define _GNTCOPY_dest_gref (1)
  343. #define GNTCOPY_dest_gref (1<<_GNTCOPY_dest_gref)
  344. #define GNTTABOP_copy 5
  345. struct gnttab_copy {
  346. /* IN parameters. */
  347. struct {
  348. union {
  349. grant_ref_t ref;
  350. xen_pfn_t gmfn;
  351. } u;
  352. domid_t domid;
  353. uint16_t offset;
  354. } source, dest;
  355. uint16_t len;
  356. uint16_t flags; /* GNTCOPY_* */
  357. /* OUT parameters. */
  358. int16_t status;
  359. };
  360. DEFINE_GUEST_HANDLE_STRUCT(gnttab_copy);
  361. /*
  362. * GNTTABOP_query_size: Query the current and maximum sizes of the shared
  363. * grant table.
  364. * NOTES:
  365. * 1. <dom> may be specified as DOMID_SELF.
  366. * 2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  367. */
  368. #define GNTTABOP_query_size 6
  369. struct gnttab_query_size {
  370. /* IN parameters. */
  371. domid_t dom;
  372. /* OUT parameters. */
  373. uint32_t nr_frames;
  374. uint32_t max_nr_frames;
  375. int16_t status; /* GNTST_* */
  376. };
  377. DEFINE_GUEST_HANDLE_STRUCT(gnttab_query_size);
  378. /*
  379. * GNTTABOP_unmap_and_replace: Destroy one or more grant-reference mappings
  380. * tracked by <handle> but atomically replace the page table entry with one
  381. * pointing to the machine address under <new_addr>. <new_addr> will be
  382. * redirected to the null entry.
  383. * NOTES:
  384. * 1. The call may fail in an undefined manner if either mapping is not
  385. * tracked by <handle>.
  386. * 2. After executing a batch of unmaps, it is guaranteed that no stale
  387. * mappings will remain in the device or host TLBs.
  388. */
  389. #define GNTTABOP_unmap_and_replace 7
  390. struct gnttab_unmap_and_replace {
  391. /* IN parameters. */
  392. uint64_t host_addr;
  393. uint64_t new_addr;
  394. grant_handle_t handle;
  395. /* OUT parameters. */
  396. int16_t status; /* GNTST_* */
  397. };
  398. DEFINE_GUEST_HANDLE_STRUCT(gnttab_unmap_and_replace);
  399. /*
  400. * GNTTABOP_set_version: Request a particular version of the grant
  401. * table shared table structure. This operation can only be performed
  402. * once in any given domain. It must be performed before any grants
  403. * are activated; otherwise, the domain will be stuck with version 1.
  404. * The only defined versions are 1 and 2.
  405. */
  406. #define GNTTABOP_set_version 8
  407. struct gnttab_set_version {
  408. /* IN parameters */
  409. uint32_t version;
  410. };
  411. DEFINE_GUEST_HANDLE_STRUCT(gnttab_set_version);
  412. /*
  413. * GNTTABOP_get_status_frames: Get the list of frames used to store grant
  414. * status for <dom>. In grant format version 2, the status is separated
  415. * from the other shared grant fields to allow more efficient synchronization
  416. * using barriers instead of atomic cmpexch operations.
  417. * <nr_frames> specify the size of vector <frame_list>.
  418. * The frame addresses are returned in the <frame_list>.
  419. * Only <nr_frames> addresses are returned, even if the table is larger.
  420. * NOTES:
  421. * 1. <dom> may be specified as DOMID_SELF.
  422. * 2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  423. */
  424. #define GNTTABOP_get_status_frames 9
  425. struct gnttab_get_status_frames {
  426. /* IN parameters. */
  427. uint32_t nr_frames;
  428. domid_t dom;
  429. /* OUT parameters. */
  430. int16_t status; /* GNTST_* */
  431. GUEST_HANDLE(uint64_t) frame_list;
  432. };
  433. DEFINE_GUEST_HANDLE_STRUCT(gnttab_get_status_frames);
  434. /*
  435. * GNTTABOP_get_version: Get the grant table version which is in
  436. * effect for domain <dom>.
  437. */
  438. #define GNTTABOP_get_version 10
  439. struct gnttab_get_version {
  440. /* IN parameters */
  441. domid_t dom;
  442. uint16_t pad;
  443. /* OUT parameters */
  444. uint32_t version;
  445. };
  446. DEFINE_GUEST_HANDLE_STRUCT(gnttab_get_version);
  447. /*
  448. * Issue one or more cache maintenance operations on a portion of a
  449. * page granted to the calling domain by a foreign domain.
  450. */
  451. #define GNTTABOP_cache_flush 12
  452. struct gnttab_cache_flush {
  453. union {
  454. uint64_t dev_bus_addr;
  455. grant_ref_t ref;
  456. } a;
  457. uint16_t offset; /* offset from start of grant */
  458. uint16_t length; /* size within the grant */
  459. #define GNTTAB_CACHE_CLEAN (1<<0)
  460. #define GNTTAB_CACHE_INVAL (1<<1)
  461. #define GNTTAB_CACHE_SOURCE_GREF (1<<31)
  462. uint32_t op;
  463. };
  464. DEFINE_GUEST_HANDLE_STRUCT(gnttab_cache_flush);
  465. /*
  466. * Bitfield values for update_pin_status.flags.
  467. */
  468. /* Map the grant entry for access by I/O devices. */
  469. #define _GNTMAP_device_map (0)
  470. #define GNTMAP_device_map (1<<_GNTMAP_device_map)
  471. /* Map the grant entry for access by host CPUs. */
  472. #define _GNTMAP_host_map (1)
  473. #define GNTMAP_host_map (1<<_GNTMAP_host_map)
  474. /* Accesses to the granted frame will be restricted to read-only access. */
  475. #define _GNTMAP_readonly (2)
  476. #define GNTMAP_readonly (1<<_GNTMAP_readonly)
  477. /*
  478. * GNTMAP_host_map subflag:
  479. * 0 => The host mapping is usable only by the guest OS.
  480. * 1 => The host mapping is usable by guest OS + current application.
  481. */
  482. #define _GNTMAP_application_map (3)
  483. #define GNTMAP_application_map (1<<_GNTMAP_application_map)
  484. /*
  485. * GNTMAP_contains_pte subflag:
  486. * 0 => This map request contains a host virtual address.
  487. * 1 => This map request contains the machine addess of the PTE to update.
  488. */
  489. #define _GNTMAP_contains_pte (4)
  490. #define GNTMAP_contains_pte (1<<_GNTMAP_contains_pte)
  491. /*
  492. * Bits to be placed in guest kernel available PTE bits (architecture
  493. * dependent; only supported when XENFEAT_gnttab_map_avail_bits is set).
  494. */
  495. #define _GNTMAP_guest_avail0 (16)
  496. #define GNTMAP_guest_avail_mask ((uint32_t)~0 << _GNTMAP_guest_avail0)
  497. /*
  498. * Values for error status returns. All errors are -ve.
  499. */
  500. #define GNTST_okay (0) /* Normal return. */
  501. #define GNTST_general_error (-1) /* General undefined error. */
  502. #define GNTST_bad_domain (-2) /* Unrecognsed domain id. */
  503. #define GNTST_bad_gntref (-3) /* Unrecognised or inappropriate gntref. */
  504. #define GNTST_bad_handle (-4) /* Unrecognised or inappropriate handle. */
  505. #define GNTST_bad_virt_addr (-5) /* Inappropriate virtual address to map. */
  506. #define GNTST_bad_dev_addr (-6) /* Inappropriate device address to unmap.*/
  507. #define GNTST_no_device_space (-7) /* Out of space in I/O MMU. */
  508. #define GNTST_permission_denied (-8) /* Not enough privilege for operation. */
  509. #define GNTST_bad_page (-9) /* Specified page was invalid for op. */
  510. #define GNTST_bad_copy_arg (-10) /* copy arguments cross page boundary. */
  511. #define GNTST_address_too_big (-11) /* transfer page address too large. */
  512. #define GNTST_eagain (-12) /* Operation not done; try again. */
  513. #define GNTTABOP_error_msgs { \
  514. "okay", \
  515. "undefined error", \
  516. "unrecognised domain id", \
  517. "invalid grant reference", \
  518. "invalid mapping handle", \
  519. "invalid virtual address", \
  520. "invalid device address", \
  521. "no spare translation slot in the I/O MMU", \
  522. "permission denied", \
  523. "bad page", \
  524. "copy arguments cross page boundary", \
  525. "page address size too large", \
  526. "operation not done; try again" \
  527. }
  528. #endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */