Home | History | Annotate | Line # | Download | only in public
      1  1.1  cherry /******************************************************************************
      2  1.1  cherry  * domctl.h
      3  1.1  cherry  *
      4  1.1  cherry  * Domain management operations. For use by node control stack.
      5  1.1  cherry  *
      6  1.1  cherry  * Permission is hereby granted, free of charge, to any person obtaining a copy
      7  1.1  cherry  * of this software and associated documentation files (the "Software"), to
      8  1.1  cherry  * deal in the Software without restriction, including without limitation the
      9  1.1  cherry  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
     10  1.1  cherry  * sell copies of the Software, and to permit persons to whom the Software is
     11  1.1  cherry  * furnished to do so, subject to the following conditions:
     12  1.1  cherry  *
     13  1.1  cherry  * The above copyright notice and this permission notice shall be included in
     14  1.1  cherry  * all copies or substantial portions of the Software.
     15  1.1  cherry  *
     16  1.1  cherry  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17  1.1  cherry  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18  1.1  cherry  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     19  1.1  cherry  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     20  1.1  cherry  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     21  1.1  cherry  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     22  1.1  cherry  * DEALINGS IN THE SOFTWARE.
     23  1.1  cherry  *
     24  1.1  cherry  * Copyright (c) 2002-2003, B Dragovic
     25  1.1  cherry  * Copyright (c) 2002-2006, K Fraser
     26  1.1  cherry  */
     27  1.1  cherry 
     28  1.1  cherry #ifndef __XEN_PUBLIC_DOMCTL_H__
     29  1.1  cherry #define __XEN_PUBLIC_DOMCTL_H__
     30  1.1  cherry 
     31  1.1  cherry #if !defined(__XEN__) && !defined(__XEN_TOOLS__)
     32  1.1  cherry #error "domctl operations are intended for use by node control tools only"
     33  1.1  cherry #endif
     34  1.1  cherry 
     35  1.1  cherry #include "xen.h"
     36  1.1  cherry #include "event_channel.h"
     37  1.1  cherry #include "grant_table.h"
     38  1.1  cherry #include "hvm/save.h"
     39  1.1  cherry #include "memory.h"
     40  1.1  cherry 
     41  1.1  cherry #define XEN_DOMCTL_INTERFACE_VERSION 0x00000010
     42  1.1  cherry 
     43  1.1  cherry /*
     44  1.1  cherry  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
     45  1.1  cherry  * If it is specified as zero, an id is auto-allocated and returned.
     46  1.1  cherry  */
     47  1.1  cherry /* XEN_DOMCTL_createdomain */
     48  1.1  cherry struct xen_domctl_createdomain {
     49  1.1  cherry     /* IN parameters */
     50  1.1  cherry     uint32_t ssidref;
     51  1.1  cherry     xen_domain_handle_t handle;
     52  1.1  cherry  /* Is this an HVM guest (as opposed to a PVH or PV guest)? */
     53  1.1  cherry #define _XEN_DOMCTL_CDF_hvm_guest     0
     54  1.1  cherry #define XEN_DOMCTL_CDF_hvm_guest      (1U<<_XEN_DOMCTL_CDF_hvm_guest)
     55  1.1  cherry  /* Use hardware-assisted paging if available? */
     56  1.1  cherry #define _XEN_DOMCTL_CDF_hap           1
     57  1.1  cherry #define XEN_DOMCTL_CDF_hap            (1U<<_XEN_DOMCTL_CDF_hap)
     58  1.1  cherry  /* Should domain memory integrity be verifed by tboot during Sx? */
     59  1.1  cherry #define _XEN_DOMCTL_CDF_s3_integrity  2
     60  1.1  cherry #define XEN_DOMCTL_CDF_s3_integrity   (1U<<_XEN_DOMCTL_CDF_s3_integrity)
     61  1.1  cherry  /* Disable out-of-sync shadow page tables? */
     62  1.1  cherry #define _XEN_DOMCTL_CDF_oos_off       3
     63  1.1  cherry #define XEN_DOMCTL_CDF_oos_off        (1U<<_XEN_DOMCTL_CDF_oos_off)
     64  1.1  cherry  /* Is this a xenstore domain? */
     65  1.1  cherry #define _XEN_DOMCTL_CDF_xs_domain     4
     66  1.1  cherry #define XEN_DOMCTL_CDF_xs_domain      (1U<<_XEN_DOMCTL_CDF_xs_domain)
     67  1.1  cherry     uint32_t flags;
     68  1.1  cherry     struct xen_arch_domainconfig arch;
     69  1.1  cherry };
     70  1.1  cherry 
     71  1.1  cherry /* XEN_DOMCTL_getdomaininfo */
     72  1.1  cherry struct xen_domctl_getdomaininfo {
     73  1.1  cherry     /* OUT variables. */
     74  1.1  cherry     domid_t  domain;              /* Also echoed in domctl.domain */
     75  1.1  cherry  /* Domain is scheduled to die. */
     76  1.1  cherry #define _XEN_DOMINF_dying     0
     77  1.1  cherry #define XEN_DOMINF_dying      (1U<<_XEN_DOMINF_dying)
     78  1.1  cherry  /* Domain is an HVM guest (as opposed to a PV guest). */
     79  1.1  cherry #define _XEN_DOMINF_hvm_guest 1
     80  1.1  cherry #define XEN_DOMINF_hvm_guest  (1U<<_XEN_DOMINF_hvm_guest)
     81  1.1  cherry  /* The guest OS has shut down. */
     82  1.1  cherry #define _XEN_DOMINF_shutdown  2
     83  1.1  cherry #define XEN_DOMINF_shutdown   (1U<<_XEN_DOMINF_shutdown)
     84  1.1  cherry  /* Currently paused by control software. */
     85  1.1  cherry #define _XEN_DOMINF_paused    3
     86  1.1  cherry #define XEN_DOMINF_paused     (1U<<_XEN_DOMINF_paused)
     87  1.1  cherry  /* Currently blocked pending an event.     */
     88  1.1  cherry #define _XEN_DOMINF_blocked   4
     89  1.1  cherry #define XEN_DOMINF_blocked    (1U<<_XEN_DOMINF_blocked)
     90  1.1  cherry  /* Domain is currently running.            */
     91  1.1  cherry #define _XEN_DOMINF_running   5
     92  1.1  cherry #define XEN_DOMINF_running    (1U<<_XEN_DOMINF_running)
     93  1.1  cherry  /* Being debugged.  */
     94  1.1  cherry #define _XEN_DOMINF_debugged  6
     95  1.1  cherry #define XEN_DOMINF_debugged   (1U<<_XEN_DOMINF_debugged)
     96  1.1  cherry /* domain is a xenstore domain */
     97  1.1  cherry #define _XEN_DOMINF_xs_domain 7
     98  1.1  cherry #define XEN_DOMINF_xs_domain  (1U<<_XEN_DOMINF_xs_domain)
     99  1.1  cherry /* domain has hardware assisted paging */
    100  1.1  cherry #define _XEN_DOMINF_hap       8
    101  1.1  cherry #define XEN_DOMINF_hap        (1U<<_XEN_DOMINF_hap)
    102  1.1  cherry  /* XEN_DOMINF_shutdown guest-supplied code.  */
    103  1.1  cherry #define XEN_DOMINF_shutdownmask 255
    104  1.1  cherry #define XEN_DOMINF_shutdownshift 16
    105  1.1  cherry     uint32_t flags;              /* XEN_DOMINF_* */
    106  1.1  cherry     uint64_aligned_t tot_pages;
    107  1.1  cherry     uint64_aligned_t max_pages;
    108  1.1  cherry     uint64_aligned_t outstanding_pages;
    109  1.1  cherry     uint64_aligned_t shr_pages;
    110  1.1  cherry     uint64_aligned_t paged_pages;
    111  1.1  cherry     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
    112  1.1  cherry     uint64_aligned_t cpu_time;
    113  1.1  cherry     uint32_t nr_online_vcpus;    /* Number of VCPUs currently online. */
    114  1.1  cherry #define XEN_INVALID_MAX_VCPU_ID (~0U) /* Domain has no vcpus? */
    115  1.1  cherry     uint32_t max_vcpu_id;        /* Maximum VCPUID in use by this domain. */
    116  1.1  cherry     uint32_t ssidref;
    117  1.1  cherry     xen_domain_handle_t handle;
    118  1.1  cherry     uint32_t cpupool;
    119  1.1  cherry     struct xen_arch_domainconfig arch_config;
    120  1.1  cherry };
    121  1.1  cherry typedef struct xen_domctl_getdomaininfo xen_domctl_getdomaininfo_t;
    122  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t);
    123  1.1  cherry 
    124  1.1  cherry 
    125  1.1  cherry /* XEN_DOMCTL_getpageframeinfo */
    126  1.1  cherry 
    127  1.1  cherry #define XEN_DOMCTL_PFINFO_LTAB_SHIFT 28
    128  1.1  cherry #define XEN_DOMCTL_PFINFO_NOTAB   (0x0U<<28)
    129  1.1  cherry #define XEN_DOMCTL_PFINFO_L1TAB   (0x1U<<28)
    130  1.1  cherry #define XEN_DOMCTL_PFINFO_L2TAB   (0x2U<<28)
    131  1.1  cherry #define XEN_DOMCTL_PFINFO_L3TAB   (0x3U<<28)
    132  1.1  cherry #define XEN_DOMCTL_PFINFO_L4TAB   (0x4U<<28)
    133  1.1  cherry #define XEN_DOMCTL_PFINFO_LTABTYPE_MASK (0x7U<<28)
    134  1.1  cherry #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
    135  1.1  cherry #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
    136  1.1  cherry #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
    137  1.1  cherry #define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
    138  1.1  cherry #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
    139  1.1  cherry 
    140  1.1  cherry /* XEN_DOMCTL_getpageframeinfo3 */
    141  1.1  cherry struct xen_domctl_getpageframeinfo3 {
    142  1.1  cherry     /* IN variables. */
    143  1.1  cherry     uint64_aligned_t num;
    144  1.1  cherry     /* IN/OUT variables. */
    145  1.1  cherry     XEN_GUEST_HANDLE_64(xen_pfn_t) array;
    146  1.1  cherry };
    147  1.1  cherry 
    148  1.1  cherry 
    149  1.1  cherry /*
    150  1.1  cherry  * Control shadow pagetables operation
    151  1.1  cherry  */
    152  1.1  cherry /* XEN_DOMCTL_shadow_op */
    153  1.1  cherry 
    154  1.1  cherry /* Disable shadow mode. */
    155  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_OFF         0
    156  1.1  cherry 
    157  1.1  cherry /* Enable shadow mode (mode contains ORed XEN_DOMCTL_SHADOW_ENABLE_* flags). */
    158  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_ENABLE      32
    159  1.1  cherry 
    160  1.1  cherry /* Log-dirty bitmap operations. */
    161  1.1  cherry  /* Return the bitmap and clean internal copy for next round. */
    162  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_CLEAN       11
    163  1.1  cherry  /* Return the bitmap but do not modify internal copy. */
    164  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_PEEK        12
    165  1.1  cherry 
    166  1.1  cherry /* Memory allocation accessors. */
    167  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION   30
    168  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION   31
    169  1.1  cherry 
    170  1.1  cherry /* Legacy enable operations. */
    171  1.1  cherry  /* Equiv. to ENABLE with no mode flags. */
    172  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_ENABLE_TEST       1
    173  1.1  cherry  /* Equiv. to ENABLE with mode flag ENABLE_LOG_DIRTY. */
    174  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY   2
    175  1.1  cherry  /*
    176  1.1  cherry   * No longer supported, was equiv. to ENABLE with mode flags
    177  1.1  cherry   * ENABLE_REFCOUNT and ENABLE_TRANSLATE:
    178  1.1  cherry #define XEN_DOMCTL_SHADOW_OP_ENABLE_TRANSLATE  3
    179  1.1  cherry   */
    180  1.1  cherry 
    181  1.1  cherry /* Mode flags for XEN_DOMCTL_SHADOW_OP_ENABLE. */
    182  1.1  cherry  /*
    183  1.1  cherry   * Shadow pagetables are refcounted: guest does not use explicit mmu
    184  1.1  cherry   * operations nor write-protect its pagetables.
    185  1.1  cherry   */
    186  1.1  cherry #define XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT  (1 << 1)
    187  1.1  cherry  /*
    188  1.1  cherry   * Log pages in a bitmap as they are dirtied.
    189  1.1  cherry   * Used for live relocation to determine which pages must be re-sent.
    190  1.1  cherry   */
    191  1.1  cherry #define XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY (1 << 2)
    192  1.1  cherry  /*
    193  1.1  cherry   * Automatically translate GPFNs into MFNs.
    194  1.1  cherry   */
    195  1.1  cherry #define XEN_DOMCTL_SHADOW_ENABLE_TRANSLATE (1 << 3)
    196  1.1  cherry  /*
    197  1.1  cherry   * Xen does not steal virtual address space from the guest.
    198  1.1  cherry   * Requires HVM support.
    199  1.1  cherry   */
    200  1.1  cherry #define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL  (1 << 4)
    201  1.1  cherry 
    202  1.1  cherry /* Mode flags for XEN_DOMCTL_SHADOW_OP_{CLEAN,PEEK}. */
    203  1.1  cherry  /*
    204  1.1  cherry   * This is the final iteration: Requesting to include pages mapped
    205  1.1  cherry   * writably by the hypervisor in the dirty bitmap.
    206  1.1  cherry   */
    207  1.1  cherry #define XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL   (1 << 0)
    208  1.1  cherry 
    209  1.1  cherry struct xen_domctl_shadow_op_stats {
    210  1.1  cherry     uint32_t fault_count;
    211  1.1  cherry     uint32_t dirty_count;
    212  1.1  cherry };
    213  1.1  cherry 
    214  1.1  cherry struct xen_domctl_shadow_op {
    215  1.1  cherry     /* IN variables. */
    216  1.1  cherry     uint32_t       op;       /* XEN_DOMCTL_SHADOW_OP_* */
    217  1.1  cherry 
    218  1.1  cherry     /* OP_ENABLE: XEN_DOMCTL_SHADOW_ENABLE_* */
    219  1.1  cherry     /* OP_PEAK / OP_CLEAN: XEN_DOMCTL_SHADOW_LOGDIRTY_* */
    220  1.1  cherry     uint32_t       mode;
    221  1.1  cherry 
    222  1.1  cherry     /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */
    223  1.1  cherry     uint32_t       mb;       /* Shadow memory allocation in MB */
    224  1.1  cherry 
    225  1.1  cherry     /* OP_PEEK / OP_CLEAN */
    226  1.1  cherry     XEN_GUEST_HANDLE_64(uint8) dirty_bitmap;
    227  1.1  cherry     uint64_aligned_t pages; /* Size of buffer. Updated with actual size. */
    228  1.1  cherry     struct xen_domctl_shadow_op_stats stats;
    229  1.1  cherry };
    230  1.1  cherry 
    231  1.1  cherry 
    232  1.1  cherry /* XEN_DOMCTL_max_mem */
    233  1.1  cherry struct xen_domctl_max_mem {
    234  1.1  cherry     /* IN variables. */
    235  1.1  cherry     uint64_aligned_t max_memkb;
    236  1.1  cherry };
    237  1.1  cherry 
    238  1.1  cherry 
    239  1.1  cherry /* XEN_DOMCTL_setvcpucontext */
    240  1.1  cherry /* XEN_DOMCTL_getvcpucontext */
    241  1.1  cherry struct xen_domctl_vcpucontext {
    242  1.1  cherry     uint32_t              vcpu;                  /* IN */
    243  1.1  cherry     XEN_GUEST_HANDLE_64(vcpu_guest_context_t) ctxt; /* IN/OUT */
    244  1.1  cherry };
    245  1.1  cherry 
    246  1.1  cherry 
    247  1.1  cherry /* XEN_DOMCTL_getvcpuinfo */
    248  1.1  cherry struct xen_domctl_getvcpuinfo {
    249  1.1  cherry     /* IN variables. */
    250  1.1  cherry     uint32_t vcpu;
    251  1.1  cherry     /* OUT variables. */
    252  1.1  cherry     uint8_t  online;                  /* currently online (not hotplugged)? */
    253  1.1  cherry     uint8_t  blocked;                 /* blocked waiting for an event? */
    254  1.1  cherry     uint8_t  running;                 /* currently scheduled on its CPU? */
    255  1.1  cherry     uint64_aligned_t cpu_time;        /* total cpu time consumed (ns) */
    256  1.1  cherry     uint32_t cpu;                     /* current mapping   */
    257  1.1  cherry };
    258  1.1  cherry 
    259  1.1  cherry 
    260  1.1  cherry /* Get/set the NUMA node(s) with which the guest has affinity with. */
    261  1.1  cherry /* XEN_DOMCTL_setnodeaffinity */
    262  1.1  cherry /* XEN_DOMCTL_getnodeaffinity */
    263  1.1  cherry struct xen_domctl_nodeaffinity {
    264  1.1  cherry     struct xenctl_bitmap nodemap;/* IN */
    265  1.1  cherry };
    266  1.1  cherry 
    267  1.1  cherry 
    268  1.1  cherry /* Get/set which physical cpus a vcpu can execute on. */
    269  1.1  cherry /* XEN_DOMCTL_setvcpuaffinity */
    270  1.1  cherry /* XEN_DOMCTL_getvcpuaffinity */
    271  1.1  cherry struct xen_domctl_vcpuaffinity {
    272  1.1  cherry     /* IN variables. */
    273  1.1  cherry     uint32_t  vcpu;
    274  1.1  cherry  /* Set/get the hard affinity for vcpu */
    275  1.1  cherry #define _XEN_VCPUAFFINITY_HARD  0
    276  1.1  cherry #define XEN_VCPUAFFINITY_HARD   (1U<<_XEN_VCPUAFFINITY_HARD)
    277  1.1  cherry  /* Set/get the soft affinity for vcpu */
    278  1.1  cherry #define _XEN_VCPUAFFINITY_SOFT  1
    279  1.1  cherry #define XEN_VCPUAFFINITY_SOFT   (1U<<_XEN_VCPUAFFINITY_SOFT)
    280  1.1  cherry  /* Undo SCHEDOP_pin_override */
    281  1.1  cherry #define _XEN_VCPUAFFINITY_FORCE 2
    282  1.1  cherry #define XEN_VCPUAFFINITY_FORCE  (1U<<_XEN_VCPUAFFINITY_FORCE)
    283  1.1  cherry     uint32_t flags;
    284  1.1  cherry     /*
    285  1.1  cherry      * IN/OUT variables.
    286  1.1  cherry      *
    287  1.1  cherry      * Both are IN/OUT for XEN_DOMCTL_setvcpuaffinity, in which case they
    288  1.1  cherry      * contain effective hard or/and soft affinity. That is, upon successful
    289  1.1  cherry      * return, cpumap_soft, contains the intersection of the soft affinity,
    290  1.1  cherry      * hard affinity and the cpupool's online CPUs for the domain (if
    291  1.1  cherry      * XEN_VCPUAFFINITY_SOFT was set in flags). cpumap_hard contains the
    292  1.1  cherry      * intersection between hard affinity and the cpupool's online CPUs (if
    293  1.1  cherry      * XEN_VCPUAFFINITY_HARD was set in flags).
    294  1.1  cherry      *
    295  1.1  cherry      * Both are OUT-only for XEN_DOMCTL_getvcpuaffinity, in which case they
    296  1.1  cherry      * contain the plain hard and/or soft affinity masks that were set during
    297  1.1  cherry      * previous successful calls to XEN_DOMCTL_setvcpuaffinity (or the
    298  1.1  cherry      * default values), without intersecting or altering them in any way.
    299  1.1  cherry      */
    300  1.1  cherry     struct xenctl_bitmap cpumap_hard;
    301  1.1  cherry     struct xenctl_bitmap cpumap_soft;
    302  1.1  cherry };
    303  1.1  cherry 
    304  1.1  cherry 
    305  1.1  cherry /* XEN_DOMCTL_max_vcpus */
    306  1.1  cherry struct xen_domctl_max_vcpus {
    307  1.1  cherry     uint32_t max;           /* maximum number of vcpus */
    308  1.1  cherry };
    309  1.1  cherry 
    310  1.1  cherry 
    311  1.1  cherry /* XEN_DOMCTL_scheduler_op */
    312  1.1  cherry /* Scheduler types. */
    313  1.1  cherry /* #define XEN_SCHEDULER_SEDF  4 (Removed) */
    314  1.1  cherry #define XEN_SCHEDULER_CREDIT   5
    315  1.1  cherry #define XEN_SCHEDULER_CREDIT2  6
    316  1.1  cherry #define XEN_SCHEDULER_ARINC653 7
    317  1.1  cherry #define XEN_SCHEDULER_RTDS     8
    318  1.1  cherry #define XEN_SCHEDULER_NULL     9
    319  1.1  cherry 
    320  1.1  cherry struct xen_domctl_sched_credit {
    321  1.1  cherry     uint16_t weight;
    322  1.1  cherry     uint16_t cap;
    323  1.1  cherry };
    324  1.1  cherry 
    325  1.1  cherry struct xen_domctl_sched_credit2 {
    326  1.1  cherry     uint16_t weight;
    327  1.1  cherry     uint16_t cap;
    328  1.1  cherry };
    329  1.1  cherry 
    330  1.1  cherry struct xen_domctl_sched_rtds {
    331  1.1  cherry     uint32_t period;
    332  1.1  cherry     uint32_t budget;
    333  1.1  cherry /* Can this vCPU execute beyond its reserved amount of time? */
    334  1.1  cherry #define _XEN_DOMCTL_SCHEDRT_extra   0
    335  1.1  cherry #define XEN_DOMCTL_SCHEDRT_extra    (1U<<_XEN_DOMCTL_SCHEDRT_extra)
    336  1.1  cherry     uint32_t flags;
    337  1.1  cherry };
    338  1.1  cherry 
    339  1.1  cherry typedef struct xen_domctl_schedparam_vcpu {
    340  1.1  cherry     union {
    341  1.1  cherry         struct xen_domctl_sched_credit credit;
    342  1.1  cherry         struct xen_domctl_sched_credit2 credit2;
    343  1.1  cherry         struct xen_domctl_sched_rtds rtds;
    344  1.1  cherry     } u;
    345  1.1  cherry     uint32_t vcpuid;
    346  1.1  cherry } xen_domctl_schedparam_vcpu_t;
    347  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_domctl_schedparam_vcpu_t);
    348  1.1  cherry 
    349  1.1  cherry /*
    350  1.1  cherry  * Set or get info?
    351  1.1  cherry  * For schedulers supporting per-vcpu settings (e.g., RTDS):
    352  1.1  cherry  *  XEN_DOMCTL_SCHEDOP_putinfo sets params for all vcpus;
    353  1.1  cherry  *  XEN_DOMCTL_SCHEDOP_getinfo gets default params;
    354  1.1  cherry  *  XEN_DOMCTL_SCHEDOP_put(get)vcpuinfo sets (gets) params of vcpus;
    355  1.1  cherry  *
    356  1.1  cherry  * For schedulers not supporting per-vcpu settings:
    357  1.1  cherry  *  XEN_DOMCTL_SCHEDOP_putinfo sets params for all vcpus;
    358  1.1  cherry  *  XEN_DOMCTL_SCHEDOP_getinfo gets domain-wise params;
    359  1.1  cherry  *  XEN_DOMCTL_SCHEDOP_put(get)vcpuinfo returns error;
    360  1.1  cherry  */
    361  1.1  cherry #define XEN_DOMCTL_SCHEDOP_putinfo 0
    362  1.1  cherry #define XEN_DOMCTL_SCHEDOP_getinfo 1
    363  1.1  cherry #define XEN_DOMCTL_SCHEDOP_putvcpuinfo 2
    364  1.1  cherry #define XEN_DOMCTL_SCHEDOP_getvcpuinfo 3
    365  1.1  cherry struct xen_domctl_scheduler_op {
    366  1.1  cherry     uint32_t sched_id;  /* XEN_SCHEDULER_* */
    367  1.1  cherry     uint32_t cmd;       /* XEN_DOMCTL_SCHEDOP_* */
    368  1.1  cherry     /* IN/OUT */
    369  1.1  cherry     union {
    370  1.1  cherry         struct xen_domctl_sched_credit credit;
    371  1.1  cherry         struct xen_domctl_sched_credit2 credit2;
    372  1.1  cherry         struct xen_domctl_sched_rtds rtds;
    373  1.1  cherry         struct {
    374  1.1  cherry             XEN_GUEST_HANDLE_64(xen_domctl_schedparam_vcpu_t) vcpus;
    375  1.1  cherry             /*
    376  1.1  cherry              * IN: Number of elements in vcpus array.
    377  1.1  cherry              * OUT: Number of processed elements of vcpus array.
    378  1.1  cherry              */
    379  1.1  cherry             uint32_t nr_vcpus;
    380  1.1  cherry             uint32_t padding;
    381  1.1  cherry         } v;
    382  1.1  cherry     } u;
    383  1.1  cherry };
    384  1.1  cherry 
    385  1.1  cherry 
    386  1.1  cherry /* XEN_DOMCTL_setdomainhandle */
    387  1.1  cherry struct xen_domctl_setdomainhandle {
    388  1.1  cherry     xen_domain_handle_t handle;
    389  1.1  cherry };
    390  1.1  cherry 
    391  1.1  cherry 
    392  1.1  cherry /* XEN_DOMCTL_setdebugging */
    393  1.1  cherry struct xen_domctl_setdebugging {
    394  1.1  cherry     uint8_t enable;
    395  1.1  cherry };
    396  1.1  cherry 
    397  1.1  cherry 
    398  1.1  cherry /* XEN_DOMCTL_irq_permission */
    399  1.1  cherry struct xen_domctl_irq_permission {
    400  1.1  cherry     uint8_t pirq;
    401  1.1  cherry     uint8_t allow_access;    /* flag to specify enable/disable of IRQ access */
    402  1.1  cherry };
    403  1.1  cherry 
    404  1.1  cherry 
    405  1.1  cherry /* XEN_DOMCTL_iomem_permission */
    406  1.1  cherry struct xen_domctl_iomem_permission {
    407  1.1  cherry     uint64_aligned_t first_mfn;/* first page (physical page number) in range */
    408  1.1  cherry     uint64_aligned_t nr_mfns;  /* number of pages in range (>0) */
    409  1.1  cherry     uint8_t  allow_access;     /* allow (!0) or deny (0) access to range? */
    410  1.1  cherry };
    411  1.1  cherry 
    412  1.1  cherry 
    413  1.1  cherry /* XEN_DOMCTL_ioport_permission */
    414  1.1  cherry struct xen_domctl_ioport_permission {
    415  1.1  cherry     uint32_t first_port;              /* first port int range */
    416  1.1  cherry     uint32_t nr_ports;                /* size of port range */
    417  1.1  cherry     uint8_t  allow_access;            /* allow or deny access to range? */
    418  1.1  cherry };
    419  1.1  cherry 
    420  1.1  cherry 
    421  1.1  cherry /* XEN_DOMCTL_hypercall_init */
    422  1.1  cherry struct xen_domctl_hypercall_init {
    423  1.1  cherry     uint64_aligned_t  gmfn;           /* GMFN to be initialised */
    424  1.1  cherry };
    425  1.1  cherry 
    426  1.1  cherry 
    427  1.1  cherry /* XEN_DOMCTL_settimeoffset */
    428  1.1  cherry struct xen_domctl_settimeoffset {
    429  1.1  cherry     int64_aligned_t time_offset_seconds; /* applied to domain wallclock time */
    430  1.1  cherry };
    431  1.1  cherry 
    432  1.1  cherry /* XEN_DOMCTL_gethvmcontext */
    433  1.1  cherry /* XEN_DOMCTL_sethvmcontext */
    434  1.1  cherry struct xen_domctl_hvmcontext {
    435  1.1  cherry     uint32_t size; /* IN/OUT: size of buffer / bytes filled */
    436  1.1  cherry     XEN_GUEST_HANDLE_64(uint8) buffer; /* IN/OUT: data, or call
    437  1.1  cherry                                         * gethvmcontext with NULL
    438  1.1  cherry                                         * buffer to get size req'd */
    439  1.1  cherry };
    440  1.1  cherry 
    441  1.1  cherry 
    442  1.1  cherry /* XEN_DOMCTL_set_address_size */
    443  1.1  cherry /* XEN_DOMCTL_get_address_size */
    444  1.1  cherry struct xen_domctl_address_size {
    445  1.1  cherry     uint32_t size;
    446  1.1  cherry };
    447  1.1  cherry 
    448  1.1  cherry 
    449  1.1  cherry /* XEN_DOMCTL_sendtrigger */
    450  1.1  cherry #define XEN_DOMCTL_SENDTRIGGER_NMI    0
    451  1.1  cherry #define XEN_DOMCTL_SENDTRIGGER_RESET  1
    452  1.1  cherry #define XEN_DOMCTL_SENDTRIGGER_INIT   2
    453  1.1  cherry #define XEN_DOMCTL_SENDTRIGGER_POWER  3
    454  1.1  cherry #define XEN_DOMCTL_SENDTRIGGER_SLEEP  4
    455  1.1  cherry struct xen_domctl_sendtrigger {
    456  1.1  cherry     uint32_t  trigger;  /* IN */
    457  1.1  cherry     uint32_t  vcpu;     /* IN */
    458  1.1  cherry };
    459  1.1  cherry 
    460  1.1  cherry 
    461  1.1  cherry /* Assign a device to a guest. Sets up IOMMU structures. */
    462  1.1  cherry /* XEN_DOMCTL_assign_device */
    463  1.1  cherry /*
    464  1.1  cherry  * XEN_DOMCTL_test_assign_device: Pass DOMID_INVALID to find out whether the
    465  1.1  cherry  * given device is assigned to any DomU at all. Pass a specific domain ID to
    466  1.1  cherry  * find out whether the given device can be assigned to that domain.
    467  1.1  cherry  */
    468  1.1  cherry /*
    469  1.1  cherry  * XEN_DOMCTL_deassign_device: The behavior of this DOMCTL differs
    470  1.1  cherry  * between the different type of device:
    471  1.1  cherry  *  - PCI device (XEN_DOMCTL_DEV_PCI) will be reassigned to DOM0
    472  1.1  cherry  *  - DT device (XEN_DOMCTL_DEV_DT) will left unassigned. DOM0
    473  1.1  cherry  *  will have to call XEN_DOMCTL_assign_device in order to use the
    474  1.1  cherry  *  device.
    475  1.1  cherry  */
    476  1.1  cherry #define XEN_DOMCTL_DEV_PCI      0
    477  1.1  cherry #define XEN_DOMCTL_DEV_DT       1
    478  1.1  cherry struct xen_domctl_assign_device {
    479  1.1  cherry     /* IN */
    480  1.1  cherry     uint32_t dev;   /* XEN_DOMCTL_DEV_* */
    481  1.1  cherry     uint32_t flags;
    482  1.1  cherry #define XEN_DOMCTL_DEV_RDM_RELAXED      1 /* assign only */
    483  1.1  cherry     union {
    484  1.1  cherry         struct {
    485  1.1  cherry             uint32_t machine_sbdf;   /* machine PCI ID of assigned device */
    486  1.1  cherry         } pci;
    487  1.1  cherry         struct {
    488  1.1  cherry             uint32_t size; /* Length of the path */
    489  1.1  cherry             XEN_GUEST_HANDLE_64(char) path; /* path to the device tree node */
    490  1.1  cherry         } dt;
    491  1.1  cherry     } u;
    492  1.1  cherry };
    493  1.1  cherry 
    494  1.1  cherry /* Retrieve sibling devices infomation of machine_sbdf */
    495  1.1  cherry /* XEN_DOMCTL_get_device_group */
    496  1.1  cherry struct xen_domctl_get_device_group {
    497  1.1  cherry     uint32_t  machine_sbdf;     /* IN */
    498  1.1  cherry     uint32_t  max_sdevs;        /* IN */
    499  1.1  cherry     uint32_t  num_sdevs;        /* OUT */
    500  1.1  cherry     XEN_GUEST_HANDLE_64(uint32)  sdev_array;   /* OUT */
    501  1.1  cherry };
    502  1.1  cherry 
    503  1.1  cherry /* Pass-through interrupts: bind real irq -> hvm devfn. */
    504  1.1  cherry /* XEN_DOMCTL_bind_pt_irq */
    505  1.1  cherry /* XEN_DOMCTL_unbind_pt_irq */
    506  1.1  cherry enum pt_irq_type {
    507  1.1  cherry     PT_IRQ_TYPE_PCI,
    508  1.1  cherry     PT_IRQ_TYPE_ISA,
    509  1.1  cherry     PT_IRQ_TYPE_MSI,
    510  1.1  cherry     PT_IRQ_TYPE_MSI_TRANSLATE,
    511  1.1  cherry     PT_IRQ_TYPE_SPI,    /* ARM: valid range 32-1019 */
    512  1.1  cherry };
    513  1.1  cherry struct xen_domctl_bind_pt_irq {
    514  1.1  cherry     uint32_t machine_irq;
    515  1.1  cherry     uint32_t irq_type; /* enum pt_irq_type */
    516  1.1  cherry 
    517  1.1  cherry     union {
    518  1.1  cherry         struct {
    519  1.1  cherry             uint8_t isa_irq;
    520  1.1  cherry         } isa;
    521  1.1  cherry         struct {
    522  1.1  cherry             uint8_t bus;
    523  1.1  cherry             uint8_t device;
    524  1.1  cherry             uint8_t intx;
    525  1.1  cherry         } pci;
    526  1.1  cherry         struct {
    527  1.1  cherry             uint8_t gvec;
    528  1.1  cherry             uint32_t gflags;
    529  1.1  cherry #define XEN_DOMCTL_VMSI_X86_DEST_ID_MASK 0x0000ff
    530  1.1  cherry #define XEN_DOMCTL_VMSI_X86_RH_MASK      0x000100
    531  1.1  cherry #define XEN_DOMCTL_VMSI_X86_DM_MASK      0x000200
    532  1.1  cherry #define XEN_DOMCTL_VMSI_X86_DELIV_MASK   0x007000
    533  1.1  cherry #define XEN_DOMCTL_VMSI_X86_TRIG_MASK    0x008000
    534  1.1  cherry #define XEN_DOMCTL_VMSI_X86_UNMASKED     0x010000
    535  1.1  cherry 
    536  1.1  cherry             uint64_aligned_t gtable;
    537  1.1  cherry         } msi;
    538  1.1  cherry         struct {
    539  1.1  cherry             uint16_t spi;
    540  1.1  cherry         } spi;
    541  1.1  cherry     } u;
    542  1.1  cherry };
    543  1.1  cherry 
    544  1.1  cherry 
    545  1.1  cherry /* Bind machine I/O address range -> HVM address range. */
    546  1.1  cherry /* XEN_DOMCTL_memory_mapping */
    547  1.1  cherry /* Returns
    548  1.1  cherry    - zero     success, everything done
    549  1.1  cherry    - -E2BIG   passed in nr_mfns value too large for the implementation
    550  1.1  cherry    - positive partial success for the first <result> page frames (with
    551  1.1  cherry               <result> less than nr_mfns), requiring re-invocation by the
    552  1.1  cherry               caller after updating inputs
    553  1.1  cherry    - negative error; other than -E2BIG
    554  1.1  cherry */
    555  1.1  cherry #define DPCI_ADD_MAPPING         1
    556  1.1  cherry #define DPCI_REMOVE_MAPPING      0
    557  1.1  cherry struct xen_domctl_memory_mapping {
    558  1.1  cherry     uint64_aligned_t first_gfn; /* first page (hvm guest phys page) in range */
    559  1.1  cherry     uint64_aligned_t first_mfn; /* first page (machine page) in range */
    560  1.1  cherry     uint64_aligned_t nr_mfns;   /* number of pages in range (>0) */
    561  1.1  cherry     uint32_t add_mapping;       /* add or remove mapping */
    562  1.1  cherry     uint32_t padding;           /* padding for 64-bit aligned structure */
    563  1.1  cherry };
    564  1.1  cherry 
    565  1.1  cherry 
    566  1.1  cherry /* Bind machine I/O port range -> HVM I/O port range. */
    567  1.1  cherry /* XEN_DOMCTL_ioport_mapping */
    568  1.1  cherry struct xen_domctl_ioport_mapping {
    569  1.1  cherry     uint32_t first_gport;     /* first guest IO port*/
    570  1.1  cherry     uint32_t first_mport;     /* first machine IO port */
    571  1.1  cherry     uint32_t nr_ports;        /* size of port range */
    572  1.1  cherry     uint32_t add_mapping;     /* add or remove mapping */
    573  1.1  cherry };
    574  1.1  cherry 
    575  1.1  cherry 
    576  1.1  cherry /*
    577  1.1  cherry  * Pin caching type of RAM space for x86 HVM domU.
    578  1.1  cherry  */
    579  1.1  cherry /* XEN_DOMCTL_pin_mem_cacheattr */
    580  1.1  cherry /* Caching types: these happen to be the same as x86 MTRR/PAT type codes. */
    581  1.1  cherry #define XEN_DOMCTL_MEM_CACHEATTR_UC  0
    582  1.1  cherry #define XEN_DOMCTL_MEM_CACHEATTR_WC  1
    583  1.1  cherry #define XEN_DOMCTL_MEM_CACHEATTR_WT  4
    584  1.1  cherry #define XEN_DOMCTL_MEM_CACHEATTR_WP  5
    585  1.1  cherry #define XEN_DOMCTL_MEM_CACHEATTR_WB  6
    586  1.1  cherry #define XEN_DOMCTL_MEM_CACHEATTR_UCM 7
    587  1.1  cherry #define XEN_DOMCTL_DELETE_MEM_CACHEATTR (~(uint32_t)0)
    588  1.1  cherry 
    589  1.1  cherry 
    590  1.1  cherry /* XEN_DOMCTL_set_ext_vcpucontext */
    591  1.1  cherry /* XEN_DOMCTL_get_ext_vcpucontext */
    592  1.1  cherry struct xen_domctl_ext_vcpucontext {
    593  1.1  cherry     /* IN: VCPU that this call applies to. */
    594  1.1  cherry     uint32_t         vcpu;
    595  1.1  cherry     /*
    596  1.1  cherry      * SET: Size of struct (IN)
    597  1.1  cherry      * GET: Size of struct (OUT, up to 128 bytes)
    598  1.1  cherry      */
    599  1.1  cherry     uint32_t         size;
    600  1.1  cherry #if defined(__i386__) || defined(__x86_64__)
    601  1.1  cherry     /* SYSCALL from 32-bit mode and SYSENTER callback information. */
    602  1.1  cherry     /* NB. SYSCALL from 64-bit mode is contained in vcpu_guest_context_t */
    603  1.1  cherry     uint64_aligned_t syscall32_callback_eip;
    604  1.1  cherry     uint64_aligned_t sysenter_callback_eip;
    605  1.1  cherry     uint16_t         syscall32_callback_cs;
    606  1.1  cherry     uint16_t         sysenter_callback_cs;
    607  1.1  cherry     uint8_t          syscall32_disables_events;
    608  1.1  cherry     uint8_t          sysenter_disables_events;
    609  1.1  cherry #if defined(__GNUC__)
    610  1.1  cherry     union {
    611  1.1  cherry         uint64_aligned_t mcg_cap;
    612  1.1  cherry         struct hvm_vmce_vcpu vmce;
    613  1.1  cherry     };
    614  1.1  cherry #else
    615  1.1  cherry     struct hvm_vmce_vcpu vmce;
    616  1.1  cherry #endif
    617  1.1  cherry #endif
    618  1.1  cherry };
    619  1.1  cherry 
    620  1.1  cherry /*
    621  1.1  cherry  * Set the target domain for a domain
    622  1.1  cherry  */
    623  1.1  cherry /* XEN_DOMCTL_set_target */
    624  1.1  cherry struct xen_domctl_set_target {
    625  1.1  cherry     domid_t target;
    626  1.1  cherry };
    627  1.1  cherry 
    628  1.1  cherry #if defined(__i386__) || defined(__x86_64__)
    629  1.1  cherry # define XEN_CPUID_INPUT_UNUSED  0xFFFFFFFF
    630  1.1  cherry /* XEN_DOMCTL_set_cpuid */
    631  1.1  cherry struct xen_domctl_cpuid {
    632  1.1  cherry   uint32_t input[2];
    633  1.1  cherry   uint32_t eax;
    634  1.1  cherry   uint32_t ebx;
    635  1.1  cherry   uint32_t ecx;
    636  1.1  cherry   uint32_t edx;
    637  1.1  cherry };
    638  1.1  cherry #endif
    639  1.1  cherry 
    640  1.1  cherry /*
    641  1.1  cherry  * Arranges that if the domain suspends (specifically, if it shuts
    642  1.1  cherry  * down with code SHUTDOWN_suspend), this event channel will be
    643  1.1  cherry  * notified.
    644  1.1  cherry  *
    645  1.1  cherry  * This is _instead of_ the usual notification to the global
    646  1.1  cherry  * VIRQ_DOM_EXC.  (In most systems that pirq is owned by xenstored.)
    647  1.1  cherry  *
    648  1.1  cherry  * Only one subscription per domain is possible.  Last subscriber
    649  1.1  cherry  * wins; others are silently displaced.
    650  1.1  cherry  *
    651  1.1  cherry  * NB that contrary to the rather general name, it only applies to
    652  1.1  cherry  * domain shutdown with code suspend.  Shutdown for other reasons
    653  1.1  cherry  * (including crash), and domain death, are notified to VIRQ_DOM_EXC
    654  1.1  cherry  * regardless.
    655  1.1  cherry  */
    656  1.1  cherry /* XEN_DOMCTL_subscribe */
    657  1.1  cherry struct xen_domctl_subscribe {
    658  1.1  cherry     uint32_t port; /* IN */
    659  1.1  cherry };
    660  1.1  cherry 
    661  1.1  cherry /*
    662  1.1  cherry  * Define the maximum machine address size which should be allocated
    663  1.1  cherry  * to a guest.
    664  1.1  cherry  */
    665  1.1  cherry /* XEN_DOMCTL_set_machine_address_size */
    666  1.1  cherry /* XEN_DOMCTL_get_machine_address_size */
    667  1.1  cherry 
    668  1.1  cherry /*
    669  1.1  cherry  * Do not inject spurious page faults into this domain.
    670  1.1  cherry  */
    671  1.1  cherry /* XEN_DOMCTL_suppress_spurious_page_faults */
    672  1.1  cherry 
    673  1.1  cherry /* XEN_DOMCTL_debug_op */
    674  1.1  cherry #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF         0
    675  1.1  cherry #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON          1
    676  1.1  cherry struct xen_domctl_debug_op {
    677  1.1  cherry     uint32_t op;   /* IN */
    678  1.1  cherry     uint32_t vcpu; /* IN */
    679  1.1  cherry };
    680  1.1  cherry 
    681  1.1  cherry /*
    682  1.1  cherry  * Request a particular record from the HVM context
    683  1.1  cherry  */
    684  1.1  cherry /* XEN_DOMCTL_gethvmcontext_partial */
    685  1.1  cherry struct xen_domctl_hvmcontext_partial {
    686  1.1  cherry     uint32_t type;                      /* IN: Type of record required */
    687  1.1  cherry     uint32_t instance;                  /* IN: Instance of that type */
    688  1.1  cherry     uint64_aligned_t bufsz;             /* IN: size of buffer */
    689  1.1  cherry     XEN_GUEST_HANDLE_64(uint8) buffer;  /* OUT: buffer to write record into */
    690  1.1  cherry };
    691  1.1  cherry 
    692  1.1  cherry /* XEN_DOMCTL_disable_migrate */
    693  1.1  cherry struct xen_domctl_disable_migrate {
    694  1.1  cherry     uint32_t disable; /* IN: 1: disable migration and restore */
    695  1.1  cherry };
    696  1.1  cherry 
    697  1.1  cherry 
    698  1.1  cherry /* XEN_DOMCTL_gettscinfo */
    699  1.1  cherry /* XEN_DOMCTL_settscinfo */
    700  1.1  cherry struct xen_domctl_tsc_info {
    701  1.1  cherry     /* IN/OUT */
    702  1.1  cherry     uint32_t tsc_mode;
    703  1.1  cherry     uint32_t gtsc_khz;
    704  1.1  cherry     uint32_t incarnation;
    705  1.1  cherry     uint32_t pad;
    706  1.1  cherry     uint64_aligned_t elapsed_nsec;
    707  1.1  cherry };
    708  1.1  cherry 
    709  1.1  cherry /* XEN_DOMCTL_gdbsx_guestmemio      guest mem io */
    710  1.1  cherry struct xen_domctl_gdbsx_memio {
    711  1.1  cherry     /* IN */
    712  1.1  cherry     uint64_aligned_t pgd3val;/* optional: init_mm.pgd[3] value */
    713  1.1  cherry     uint64_aligned_t gva;    /* guest virtual address */
    714  1.1  cherry     uint64_aligned_t uva;    /* user buffer virtual address */
    715  1.1  cherry     uint32_t         len;    /* number of bytes to read/write */
    716  1.1  cherry     uint8_t          gwr;    /* 0 = read from guest. 1 = write to guest */
    717  1.1  cherry     /* OUT */
    718  1.1  cherry     uint32_t         remain; /* bytes remaining to be copied */
    719  1.1  cherry };
    720  1.1  cherry 
    721  1.1  cherry /* XEN_DOMCTL_gdbsx_pausevcpu */
    722  1.1  cherry /* XEN_DOMCTL_gdbsx_unpausevcpu */
    723  1.1  cherry struct xen_domctl_gdbsx_pauseunp_vcpu { /* pause/unpause a vcpu */
    724  1.1  cherry     uint32_t         vcpu;         /* which vcpu */
    725  1.1  cherry };
    726  1.1  cherry 
    727  1.1  cherry /* XEN_DOMCTL_gdbsx_domstatus */
    728  1.1  cherry struct xen_domctl_gdbsx_domstatus {
    729  1.1  cherry     /* OUT */
    730  1.1  cherry     uint8_t          paused;     /* is the domain paused */
    731  1.1  cherry     uint32_t         vcpu_id;    /* any vcpu in an event? */
    732  1.1  cherry     uint32_t         vcpu_ev;    /* if yes, what event? */
    733  1.1  cherry };
    734  1.1  cherry 
    735  1.1  cherry /*
    736  1.1  cherry  * VM event operations
    737  1.1  cherry  */
    738  1.1  cherry 
    739  1.1  cherry /* XEN_DOMCTL_vm_event_op */
    740  1.1  cherry 
    741  1.1  cherry /*
    742  1.1  cherry  * There are currently three rings available for VM events:
    743  1.1  cherry  * sharing, monitor and paging. This hypercall allows one to
    744  1.1  cherry  * control these rings (enable/disable), as well as to signal
    745  1.1  cherry  * to the hypervisor to pull responses (resume) from the given
    746  1.1  cherry  * ring.
    747  1.1  cherry  */
    748  1.1  cherry #define XEN_VM_EVENT_ENABLE               0
    749  1.1  cherry #define XEN_VM_EVENT_DISABLE              1
    750  1.1  cherry #define XEN_VM_EVENT_RESUME               2
    751  1.1  cherry 
    752  1.1  cherry /*
    753  1.1  cherry  * Domain memory paging
    754  1.1  cherry  * Page memory in and out.
    755  1.1  cherry  * Domctl interface to set up and tear down the
    756  1.1  cherry  * pager<->hypervisor interface. Use XENMEM_paging_op*
    757  1.1  cherry  * to perform per-page operations.
    758  1.1  cherry  *
    759  1.1  cherry  * The XEN_VM_EVENT_PAGING_ENABLE domctl returns several
    760  1.1  cherry  * non-standard error codes to indicate why paging could not be enabled:
    761  1.1  cherry  * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
    762  1.1  cherry  * EMLINK - guest has iommu passthrough enabled
    763  1.1  cherry  * EXDEV  - guest has PoD enabled
    764  1.1  cherry  * EBUSY  - guest has or had paging enabled, ring buffer still active
    765  1.1  cherry  */
    766  1.1  cherry #define XEN_DOMCTL_VM_EVENT_OP_PAGING            1
    767  1.1  cherry 
    768  1.1  cherry /*
    769  1.1  cherry  * Monitor helper.
    770  1.1  cherry  *
    771  1.1  cherry  * As with paging, use the domctl for teardown/setup of the
    772  1.1  cherry  * helper<->hypervisor interface.
    773  1.1  cherry  *
    774  1.1  cherry  * The monitor interface can be used to register for various VM events. For
    775  1.1  cherry  * example, there are HVM hypercalls to set the per-page access permissions
    776  1.1  cherry  * of every page in a domain.  When one of these permissions--independent,
    777  1.1  cherry  * read, write, and execute--is violated, the VCPU is paused and a memory event
    778  1.1  cherry  * is sent with what happened. The memory event handler can then resume the
    779  1.1  cherry  * VCPU and redo the access with a XEN_VM_EVENT_RESUME option.
    780  1.1  cherry  *
    781  1.1  cherry  * See public/vm_event.h for the list of available events that can be
    782  1.1  cherry  * subscribed to via the monitor interface.
    783  1.1  cherry  *
    784  1.1  cherry  * The XEN_VM_EVENT_MONITOR_* domctls returns
    785  1.1  cherry  * non-standard error codes to indicate why access could not be enabled:
    786  1.1  cherry  * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
    787  1.1  cherry  * EBUSY  - guest has or had access enabled, ring buffer still active
    788  1.1  cherry  *
    789  1.1  cherry  */
    790  1.1  cherry #define XEN_DOMCTL_VM_EVENT_OP_MONITOR           2
    791  1.1  cherry 
    792  1.1  cherry /*
    793  1.1  cherry  * Sharing ENOMEM helper.
    794  1.1  cherry  *
    795  1.1  cherry  * As with paging, use the domctl for teardown/setup of the
    796  1.1  cherry  * helper<->hypervisor interface.
    797  1.1  cherry  *
    798  1.1  cherry  * If setup, this ring is used to communicate failed allocations
    799  1.1  cherry  * in the unshare path. XENMEM_sharing_op_resume is used to wake up
    800  1.1  cherry  * vcpus that could not unshare.
    801  1.1  cherry  *
    802  1.1  cherry  * Note that shring can be turned on (as per the domctl below)
    803  1.1  cherry  * *without* this ring being setup.
    804  1.1  cherry  */
    805  1.1  cherry #define XEN_DOMCTL_VM_EVENT_OP_SHARING           3
    806  1.1  cherry 
    807  1.1  cherry /* Use for teardown/setup of helper<->hypervisor interface for paging,
    808  1.1  cherry  * access and sharing.*/
    809  1.1  cherry struct xen_domctl_vm_event_op {
    810  1.1  cherry     uint32_t       op;           /* XEN_VM_EVENT_* */
    811  1.1  cherry     uint32_t       mode;         /* XEN_DOMCTL_VM_EVENT_OP_* */
    812  1.1  cherry 
    813  1.1  cherry     uint32_t port;              /* OUT: event channel for ring */
    814  1.1  cherry };
    815  1.1  cherry 
    816  1.1  cherry /*
    817  1.1  cherry  * Memory sharing operations
    818  1.1  cherry  */
    819  1.1  cherry /* XEN_DOMCTL_mem_sharing_op.
    820  1.1  cherry  * The CONTROL sub-domctl is used for bringup/teardown. */
    821  1.1  cherry #define XEN_DOMCTL_MEM_SHARING_CONTROL          0
    822  1.1  cherry 
    823  1.1  cherry struct xen_domctl_mem_sharing_op {
    824  1.1  cherry     uint8_t op; /* XEN_DOMCTL_MEM_SHARING_* */
    825  1.1  cherry 
    826  1.1  cherry     union {
    827  1.1  cherry         uint8_t enable;                   /* CONTROL */
    828  1.1  cherry     } u;
    829  1.1  cherry };
    830  1.1  cherry 
    831  1.1  cherry struct xen_domctl_audit_p2m {
    832  1.1  cherry     /* OUT error counts */
    833  1.1  cherry     uint64_t orphans;
    834  1.1  cherry     uint64_t m2p_bad;
    835  1.1  cherry     uint64_t p2m_bad;
    836  1.1  cherry };
    837  1.1  cherry 
    838  1.1  cherry struct xen_domctl_set_virq_handler {
    839  1.1  cherry     uint32_t virq; /* IN */
    840  1.1  cherry };
    841  1.1  cherry 
    842  1.1  cherry #if defined(__i386__) || defined(__x86_64__)
    843  1.1  cherry /* XEN_DOMCTL_setvcpuextstate */
    844  1.1  cherry /* XEN_DOMCTL_getvcpuextstate */
    845  1.1  cherry struct xen_domctl_vcpuextstate {
    846  1.1  cherry     /* IN: VCPU that this call applies to. */
    847  1.1  cherry     uint32_t         vcpu;
    848  1.1  cherry     /*
    849  1.1  cherry      * SET: Ignored.
    850  1.1  cherry      * GET: xfeature support mask of struct (IN/OUT)
    851  1.1  cherry      * xfeature mask is served as identifications of the saving format
    852  1.1  cherry      * so that compatible CPUs can have a check on format to decide
    853  1.1  cherry      * whether it can restore.
    854  1.1  cherry      */
    855  1.1  cherry     uint64_aligned_t         xfeature_mask;
    856  1.1  cherry     /*
    857  1.1  cherry      * SET: Size of struct (IN)
    858  1.1  cherry      * GET: Size of struct (IN/OUT)
    859  1.1  cherry      */
    860  1.1  cherry     uint64_aligned_t         size;
    861  1.1  cherry     XEN_GUEST_HANDLE_64(uint64) buffer;
    862  1.1  cherry };
    863  1.1  cherry #endif
    864  1.1  cherry 
    865  1.1  cherry /* XEN_DOMCTL_set_access_required: sets whether a memory event listener
    866  1.1  cherry  * must be present to handle page access events: if false, the page
    867  1.1  cherry  * access will revert to full permissions if no one is listening;
    868  1.1  cherry  *  */
    869  1.1  cherry struct xen_domctl_set_access_required {
    870  1.1  cherry     uint8_t access_required;
    871  1.1  cherry };
    872  1.1  cherry 
    873  1.1  cherry struct xen_domctl_set_broken_page_p2m {
    874  1.1  cherry     uint64_aligned_t pfn;
    875  1.1  cherry };
    876  1.1  cherry 
    877  1.1  cherry /*
    878  1.1  cherry  * XEN_DOMCTL_set_max_evtchn: sets the maximum event channel port
    879  1.1  cherry  * number the guest may use.  Use this limit the amount of resources
    880  1.1  cherry  * (global mapping space, xenheap) a guest may use for event channels.
    881  1.1  cherry  */
    882  1.1  cherry struct xen_domctl_set_max_evtchn {
    883  1.1  cherry     uint32_t max_port;
    884  1.1  cherry };
    885  1.1  cherry 
    886  1.1  cherry /*
    887  1.1  cherry  * ARM: Clean and invalidate caches associated with given region of
    888  1.1  cherry  * guest memory.
    889  1.1  cherry  */
    890  1.1  cherry struct xen_domctl_cacheflush {
    891  1.1  cherry     /* IN: page range to flush. */
    892  1.1  cherry     xen_pfn_t start_pfn, nr_pfns;
    893  1.1  cherry };
    894  1.1  cherry 
    895  1.1  cherry #if defined(__i386__) || defined(__x86_64__)
    896  1.1  cherry struct xen_domctl_vcpu_msr {
    897  1.1  cherry     uint32_t         index;
    898  1.1  cherry     uint32_t         reserved;
    899  1.1  cherry     uint64_aligned_t value;
    900  1.1  cherry };
    901  1.1  cherry typedef struct xen_domctl_vcpu_msr xen_domctl_vcpu_msr_t;
    902  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpu_msr_t);
    903  1.1  cherry 
    904  1.1  cherry /*
    905  1.1  cherry  * XEN_DOMCTL_set_vcpu_msrs / XEN_DOMCTL_get_vcpu_msrs.
    906  1.1  cherry  *
    907  1.1  cherry  * Input:
    908  1.1  cherry  * - A NULL 'msrs' guest handle is a request for the maximum 'msr_count'.
    909  1.1  cherry  * - Otherwise, 'msr_count' is the number of entries in 'msrs'.
    910  1.1  cherry  *
    911  1.1  cherry  * Output for get:
    912  1.1  cherry  * - If 'msr_count' is less than the number Xen needs to write, -ENOBUFS shall
    913  1.1  cherry  *   be returned and 'msr_count' updated to reflect the intended number.
    914  1.1  cherry  * - On success, 'msr_count' shall indicate the number of MSRs written, which
    915  1.1  cherry  *   may be less than the maximum if some are not currently used by the vcpu.
    916  1.1  cherry  *
    917  1.1  cherry  * Output for set:
    918  1.1  cherry  * - If Xen encounters an error with a specific MSR, -EINVAL shall be returned
    919  1.1  cherry  *   and 'msr_count' shall be set to the offending index, to aid debugging.
    920  1.1  cherry  */
    921  1.1  cherry struct xen_domctl_vcpu_msrs {
    922  1.1  cherry     uint32_t vcpu;                                   /* IN     */
    923  1.1  cherry     uint32_t msr_count;                              /* IN/OUT */
    924  1.1  cherry     XEN_GUEST_HANDLE_64(xen_domctl_vcpu_msr_t) msrs; /* IN/OUT */
    925  1.1  cherry };
    926  1.1  cherry #endif
    927  1.1  cherry 
    928  1.1  cherry /* XEN_DOMCTL_setvnumainfo: specifies a virtual NUMA topology for the guest */
    929  1.1  cherry struct xen_domctl_vnuma {
    930  1.1  cherry     /* IN: number of vNUMA nodes to setup. Shall be greater than 0 */
    931  1.1  cherry     uint32_t nr_vnodes;
    932  1.1  cherry     /* IN: number of memory ranges to setup */
    933  1.1  cherry     uint32_t nr_vmemranges;
    934  1.1  cherry     /*
    935  1.1  cherry      * IN: number of vCPUs of the domain (used as size of the vcpu_to_vnode
    936  1.1  cherry      * array declared below). Shall be equal to the domain's max_vcpus.
    937  1.1  cherry      */
    938  1.1  cherry     uint32_t nr_vcpus;
    939  1.1  cherry     uint32_t pad;                                  /* must be zero */
    940  1.1  cherry 
    941  1.1  cherry     /*
    942  1.1  cherry      * IN: array for specifying the distances of the vNUMA nodes
    943  1.1  cherry      * between each others. Shall have nr_vnodes*nr_vnodes elements.
    944  1.1  cherry      */
    945  1.1  cherry     XEN_GUEST_HANDLE_64(uint) vdistance;
    946  1.1  cherry     /*
    947  1.1  cherry      * IN: array for specifying to what vNUMA node each vCPU belongs.
    948  1.1  cherry      * Shall have nr_vcpus elements.
    949  1.1  cherry      */
    950  1.1  cherry     XEN_GUEST_HANDLE_64(uint) vcpu_to_vnode;
    951  1.1  cherry     /*
    952  1.1  cherry      * IN: array for specifying on what physical NUMA node each vNUMA
    953  1.1  cherry      * node is placed. Shall have nr_vnodes elements.
    954  1.1  cherry      */
    955  1.1  cherry     XEN_GUEST_HANDLE_64(uint) vnode_to_pnode;
    956  1.1  cherry     /*
    957  1.1  cherry      * IN: array for specifying the memory ranges. Shall have
    958  1.1  cherry      * nr_vmemranges elements.
    959  1.1  cherry      */
    960  1.1  cherry     XEN_GUEST_HANDLE_64(xen_vmemrange_t) vmemrange;
    961  1.1  cherry };
    962  1.1  cherry 
    963  1.1  cherry struct xen_domctl_psr_cmt_op {
    964  1.1  cherry #define XEN_DOMCTL_PSR_CMT_OP_DETACH         0
    965  1.1  cherry #define XEN_DOMCTL_PSR_CMT_OP_ATTACH         1
    966  1.1  cherry #define XEN_DOMCTL_PSR_CMT_OP_QUERY_RMID     2
    967  1.1  cherry     uint32_t cmd;
    968  1.1  cherry     uint32_t data;
    969  1.1  cherry };
    970  1.1  cherry 
    971  1.1  cherry /*  XEN_DOMCTL_MONITOR_*
    972  1.1  cherry  *
    973  1.1  cherry  * Enable/disable monitoring various VM events.
    974  1.1  cherry  * This domctl configures what events will be reported to helper apps
    975  1.1  cherry  * via the ring buffer "MONITOR". The ring has to be first enabled
    976  1.1  cherry  * with the domctl XEN_DOMCTL_VM_EVENT_OP_MONITOR.
    977  1.1  cherry  *
    978  1.1  cherry  * GET_CAPABILITIES can be used to determine which of these features is
    979  1.1  cherry  * available on a given platform.
    980  1.1  cherry  *
    981  1.1  cherry  * NOTICE: mem_access events are also delivered via the "MONITOR" ring buffer;
    982  1.1  cherry  * however, enabling/disabling those events is performed with the use of
    983  1.1  cherry  * memory_op hypercalls!
    984  1.1  cherry  */
    985  1.1  cherry #define XEN_DOMCTL_MONITOR_OP_ENABLE            0
    986  1.1  cherry #define XEN_DOMCTL_MONITOR_OP_DISABLE           1
    987  1.1  cherry #define XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES  2
    988  1.1  cherry #define XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP  3
    989  1.1  cherry 
    990  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG         0
    991  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR            1
    992  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP            2
    993  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT   3
    994  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST         4
    995  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_DEBUG_EXCEPTION       5
    996  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_CPUID                 6
    997  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_PRIVILEGED_CALL       7
    998  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_INTERRUPT             8
    999  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_DESC_ACCESS           9
   1000  1.1  cherry #define XEN_DOMCTL_MONITOR_EVENT_EMUL_UNIMPLEMENTED    10
   1001  1.1  cherry 
   1002  1.1  cherry struct xen_domctl_monitor_op {
   1003  1.1  cherry     uint32_t op; /* XEN_DOMCTL_MONITOR_OP_* */
   1004  1.1  cherry 
   1005  1.1  cherry     /*
   1006  1.1  cherry      * When used with ENABLE/DISABLE this has to be set to
   1007  1.1  cherry      * the requested XEN_DOMCTL_MONITOR_EVENT_* value.
   1008  1.1  cherry      * With GET_CAPABILITIES this field returns a bitmap of
   1009  1.1  cherry      * events supported by the platform, in the format
   1010  1.1  cherry      * (1 << XEN_DOMCTL_MONITOR_EVENT_*).
   1011  1.1  cherry      */
   1012  1.1  cherry     uint32_t event;
   1013  1.1  cherry 
   1014  1.1  cherry     /*
   1015  1.1  cherry      * Further options when issuing XEN_DOMCTL_MONITOR_OP_ENABLE.
   1016  1.1  cherry      */
   1017  1.1  cherry     union {
   1018  1.1  cherry         struct {
   1019  1.1  cherry             /* Which control register */
   1020  1.1  cherry             uint8_t index;
   1021  1.1  cherry             /* Pause vCPU until response */
   1022  1.1  cherry             uint8_t sync;
   1023  1.1  cherry             /* Send event only on a change of value */
   1024  1.1  cherry             uint8_t onchangeonly;
   1025  1.1  cherry             /* Allignment padding */
   1026  1.1  cherry             uint8_t pad1;
   1027  1.1  cherry             uint32_t pad2;
   1028  1.1  cherry             /*
   1029  1.1  cherry              * Send event only if the changed bit in the control register
   1030  1.1  cherry              * is not masked.
   1031  1.1  cherry              */
   1032  1.1  cherry             uint64_aligned_t bitmask;
   1033  1.1  cherry         } mov_to_cr;
   1034  1.1  cherry 
   1035  1.1  cherry         struct {
   1036  1.1  cherry             uint32_t msr;
   1037  1.1  cherry             /* Send event only on a change of value */
   1038  1.1  cherry             uint8_t onchangeonly;
   1039  1.1  cherry         } mov_to_msr;
   1040  1.1  cherry 
   1041  1.1  cherry         struct {
   1042  1.1  cherry             /* Pause vCPU until response */
   1043  1.1  cherry             uint8_t sync;
   1044  1.1  cherry             uint8_t allow_userspace;
   1045  1.1  cherry         } guest_request;
   1046  1.1  cherry 
   1047  1.1  cherry         struct {
   1048  1.1  cherry             /* Pause vCPU until response */
   1049  1.1  cherry             uint8_t sync;
   1050  1.1  cherry         } debug_exception;
   1051  1.1  cherry     } u;
   1052  1.1  cherry };
   1053  1.1  cherry 
   1054  1.1  cherry struct xen_domctl_psr_alloc {
   1055  1.1  cherry #define XEN_DOMCTL_PSR_SET_L3_CBM     0
   1056  1.1  cherry #define XEN_DOMCTL_PSR_GET_L3_CBM     1
   1057  1.1  cherry #define XEN_DOMCTL_PSR_SET_L3_CODE    2
   1058  1.1  cherry #define XEN_DOMCTL_PSR_SET_L3_DATA    3
   1059  1.1  cherry #define XEN_DOMCTL_PSR_GET_L3_CODE    4
   1060  1.1  cherry #define XEN_DOMCTL_PSR_GET_L3_DATA    5
   1061  1.1  cherry #define XEN_DOMCTL_PSR_SET_L2_CBM     6
   1062  1.1  cherry #define XEN_DOMCTL_PSR_GET_L2_CBM     7
   1063  1.1  cherry #define XEN_DOMCTL_PSR_SET_MBA_THRTL  8
   1064  1.1  cherry #define XEN_DOMCTL_PSR_GET_MBA_THRTL  9
   1065  1.1  cherry     uint32_t cmd;       /* IN: XEN_DOMCTL_PSR_* */
   1066  1.1  cherry     uint32_t target;    /* IN */
   1067  1.1  cherry     uint64_t data;      /* IN/OUT */
   1068  1.1  cherry };
   1069  1.1  cherry 
   1070  1.1  cherry struct xen_domctl_set_gnttab_limits {
   1071  1.1  cherry     uint32_t grant_frames;     /* IN */
   1072  1.1  cherry     uint32_t maptrack_frames;  /* IN */
   1073  1.1  cherry };
   1074  1.1  cherry 
   1075  1.1  cherry /* XEN_DOMCTL_vuart_op */
   1076  1.1  cherry struct xen_domctl_vuart_op {
   1077  1.1  cherry #define XEN_DOMCTL_VUART_OP_INIT  0
   1078  1.1  cherry         uint32_t cmd;           /* XEN_DOMCTL_VUART_OP_* */
   1079  1.1  cherry #define XEN_DOMCTL_VUART_TYPE_VPL011 0
   1080  1.1  cherry         uint32_t type;          /* IN - type of vuart.
   1081  1.1  cherry                                  *      Currently only vpl011 supported.
   1082  1.1  cherry                                  */
   1083  1.1  cherry         uint64_aligned_t  gfn;  /* IN - guest gfn to be used as a
   1084  1.1  cherry                                  *      ring buffer.
   1085  1.1  cherry                                  */
   1086  1.1  cherry         domid_t console_domid;  /* IN - domid of domain running the
   1087  1.1  cherry                                  *      backend console.
   1088  1.1  cherry                                  */
   1089  1.1  cherry         uint8_t pad[2];
   1090  1.1  cherry         evtchn_port_t evtchn;   /* OUT - remote port of the event
   1091  1.1  cherry                                  *       channel used for sending
   1092  1.1  cherry                                  *       ring buffer events.
   1093  1.1  cherry                                  */
   1094  1.1  cherry };
   1095  1.1  cherry 
   1096  1.1  cherry struct xen_domctl {
   1097  1.1  cherry     uint32_t cmd;
   1098  1.1  cherry #define XEN_DOMCTL_createdomain                   1
   1099  1.1  cherry #define XEN_DOMCTL_destroydomain                  2
   1100  1.1  cherry #define XEN_DOMCTL_pausedomain                    3
   1101  1.1  cherry #define XEN_DOMCTL_unpausedomain                  4
   1102  1.1  cherry #define XEN_DOMCTL_getdomaininfo                  5
   1103  1.1  cherry /* #define XEN_DOMCTL_getmemlist                  6 Removed */
   1104  1.1  cherry /* #define XEN_DOMCTL_getpageframeinfo            7 Obsolete - use getpageframeinfo3 */
   1105  1.1  cherry /* #define XEN_DOMCTL_getpageframeinfo2           8 Obsolete - use getpageframeinfo3 */
   1106  1.1  cherry #define XEN_DOMCTL_setvcpuaffinity                9
   1107  1.1  cherry #define XEN_DOMCTL_shadow_op                     10
   1108  1.1  cherry #define XEN_DOMCTL_max_mem                       11
   1109  1.1  cherry #define XEN_DOMCTL_setvcpucontext                12
   1110  1.1  cherry #define XEN_DOMCTL_getvcpucontext                13
   1111  1.1  cherry #define XEN_DOMCTL_getvcpuinfo                   14
   1112  1.1  cherry #define XEN_DOMCTL_max_vcpus                     15
   1113  1.1  cherry #define XEN_DOMCTL_scheduler_op                  16
   1114  1.1  cherry #define XEN_DOMCTL_setdomainhandle               17
   1115  1.1  cherry #define XEN_DOMCTL_setdebugging                  18
   1116  1.1  cherry #define XEN_DOMCTL_irq_permission                19
   1117  1.1  cherry #define XEN_DOMCTL_iomem_permission              20
   1118  1.1  cherry #define XEN_DOMCTL_ioport_permission             21
   1119  1.1  cherry #define XEN_DOMCTL_hypercall_init                22
   1120  1.1  cherry #define XEN_DOMCTL_arch_setup                    23 /* Obsolete IA64 only */
   1121  1.1  cherry #define XEN_DOMCTL_settimeoffset                 24
   1122  1.1  cherry #define XEN_DOMCTL_getvcpuaffinity               25
   1123  1.1  cherry #define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
   1124  1.1  cherry #define XEN_DOMCTL_resumedomain                  27
   1125  1.1  cherry #define XEN_DOMCTL_sendtrigger                   28
   1126  1.1  cherry #define XEN_DOMCTL_subscribe                     29
   1127  1.1  cherry #define XEN_DOMCTL_gethvmcontext                 33
   1128  1.1  cherry #define XEN_DOMCTL_sethvmcontext                 34
   1129  1.1  cherry #define XEN_DOMCTL_set_address_size              35
   1130  1.1  cherry #define XEN_DOMCTL_get_address_size              36
   1131  1.1  cherry #define XEN_DOMCTL_assign_device                 37
   1132  1.1  cherry #define XEN_DOMCTL_bind_pt_irq                   38
   1133  1.1  cherry #define XEN_DOMCTL_memory_mapping                39
   1134  1.1  cherry #define XEN_DOMCTL_ioport_mapping                40
   1135  1.1  cherry /* #define XEN_DOMCTL_pin_mem_cacheattr          41 Removed - use dmop */
   1136  1.1  cherry #define XEN_DOMCTL_set_ext_vcpucontext           42
   1137  1.1  cherry #define XEN_DOMCTL_get_ext_vcpucontext           43
   1138  1.1  cherry #define XEN_DOMCTL_set_opt_feature               44 /* Obsolete IA64 only */
   1139  1.1  cherry #define XEN_DOMCTL_test_assign_device            45
   1140  1.1  cherry #define XEN_DOMCTL_set_target                    46
   1141  1.1  cherry #define XEN_DOMCTL_deassign_device               47
   1142  1.1  cherry #define XEN_DOMCTL_unbind_pt_irq                 48
   1143  1.1  cherry #define XEN_DOMCTL_set_cpuid                     49
   1144  1.1  cherry #define XEN_DOMCTL_get_device_group              50
   1145  1.1  cherry #define XEN_DOMCTL_set_machine_address_size      51
   1146  1.1  cherry #define XEN_DOMCTL_get_machine_address_size      52
   1147  1.1  cherry #define XEN_DOMCTL_suppress_spurious_page_faults 53
   1148  1.1  cherry #define XEN_DOMCTL_debug_op                      54
   1149  1.1  cherry #define XEN_DOMCTL_gethvmcontext_partial         55
   1150  1.1  cherry #define XEN_DOMCTL_vm_event_op                   56
   1151  1.1  cherry #define XEN_DOMCTL_mem_sharing_op                57
   1152  1.1  cherry #define XEN_DOMCTL_disable_migrate               58
   1153  1.1  cherry #define XEN_DOMCTL_gettscinfo                    59
   1154  1.1  cherry #define XEN_DOMCTL_settscinfo                    60
   1155  1.1  cherry #define XEN_DOMCTL_getpageframeinfo3             61
   1156  1.1  cherry #define XEN_DOMCTL_setvcpuextstate               62
   1157  1.1  cherry #define XEN_DOMCTL_getvcpuextstate               63
   1158  1.1  cherry #define XEN_DOMCTL_set_access_required           64
   1159  1.1  cherry #define XEN_DOMCTL_audit_p2m                     65
   1160  1.1  cherry #define XEN_DOMCTL_set_virq_handler              66
   1161  1.1  cherry #define XEN_DOMCTL_set_broken_page_p2m           67
   1162  1.1  cherry #define XEN_DOMCTL_setnodeaffinity               68
   1163  1.1  cherry #define XEN_DOMCTL_getnodeaffinity               69
   1164  1.1  cherry #define XEN_DOMCTL_set_max_evtchn                70
   1165  1.1  cherry #define XEN_DOMCTL_cacheflush                    71
   1166  1.1  cherry #define XEN_DOMCTL_get_vcpu_msrs                 72
   1167  1.1  cherry #define XEN_DOMCTL_set_vcpu_msrs                 73
   1168  1.1  cherry #define XEN_DOMCTL_setvnumainfo                  74
   1169  1.1  cherry #define XEN_DOMCTL_psr_cmt_op                    75
   1170  1.1  cherry #define XEN_DOMCTL_monitor_op                    77
   1171  1.1  cherry #define XEN_DOMCTL_psr_alloc                     78
   1172  1.1  cherry #define XEN_DOMCTL_soft_reset                    79
   1173  1.1  cherry #define XEN_DOMCTL_set_gnttab_limits             80
   1174  1.1  cherry #define XEN_DOMCTL_vuart_op                      81
   1175  1.1  cherry #define XEN_DOMCTL_gdbsx_guestmemio            1000
   1176  1.1  cherry #define XEN_DOMCTL_gdbsx_pausevcpu             1001
   1177  1.1  cherry #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
   1178  1.1  cherry #define XEN_DOMCTL_gdbsx_domstatus             1003
   1179  1.1  cherry     uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
   1180  1.1  cherry     domid_t  domain;
   1181  1.1  cherry     union {
   1182  1.1  cherry         struct xen_domctl_createdomain      createdomain;
   1183  1.1  cherry         struct xen_domctl_getdomaininfo     getdomaininfo;
   1184  1.1  cherry         struct xen_domctl_getpageframeinfo3 getpageframeinfo3;
   1185  1.1  cherry         struct xen_domctl_nodeaffinity      nodeaffinity;
   1186  1.1  cherry         struct xen_domctl_vcpuaffinity      vcpuaffinity;
   1187  1.1  cherry         struct xen_domctl_shadow_op         shadow_op;
   1188  1.1  cherry         struct xen_domctl_max_mem           max_mem;
   1189  1.1  cherry         struct xen_domctl_vcpucontext       vcpucontext;
   1190  1.1  cherry         struct xen_domctl_getvcpuinfo       getvcpuinfo;
   1191  1.1  cherry         struct xen_domctl_max_vcpus         max_vcpus;
   1192  1.1  cherry         struct xen_domctl_scheduler_op      scheduler_op;
   1193  1.1  cherry         struct xen_domctl_setdomainhandle   setdomainhandle;
   1194  1.1  cherry         struct xen_domctl_setdebugging      setdebugging;
   1195  1.1  cherry         struct xen_domctl_irq_permission    irq_permission;
   1196  1.1  cherry         struct xen_domctl_iomem_permission  iomem_permission;
   1197  1.1  cherry         struct xen_domctl_ioport_permission ioport_permission;
   1198  1.1  cherry         struct xen_domctl_hypercall_init    hypercall_init;
   1199  1.1  cherry         struct xen_domctl_settimeoffset     settimeoffset;
   1200  1.1  cherry         struct xen_domctl_disable_migrate   disable_migrate;
   1201  1.1  cherry         struct xen_domctl_tsc_info          tsc_info;
   1202  1.1  cherry         struct xen_domctl_hvmcontext        hvmcontext;
   1203  1.1  cherry         struct xen_domctl_hvmcontext_partial hvmcontext_partial;
   1204  1.1  cherry         struct xen_domctl_address_size      address_size;
   1205  1.1  cherry         struct xen_domctl_sendtrigger       sendtrigger;
   1206  1.1  cherry         struct xen_domctl_get_device_group  get_device_group;
   1207  1.1  cherry         struct xen_domctl_assign_device     assign_device;
   1208  1.1  cherry         struct xen_domctl_bind_pt_irq       bind_pt_irq;
   1209  1.1  cherry         struct xen_domctl_memory_mapping    memory_mapping;
   1210  1.1  cherry         struct xen_domctl_ioport_mapping    ioport_mapping;
   1211  1.1  cherry         struct xen_domctl_ext_vcpucontext   ext_vcpucontext;
   1212  1.1  cherry         struct xen_domctl_set_target        set_target;
   1213  1.1  cherry         struct xen_domctl_subscribe         subscribe;
   1214  1.1  cherry         struct xen_domctl_debug_op          debug_op;
   1215  1.1  cherry         struct xen_domctl_vm_event_op       vm_event_op;
   1216  1.1  cherry         struct xen_domctl_mem_sharing_op    mem_sharing_op;
   1217  1.1  cherry #if defined(__i386__) || defined(__x86_64__)
   1218  1.1  cherry         struct xen_domctl_cpuid             cpuid;
   1219  1.1  cherry         struct xen_domctl_vcpuextstate      vcpuextstate;
   1220  1.1  cherry         struct xen_domctl_vcpu_msrs         vcpu_msrs;
   1221  1.1  cherry #endif
   1222  1.1  cherry         struct xen_domctl_set_access_required access_required;
   1223  1.1  cherry         struct xen_domctl_audit_p2m         audit_p2m;
   1224  1.1  cherry         struct xen_domctl_set_virq_handler  set_virq_handler;
   1225  1.1  cherry         struct xen_domctl_set_max_evtchn    set_max_evtchn;
   1226  1.1  cherry         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
   1227  1.1  cherry         struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
   1228  1.1  cherry         struct xen_domctl_cacheflush        cacheflush;
   1229  1.1  cherry         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
   1230  1.1  cherry         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
   1231  1.1  cherry         struct xen_domctl_vnuma             vnuma;
   1232  1.1  cherry         struct xen_domctl_psr_cmt_op        psr_cmt_op;
   1233  1.1  cherry         struct xen_domctl_monitor_op        monitor_op;
   1234  1.1  cherry         struct xen_domctl_psr_alloc         psr_alloc;
   1235  1.1  cherry         struct xen_domctl_set_gnttab_limits set_gnttab_limits;
   1236  1.1  cherry         struct xen_domctl_vuart_op          vuart_op;
   1237  1.1  cherry         uint8_t                             pad[128];
   1238  1.1  cherry     } u;
   1239  1.1  cherry };
   1240  1.1  cherry typedef struct xen_domctl xen_domctl_t;
   1241  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_domctl_t);
   1242  1.1  cherry 
   1243  1.1  cherry #endif /* __XEN_PUBLIC_DOMCTL_H__ */
   1244  1.1  cherry 
   1245  1.1  cherry /*
   1246  1.1  cherry  * Local variables:
   1247  1.1  cherry  * mode: C
   1248  1.1  cherry  * c-file-style: "BSD"
   1249  1.1  cherry  * c-basic-offset: 4
   1250  1.1  cherry  * tab-width: 4
   1251  1.1  cherry  * indent-tabs-mode: nil
   1252  1.1  cherry  * End:
   1253  1.1  cherry  */
   1254