Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: MIT */
0002 /******************************************************************************
0003  * grant_table.h
0004  *
0005  * Interface for granting foreign access to page frames, and receiving
0006  * page-ownership transfers.
0007  *
0008  * Copyright (c) 2004, K A Fraser
0009  */
0010 
0011 #ifndef __XEN_PUBLIC_GRANT_TABLE_H__
0012 #define __XEN_PUBLIC_GRANT_TABLE_H__
0013 
0014 #include <xen/interface/xen.h>
0015 
0016 /***********************************
0017  * GRANT TABLE REPRESENTATION
0018  */
0019 
0020 /* Some rough guidelines on accessing and updating grant-table entries
0021  * in a concurrency-safe manner. For more information, Linux contains a
0022  * reference implementation for guest OSes (drivers/xen/grant_table.c, see
0023  * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/xen/grant-table.c;hb=HEAD
0024  *
0025  * NB. WMB is a no-op on current-generation x86 processors. However, a
0026  *     compiler barrier will still be required.
0027  *
0028  * Introducing a valid entry into the grant table:
0029  *  1. Write ent->domid.
0030  *  2. Write ent->frame:
0031  *      GTF_permit_access:   Frame to which access is permitted.
0032  *      GTF_accept_transfer: Pseudo-phys frame slot being filled by new
0033  *                           frame, or zero if none.
0034  *  3. Write memory barrier (WMB).
0035  *  4. Write ent->flags, inc. valid type.
0036  *
0037  * Invalidating an unused GTF_permit_access entry:
0038  *  1. flags = ent->flags.
0039  *  2. Observe that !(flags & (GTF_reading|GTF_writing)).
0040  *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
0041  *  NB. No need for WMB as reuse of entry is control-dependent on success of
0042  *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
0043  *
0044  * Invalidating an in-use GTF_permit_access entry:
0045  *  This cannot be done directly. Request assistance from the domain controller
0046  *  which can set a timeout on the use of a grant entry and take necessary
0047  *  action. (NB. This is not yet implemented!).
0048  *
0049  * Invalidating an unused GTF_accept_transfer entry:
0050  *  1. flags = ent->flags.
0051  *  2. Observe that !(flags & GTF_transfer_committed). [*]
0052  *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
0053  *  NB. No need for WMB as reuse of entry is control-dependent on success of
0054  *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
0055  *  [*] If GTF_transfer_committed is set then the grant entry is 'committed'.
0056  *      The guest must /not/ modify the grant entry until the address of the
0057  *      transferred frame is written. It is safe for the guest to spin waiting
0058  *      for this to occur (detect by observing GTF_transfer_completed in
0059  *      ent->flags).
0060  *
0061  * Invalidating a committed GTF_accept_transfer entry:
0062  *  1. Wait for (ent->flags & GTF_transfer_completed).
0063  *
0064  * Changing a GTF_permit_access from writable to read-only:
0065  *  Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
0066  *
0067  * Changing a GTF_permit_access from read-only to writable:
0068  *  Use SMP-safe bit-setting instruction.
0069  */
0070 
0071 /*
0072  * Reference to a grant entry in a specified domain's grant table.
0073  */
0074 typedef uint32_t grant_ref_t;
0075 
0076 /*
0077  * A grant table comprises a packed array of grant entries in one or more
0078  * page frames shared between Xen and a guest.
0079  * [XEN]: This field is written by Xen and read by the sharing guest.
0080  * [GST]: This field is written by the guest and read by Xen.
0081  */
0082 
0083 /*
0084  * Version 1 of the grant table entry structure is maintained largely for
0085  * backwards compatibility.  New guests are recommended to support using
0086  * version 2 to overcome version 1 limitations, but to default to version 1.
0087  */
0088 struct grant_entry_v1 {
0089     /* GTF_xxx: various type and flag information.  [XEN,GST] */
0090     uint16_t flags;
0091     /* The domain being granted foreign privileges. [GST] */
0092     domid_t  domid;
0093     /*
0094      * GTF_permit_access: GFN that @domid is allowed to map and access. [GST]
0095      * GTF_accept_transfer: GFN that @domid is allowed to transfer into. [GST]
0096      * GTF_transfer_completed: MFN whose ownership transferred by @domid
0097      *                         (non-translated guests only). [XEN]
0098      */
0099     uint32_t frame;
0100 };
0101 
0102 /* The first few grant table entries will be preserved across grant table
0103  * version changes and may be pre-populated at domain creation by tools.
0104  */
0105 #define GNTTAB_NR_RESERVED_ENTRIES     8
0106 #define GNTTAB_RESERVED_CONSOLE        0
0107 #define GNTTAB_RESERVED_XENSTORE       1
0108 
0109 /*
0110  * Type of grant entry.
0111  *  GTF_invalid: This grant entry grants no privileges.
0112  *  GTF_permit_access: Allow @domid to map/access @frame.
0113  *  GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
0114  *                       to this guest. Xen writes the page number to @frame.
0115  *  GTF_transitive: Allow @domid to transitively access a subrange of
0116  *                  @trans_grant in @trans_domid.  No mappings are allowed.
0117  */
0118 #define GTF_invalid         (0U<<0)
0119 #define GTF_permit_access   (1U<<0)
0120 #define GTF_accept_transfer (2U<<0)
0121 #define GTF_transitive      (3U<<0)
0122 #define GTF_type_mask       (3U<<0)
0123 
0124 /*
0125  * Subflags for GTF_permit_access and GTF_transitive.
0126  *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
0127  *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
0128  *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
0129  * Further subflags for GTF_permit_access only.
0130  *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags to be used for
0131  *                             mappings of the grant [GST]
0132  *  GTF_sub_page: Grant access to only a subrange of the page.  @domid
0133  *                will only be allowed to copy from the grant, and not
0134  *                map it. [GST]
0135  */
0136 #define _GTF_readonly       (2)
0137 #define GTF_readonly        (1U<<_GTF_readonly)
0138 #define _GTF_reading        (3)
0139 #define GTF_reading         (1U<<_GTF_reading)
0140 #define _GTF_writing        (4)
0141 #define GTF_writing         (1U<<_GTF_writing)
0142 #define _GTF_PWT            (5)
0143 #define GTF_PWT             (1U<<_GTF_PWT)
0144 #define _GTF_PCD            (6)
0145 #define GTF_PCD             (1U<<_GTF_PCD)
0146 #define _GTF_PAT            (7)
0147 #define GTF_PAT             (1U<<_GTF_PAT)
0148 #define _GTF_sub_page       (8)
0149 #define GTF_sub_page        (1U<<_GTF_sub_page)
0150 
0151 /*
0152  * Subflags for GTF_accept_transfer:
0153  *  GTF_transfer_committed: Xen sets this flag to indicate that it is committed
0154  *      to transferring ownership of a page frame. When a guest sees this flag
0155  *      it must /not/ modify the grant entry until GTF_transfer_completed is
0156  *      set by Xen.
0157  *  GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
0158  *      after reading GTF_transfer_committed. Xen will always write the frame
0159  *      address, followed by ORing this flag, in a timely manner.
0160  */
0161 #define _GTF_transfer_committed (2)
0162 #define GTF_transfer_committed  (1U<<_GTF_transfer_committed)
0163 #define _GTF_transfer_completed (3)
0164 #define GTF_transfer_completed  (1U<<_GTF_transfer_completed)
0165 
0166 /*
0167  * Version 2 grant table entries.  These fulfil the same role as
0168  * version 1 entries, but can represent more complicated operations.
0169  * Any given domain will have either a version 1 or a version 2 table,
0170  * and every entry in the table will be the same version.
0171  *
0172  * The interface by which domains use grant references does not depend
0173  * on the grant table version in use by the other domain.
0174  */
0175 
0176 /*
0177  * Version 1 and version 2 grant entries share a common prefix.  The
0178  * fields of the prefix are documented as part of struct
0179  * grant_entry_v1.
0180  */
0181 struct grant_entry_header {
0182     uint16_t flags;
0183     domid_t  domid;
0184 };
0185 
0186 /*
0187  * Version 2 of the grant entry structure.
0188  */
0189 union grant_entry_v2 {
0190     struct grant_entry_header hdr;
0191 
0192     /*
0193      * This member is used for V1-style full page grants, where either:
0194      *
0195      * -- hdr.type is GTF_accept_transfer, or
0196      * -- hdr.type is GTF_permit_access and GTF_sub_page is not set.
0197      *
0198      * In that case, the frame field has the same semantics as the
0199      * field of the same name in the V1 entry structure.
0200      */
0201     struct {
0202         struct grant_entry_header hdr;
0203         uint32_t pad0;
0204         uint64_t frame;
0205     } full_page;
0206 
0207     /*
0208      * If the grant type is GTF_grant_access and GTF_sub_page is set,
0209      * @domid is allowed to access bytes [@page_off,@page_off+@length)
0210      * in frame @frame.
0211      */
0212     struct {
0213         struct grant_entry_header hdr;
0214         uint16_t page_off;
0215         uint16_t length;
0216         uint64_t frame;
0217     } sub_page;
0218 
0219     /*
0220      * If the grant is GTF_transitive, @domid is allowed to use the
0221      * grant @gref in domain @trans_domid, as if it was the local
0222      * domain.  Obviously, the transitive access must be compatible
0223      * with the original grant.
0224      *
0225      * The current version of Xen does not allow transitive grants
0226      * to be mapped.
0227      */
0228     struct {
0229         struct grant_entry_header hdr;
0230         domid_t trans_domid;
0231         uint16_t pad0;
0232         grant_ref_t gref;
0233     } transitive;
0234 
0235     uint32_t __spacer[4]; /* Pad to a power of two */
0236 };
0237 
0238 typedef uint16_t grant_status_t;
0239 
0240 /***********************************
0241  * GRANT TABLE QUERIES AND USES
0242  */
0243 
0244 #define GNTTABOP_map_grant_ref        0
0245 #define GNTTABOP_unmap_grant_ref      1
0246 #define GNTTABOP_setup_table          2
0247 #define GNTTABOP_dump_table           3
0248 #define GNTTABOP_transfer             4
0249 #define GNTTABOP_copy                 5
0250 #define GNTTABOP_query_size           6
0251 #define GNTTABOP_unmap_and_replace    7
0252 #define GNTTABOP_set_version          8
0253 #define GNTTABOP_get_status_frames    9
0254 #define GNTTABOP_get_version          10
0255 #define GNTTABOP_swap_grant_ref       11
0256 #define GNTTABOP_cache_flush          12
0257 /* ` } */
0258 
0259 /*
0260  * Handle to track a mapping created via a grant reference.
0261  */
0262 typedef uint32_t grant_handle_t;
0263 
0264 /*
0265  * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
0266  * by devices and/or host CPUs. If successful, <handle> is a tracking number
0267  * that must be presented later to destroy the mapping(s). On error, <status>
0268  * is a negative status code.
0269  * NOTES:
0270  *  1. If GNTMAP_device_map is specified then <dev_bus_addr> is the address
0271  *     via which I/O devices may access the granted frame.
0272  *  2. If GNTMAP_host_map is specified then a mapping will be added at
0273  *     either a host virtual address in the current address space, or at
0274  *     a PTE at the specified machine address.  The type of mapping to
0275  *     perform is selected through the GNTMAP_contains_pte flag, and the
0276  *     address is specified in <host_addr>.
0277  *  3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
0278  *     host mapping is destroyed by other means then it is *NOT* guaranteed
0279  *     to be accounted to the correct grant reference!
0280  */
0281 struct gnttab_map_grant_ref {
0282     /* IN parameters. */
0283     uint64_t host_addr;
0284     uint32_t flags;               /* GNTMAP_* */
0285     grant_ref_t ref;
0286     domid_t  dom;
0287     /* OUT parameters. */
0288     int16_t  status;              /* GNTST_* */
0289     grant_handle_t handle;
0290     uint64_t dev_bus_addr;
0291 };
0292 DEFINE_GUEST_HANDLE_STRUCT(gnttab_map_grant_ref);
0293 
0294 /*
0295  * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
0296  * tracked by <handle>. If <host_addr> or <dev_bus_addr> is zero, that
0297  * field is ignored. If non-zero, they must refer to a device/host mapping
0298  * that is tracked by <handle>
0299  * NOTES:
0300  *  1. The call may fail in an undefined manner if either mapping is not
0301  *     tracked by <handle>.
0302  *  3. After executing a batch of unmaps, it is guaranteed that no stale
0303  *     mappings will remain in the device or host TLBs.
0304  */
0305 struct gnttab_unmap_grant_ref {
0306     /* IN parameters. */
0307     uint64_t host_addr;
0308     uint64_t dev_bus_addr;
0309     grant_handle_t handle;
0310     /* OUT parameters. */
0311     int16_t  status;              /* GNTST_* */
0312 };
0313 DEFINE_GUEST_HANDLE_STRUCT(gnttab_unmap_grant_ref);
0314 
0315 /*
0316  * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
0317  * <nr_frames> pages. The frame addresses are written to the <frame_list>.
0318  * Only <nr_frames> addresses are written, even if the table is larger.
0319  * NOTES:
0320  *  1. <dom> may be specified as DOMID_SELF.
0321  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
0322  *  3. Xen may not support more than a single grant-table page per domain.
0323  */
0324 struct gnttab_setup_table {
0325     /* IN parameters. */
0326     domid_t  dom;
0327     uint32_t nr_frames;
0328     /* OUT parameters. */
0329     int16_t  status;              /* GNTST_* */
0330     GUEST_HANDLE(xen_pfn_t) frame_list;
0331 };
0332 DEFINE_GUEST_HANDLE_STRUCT(gnttab_setup_table);
0333 
0334 /*
0335  * GNTTABOP_dump_table: Dump the contents of the grant table to the
0336  * xen console. Debugging use only.
0337  */
0338 struct gnttab_dump_table {
0339     /* IN parameters. */
0340     domid_t dom;
0341     /* OUT parameters. */
0342     int16_t status;               /* GNTST_* */
0343 };
0344 DEFINE_GUEST_HANDLE_STRUCT(gnttab_dump_table);
0345 
0346 /*
0347  * GNTTABOP_transfer: Transfer <frame> to a foreign domain. The foreign domain
0348  * has previously registered its interest in the transfer via <domid, ref>.
0349  *
0350  * Note that, even if the transfer fails, the specified page no longer belongs
0351  * to the calling domain *unless* the error is GNTST_bad_page.
0352  *
0353  * Note further that only PV guests can use this operation.
0354  */
0355 struct gnttab_transfer {
0356     /* IN parameters. */
0357     xen_pfn_t     mfn;
0358     domid_t       domid;
0359     grant_ref_t   ref;
0360     /* OUT parameters. */
0361     int16_t       status;
0362 };
0363 DEFINE_GUEST_HANDLE_STRUCT(gnttab_transfer);
0364 
0365 /*
0366  * GNTTABOP_copy: Hypervisor based copy
0367  * source and destinations can be eithers MFNs or, for foreign domains,
0368  * grant references. the foreign domain has to grant read/write access
0369  * in its grant table.
0370  *
0371  * The flags specify what type source and destinations are (either MFN
0372  * or grant reference).
0373  *
0374  * Note that this can also be used to copy data between two domains
0375  * via a third party if the source and destination domains had previously
0376  * grant appropriate access to their pages to the third party.
0377  *
0378  * source_offset specifies an offset in the source frame, dest_offset
0379  * the offset in the target frame and  len specifies the number of
0380  * bytes to be copied.
0381  */
0382 
0383 #define _GNTCOPY_source_gref      (0)
0384 #define GNTCOPY_source_gref       (1<<_GNTCOPY_source_gref)
0385 #define _GNTCOPY_dest_gref        (1)
0386 #define GNTCOPY_dest_gref         (1<<_GNTCOPY_dest_gref)
0387 
0388 struct gnttab_copy {
0389     /* IN parameters. */
0390     struct gnttab_copy_ptr {
0391         union {
0392             grant_ref_t ref;
0393             xen_pfn_t   gmfn;
0394         } u;
0395         domid_t  domid;
0396         uint16_t offset;
0397     } source, dest;
0398     uint16_t      len;
0399     uint16_t      flags;          /* GNTCOPY_* */
0400     /* OUT parameters. */
0401     int16_t       status;
0402 };
0403 DEFINE_GUEST_HANDLE_STRUCT(gnttab_copy);
0404 
0405 /*
0406  * GNTTABOP_query_size: Query the current and maximum sizes of the shared
0407  * grant table.
0408  * NOTES:
0409  *  1. <dom> may be specified as DOMID_SELF.
0410  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
0411  */
0412 struct gnttab_query_size {
0413     /* IN parameters. */
0414     domid_t  dom;
0415     /* OUT parameters. */
0416     uint32_t nr_frames;
0417     uint32_t max_nr_frames;
0418     int16_t  status;              /* GNTST_* */
0419 };
0420 DEFINE_GUEST_HANDLE_STRUCT(gnttab_query_size);
0421 
0422 /*
0423  * GNTTABOP_unmap_and_replace: Destroy one or more grant-reference mappings
0424  * tracked by <handle> but atomically replace the page table entry with one
0425  * pointing to the machine address under <new_addr>.  <new_addr> will be
0426  * redirected to the null entry.
0427  * NOTES:
0428  *  1. The call may fail in an undefined manner if either mapping is not
0429  *     tracked by <handle>.
0430  *  2. After executing a batch of unmaps, it is guaranteed that no stale
0431  *     mappings will remain in the device or host TLBs.
0432  */
0433 struct gnttab_unmap_and_replace {
0434     /* IN parameters. */
0435     uint64_t host_addr;
0436     uint64_t new_addr;
0437     grant_handle_t handle;
0438     /* OUT parameters. */
0439     int16_t  status;              /* GNTST_* */
0440 };
0441 DEFINE_GUEST_HANDLE_STRUCT(gnttab_unmap_and_replace);
0442 
0443 /*
0444  * GNTTABOP_set_version: Request a particular version of the grant
0445  * table shared table structure.  This operation may be used to toggle
0446  * between different versions, but must be performed while no grants
0447  * are active.  The only defined versions are 1 and 2.
0448  */
0449 struct gnttab_set_version {
0450     /* IN/OUT parameters */
0451     uint32_t version;
0452 };
0453 DEFINE_GUEST_HANDLE_STRUCT(gnttab_set_version);
0454 
0455 /*
0456  * GNTTABOP_get_status_frames: Get the list of frames used to store grant
0457  * status for <dom>. In grant format version 2, the status is separated
0458  * from the other shared grant fields to allow more efficient synchronization
0459  * using barriers instead of atomic cmpexch operations.
0460  * <nr_frames> specify the size of vector <frame_list>.
0461  * The frame addresses are returned in the <frame_list>.
0462  * Only <nr_frames> addresses are returned, even if the table is larger.
0463  * NOTES:
0464  *  1. <dom> may be specified as DOMID_SELF.
0465  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
0466  */
0467 struct gnttab_get_status_frames {
0468     /* IN parameters. */
0469     uint32_t nr_frames;
0470     domid_t  dom;
0471     /* OUT parameters. */
0472     int16_t  status;              /* GNTST_* */
0473     GUEST_HANDLE(uint64_t) frame_list;
0474 };
0475 DEFINE_GUEST_HANDLE_STRUCT(gnttab_get_status_frames);
0476 
0477 /*
0478  * GNTTABOP_get_version: Get the grant table version which is in
0479  * effect for domain <dom>.
0480  */
0481 struct gnttab_get_version {
0482     /* IN parameters */
0483     domid_t dom;
0484     uint16_t pad;
0485     /* OUT parameters */
0486     uint32_t version;
0487 };
0488 DEFINE_GUEST_HANDLE_STRUCT(gnttab_get_version);
0489 
0490 /*
0491  * GNTTABOP_swap_grant_ref: Swap the contents of two grant entries.
0492  */
0493 struct gnttab_swap_grant_ref {
0494     /* IN parameters */
0495     grant_ref_t ref_a;
0496     grant_ref_t ref_b;
0497     /* OUT parameters */
0498     int16_t status;             /* GNTST_* */
0499 };
0500 DEFINE_GUEST_HANDLE_STRUCT(gnttab_swap_grant_ref);
0501 
0502 /*
0503  * Issue one or more cache maintenance operations on a portion of a
0504  * page granted to the calling domain by a foreign domain.
0505  */
0506 struct gnttab_cache_flush {
0507     union {
0508         uint64_t dev_bus_addr;
0509         grant_ref_t ref;
0510     } a;
0511     uint16_t offset; /* offset from start of grant */
0512     uint16_t length; /* size within the grant */
0513 #define GNTTAB_CACHE_CLEAN          (1u<<0)
0514 #define GNTTAB_CACHE_INVAL          (1u<<1)
0515 #define GNTTAB_CACHE_SOURCE_GREF    (1u<<31)
0516     uint32_t op;
0517 };
0518 DEFINE_GUEST_HANDLE_STRUCT(gnttab_cache_flush);
0519 
0520 /*
0521  * Bitfield values for gnttab_map_grant_ref.flags.
0522  */
0523  /* Map the grant entry for access by I/O devices. */
0524 #define _GNTMAP_device_map      (0)
0525 #define GNTMAP_device_map       (1<<_GNTMAP_device_map)
0526  /* Map the grant entry for access by host CPUs. */
0527 #define _GNTMAP_host_map        (1)
0528 #define GNTMAP_host_map         (1<<_GNTMAP_host_map)
0529  /* Accesses to the granted frame will be restricted to read-only access. */
0530 #define _GNTMAP_readonly        (2)
0531 #define GNTMAP_readonly         (1<<_GNTMAP_readonly)
0532  /*
0533   * GNTMAP_host_map subflag:
0534   *  0 => The host mapping is usable only by the guest OS.
0535   *  1 => The host mapping is usable by guest OS + current application.
0536   */
0537 #define _GNTMAP_application_map (3)
0538 #define GNTMAP_application_map  (1<<_GNTMAP_application_map)
0539 
0540  /*
0541   * GNTMAP_contains_pte subflag:
0542   *  0 => This map request contains a host virtual address.
0543   *  1 => This map request contains the machine addess of the PTE to update.
0544   */
0545 #define _GNTMAP_contains_pte    (4)
0546 #define GNTMAP_contains_pte     (1<<_GNTMAP_contains_pte)
0547 
0548 /*
0549  * Bits to be placed in guest kernel available PTE bits (architecture
0550  * dependent; only supported when XENFEAT_gnttab_map_avail_bits is set).
0551  */
0552 #define _GNTMAP_guest_avail0    (16)
0553 #define GNTMAP_guest_avail_mask ((uint32_t)~0 << _GNTMAP_guest_avail0)
0554 
0555 /*
0556  * Values for error status returns. All errors are -ve.
0557  */
0558 #define GNTST_okay             (0)  /* Normal return.                        */
0559 #define GNTST_general_error    (-1) /* General undefined error.              */
0560 #define GNTST_bad_domain       (-2) /* Unrecognsed domain id.                */
0561 #define GNTST_bad_gntref       (-3) /* Unrecognised or inappropriate gntref. */
0562 #define GNTST_bad_handle       (-4) /* Unrecognised or inappropriate handle. */
0563 #define GNTST_bad_virt_addr    (-5) /* Inappropriate virtual address to map. */
0564 #define GNTST_bad_dev_addr     (-6) /* Inappropriate device address to unmap.*/
0565 #define GNTST_no_device_space  (-7) /* Out of space in I/O MMU.              */
0566 #define GNTST_permission_denied (-8) /* Not enough privilege for operation.  */
0567 #define GNTST_bad_page         (-9) /* Specified page was invalid for op.    */
0568 #define GNTST_bad_copy_arg    (-10) /* copy arguments cross page boundary.   */
0569 #define GNTST_address_too_big (-11) /* transfer page address too large.      */
0570 #define GNTST_eagain          (-12) /* Operation not done; try again.        */
0571 #define GNTST_no_space        (-13) /* Out of space (handles etc).           */
0572 
0573 #define GNTTABOP_error_msgs {                   \
0574     "okay",                                     \
0575     "undefined error",                          \
0576     "unrecognised domain id",                   \
0577     "invalid grant reference",                  \
0578     "invalid mapping handle",                   \
0579     "invalid virtual address",                  \
0580     "invalid device address",                   \
0581     "no spare translation slot in the I/O MMU", \
0582     "permission denied",                        \
0583     "bad page",                                 \
0584     "copy arguments cross page boundary",       \
0585     "page address size too large",              \
0586     "operation not done; try again",            \
0587     "out of space",                             \
0588 }
0589 
0590 #endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */