xref: /titanic_52/usr/src/uts/common/xen/public/domctl.h (revision ad09f8b827db90c9a0093f0b6382803fa64a5fd1)
1843e1988Sjohnlev /******************************************************************************
2843e1988Sjohnlev  * domctl.h
3843e1988Sjohnlev  *
4843e1988Sjohnlev  * Domain management operations. For use by node control stack.
5843e1988Sjohnlev  *
6843e1988Sjohnlev  * Permission is hereby granted, free of charge, to any person obtaining a copy
7843e1988Sjohnlev  * of this software and associated documentation files (the "Software"), to
8843e1988Sjohnlev  * deal in the Software without restriction, including without limitation the
9843e1988Sjohnlev  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10843e1988Sjohnlev  * sell copies of the Software, and to permit persons to whom the Software is
11843e1988Sjohnlev  * furnished to do so, subject to the following conditions:
12843e1988Sjohnlev  *
13843e1988Sjohnlev  * The above copyright notice and this permission notice shall be included in
14843e1988Sjohnlev  * all copies or substantial portions of the Software.
15843e1988Sjohnlev  *
16843e1988Sjohnlev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17843e1988Sjohnlev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18843e1988Sjohnlev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19843e1988Sjohnlev  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20843e1988Sjohnlev  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21843e1988Sjohnlev  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22843e1988Sjohnlev  * DEALINGS IN THE SOFTWARE.
23843e1988Sjohnlev  *
24843e1988Sjohnlev  * Copyright (c) 2002-2003, B Dragovic
25843e1988Sjohnlev  * Copyright (c) 2002-2006, K Fraser
26843e1988Sjohnlev  */
27843e1988Sjohnlev 
28843e1988Sjohnlev #ifndef __XEN_PUBLIC_DOMCTL_H__
29843e1988Sjohnlev #define __XEN_PUBLIC_DOMCTL_H__
30843e1988Sjohnlev 
31843e1988Sjohnlev #if !defined(__XEN__) && !defined(__XEN_TOOLS__)
32843e1988Sjohnlev #error "domctl operations are intended for use by node control tools only"
33843e1988Sjohnlev #endif
34843e1988Sjohnlev 
35843e1988Sjohnlev #include "xen.h"
36843e1988Sjohnlev 
37a576ab5bSrab #define XEN_DOMCTL_INTERFACE_VERSION 0x00000005
38843e1988Sjohnlev 
39843e1988Sjohnlev struct xenctl_cpumap {
40349b53ddSStuart Maybee     XEN_GUEST_HANDLE_64(uint8) bitmap;
41843e1988Sjohnlev     uint32_t nr_cpus;
42843e1988Sjohnlev };
43843e1988Sjohnlev 
44843e1988Sjohnlev /*
45843e1988Sjohnlev  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
46843e1988Sjohnlev  * If it is specified as zero, an id is auto-allocated and returned.
47843e1988Sjohnlev  */
48843e1988Sjohnlev #define XEN_DOMCTL_createdomain       1
49843e1988Sjohnlev struct xen_domctl_createdomain {
50843e1988Sjohnlev     /* IN parameters */
51843e1988Sjohnlev     uint32_t ssidref;
52843e1988Sjohnlev     xen_domain_handle_t handle;
53843e1988Sjohnlev  /* Is this an HVM guest (as opposed to a PV guest)? */
54843e1988Sjohnlev #define _XEN_DOMCTL_CDF_hvm_guest     0
55843e1988Sjohnlev #define XEN_DOMCTL_CDF_hvm_guest      (1U<<_XEN_DOMCTL_CDF_hvm_guest)
56349b53ddSStuart Maybee  /* Use hardware-assisted paging if available? */
57349b53ddSStuart Maybee #define _XEN_DOMCTL_CDF_hap           1
58349b53ddSStuart Maybee #define XEN_DOMCTL_CDF_hap            (1U<<_XEN_DOMCTL_CDF_hap)
59*ad09f8b8SMark Johnson  /* Should domain memory integrity be verifed by tboot during Sx? */
60*ad09f8b8SMark Johnson #define _XEN_DOMCTL_CDF_s3_integrity  2
61*ad09f8b8SMark Johnson #define XEN_DOMCTL_CDF_s3_integrity   (1U<<_XEN_DOMCTL_CDF_s3_integrity)
62843e1988Sjohnlev     uint32_t flags;
63843e1988Sjohnlev };
64843e1988Sjohnlev typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
65843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t);
66843e1988Sjohnlev 
67843e1988Sjohnlev #define XEN_DOMCTL_destroydomain      2
68843e1988Sjohnlev #define XEN_DOMCTL_pausedomain        3
69843e1988Sjohnlev #define XEN_DOMCTL_unpausedomain      4
70a576ab5bSrab #define XEN_DOMCTL_resumedomain      27
71843e1988Sjohnlev 
72843e1988Sjohnlev #define XEN_DOMCTL_getdomaininfo      5
73843e1988Sjohnlev struct xen_domctl_getdomaininfo {
74843e1988Sjohnlev     /* OUT variables. */
75843e1988Sjohnlev     domid_t  domain;              /* Also echoed in domctl.domain */
76843e1988Sjohnlev  /* Domain is scheduled to die. */
77843e1988Sjohnlev #define _XEN_DOMINF_dying     0
78843e1988Sjohnlev #define XEN_DOMINF_dying      (1U<<_XEN_DOMINF_dying)
79843e1988Sjohnlev  /* Domain is an HVM guest (as opposed to a PV guest). */
80843e1988Sjohnlev #define _XEN_DOMINF_hvm_guest 1
81843e1988Sjohnlev #define XEN_DOMINF_hvm_guest  (1U<<_XEN_DOMINF_hvm_guest)
82843e1988Sjohnlev  /* The guest OS has shut down. */
83843e1988Sjohnlev #define _XEN_DOMINF_shutdown  2
84843e1988Sjohnlev #define XEN_DOMINF_shutdown   (1U<<_XEN_DOMINF_shutdown)
85843e1988Sjohnlev  /* Currently paused by control software. */
86843e1988Sjohnlev #define _XEN_DOMINF_paused    3
87843e1988Sjohnlev #define XEN_DOMINF_paused     (1U<<_XEN_DOMINF_paused)
88843e1988Sjohnlev  /* Currently blocked pending an event.     */
89843e1988Sjohnlev #define _XEN_DOMINF_blocked   4
90843e1988Sjohnlev #define XEN_DOMINF_blocked    (1U<<_XEN_DOMINF_blocked)
91843e1988Sjohnlev  /* Domain is currently running.            */
92843e1988Sjohnlev #define _XEN_DOMINF_running   5
93843e1988Sjohnlev #define XEN_DOMINF_running    (1U<<_XEN_DOMINF_running)
94a576ab5bSrab  /* Being debugged.  */
95a576ab5bSrab #define _XEN_DOMINF_debugged  6
96a576ab5bSrab #define XEN_DOMINF_debugged   (1U<<_XEN_DOMINF_debugged)
97843e1988Sjohnlev  /* XEN_DOMINF_shutdown guest-supplied code.  */
98843e1988Sjohnlev #define XEN_DOMINF_shutdownmask 255
99843e1988Sjohnlev #define XEN_DOMINF_shutdownshift 16
100843e1988Sjohnlev     uint32_t flags;              /* XEN_DOMINF_* */
101a576ab5bSrab     uint64_aligned_t tot_pages;
102a576ab5bSrab     uint64_aligned_t max_pages;
103a576ab5bSrab     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
104a576ab5bSrab     uint64_aligned_t cpu_time;
105843e1988Sjohnlev     uint32_t nr_online_vcpus;    /* Number of VCPUs currently online. */
106843e1988Sjohnlev     uint32_t max_vcpu_id;        /* Maximum VCPUID in use by this domain. */
107843e1988Sjohnlev     uint32_t ssidref;
108843e1988Sjohnlev     xen_domain_handle_t handle;
109843e1988Sjohnlev };
110843e1988Sjohnlev typedef struct xen_domctl_getdomaininfo xen_domctl_getdomaininfo_t;
111843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t);
112843e1988Sjohnlev 
113843e1988Sjohnlev 
114843e1988Sjohnlev #define XEN_DOMCTL_getmemlist         6
115843e1988Sjohnlev struct xen_domctl_getmemlist {
116843e1988Sjohnlev     /* IN variables. */
117843e1988Sjohnlev     /* Max entries to write to output buffer. */
118a576ab5bSrab     uint64_aligned_t max_pfns;
119843e1988Sjohnlev     /* Start index in guest's page list. */
120a576ab5bSrab     uint64_aligned_t start_pfn;
121349b53ddSStuart Maybee     XEN_GUEST_HANDLE_64(uint64) buffer;
122843e1988Sjohnlev     /* OUT variables. */
123a576ab5bSrab     uint64_aligned_t num_pfns;
124843e1988Sjohnlev };
125843e1988Sjohnlev typedef struct xen_domctl_getmemlist xen_domctl_getmemlist_t;
126843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_getmemlist_t);
127843e1988Sjohnlev 
128843e1988Sjohnlev 
129843e1988Sjohnlev #define XEN_DOMCTL_getpageframeinfo   7
130843e1988Sjohnlev 
131843e1988Sjohnlev #define XEN_DOMCTL_PFINFO_LTAB_SHIFT 28
132a576ab5bSrab #define XEN_DOMCTL_PFINFO_NOTAB   (0x0U<<28)
133a576ab5bSrab #define XEN_DOMCTL_PFINFO_L1TAB   (0x1U<<28)
134a576ab5bSrab #define XEN_DOMCTL_PFINFO_L2TAB   (0x2U<<28)
135a576ab5bSrab #define XEN_DOMCTL_PFINFO_L3TAB   (0x3U<<28)
136a576ab5bSrab #define XEN_DOMCTL_PFINFO_L4TAB   (0x4U<<28)
137a576ab5bSrab #define XEN_DOMCTL_PFINFO_LTABTYPE_MASK (0x7U<<28)
138a576ab5bSrab #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
139a576ab5bSrab #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
140a576ab5bSrab #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
141843e1988Sjohnlev 
142843e1988Sjohnlev struct xen_domctl_getpageframeinfo {
143843e1988Sjohnlev     /* IN variables. */
144a576ab5bSrab     uint64_aligned_t gmfn; /* GMFN to query */
145843e1988Sjohnlev     /* OUT variables. */
146843e1988Sjohnlev     /* Is the page PINNED to a type? */
147843e1988Sjohnlev     uint32_t type;         /* see above type defs */
148843e1988Sjohnlev };
149843e1988Sjohnlev typedef struct xen_domctl_getpageframeinfo xen_domctl_getpageframeinfo_t;
150843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo_t);
151843e1988Sjohnlev 
152843e1988Sjohnlev 
153843e1988Sjohnlev #define XEN_DOMCTL_getpageframeinfo2  8
154843e1988Sjohnlev struct xen_domctl_getpageframeinfo2 {
155843e1988Sjohnlev     /* IN variables. */
156a576ab5bSrab     uint64_aligned_t num;
157843e1988Sjohnlev     /* IN/OUT variables. */
158349b53ddSStuart Maybee     XEN_GUEST_HANDLE_64(uint32) array;
159843e1988Sjohnlev };
160843e1988Sjohnlev typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
161843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
162843e1988Sjohnlev 
163843e1988Sjohnlev 
164843e1988Sjohnlev /*
165843e1988Sjohnlev  * Control shadow pagetables operation
166843e1988Sjohnlev  */
167843e1988Sjohnlev #define XEN_DOMCTL_shadow_op         10
168843e1988Sjohnlev 
169843e1988Sjohnlev /* Disable shadow mode. */
170843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_OFF         0
171843e1988Sjohnlev 
172843e1988Sjohnlev /* Enable shadow mode (mode contains ORed XEN_DOMCTL_SHADOW_ENABLE_* flags). */
173843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_ENABLE      32
174843e1988Sjohnlev 
175843e1988Sjohnlev /* Log-dirty bitmap operations. */
176843e1988Sjohnlev  /* Return the bitmap and clean internal copy for next round. */
177843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_CLEAN       11
178843e1988Sjohnlev  /* Return the bitmap but do not modify internal copy. */
179843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_PEEK        12
180843e1988Sjohnlev 
181843e1988Sjohnlev /* Memory allocation accessors. */
182843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION   30
183843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION   31
184843e1988Sjohnlev 
185843e1988Sjohnlev /* Legacy enable operations. */
186843e1988Sjohnlev  /* Equiv. to ENABLE with no mode flags. */
187843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_ENABLE_TEST       1
188843e1988Sjohnlev  /* Equiv. to ENABLE with mode flag ENABLE_LOG_DIRTY. */
189843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY   2
190843e1988Sjohnlev  /* Equiv. to ENABLE with mode flags ENABLE_REFCOUNT and ENABLE_TRANSLATE. */
191843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_OP_ENABLE_TRANSLATE  3
192843e1988Sjohnlev 
193843e1988Sjohnlev /* Mode flags for XEN_DOMCTL_SHADOW_OP_ENABLE. */
194843e1988Sjohnlev  /*
195843e1988Sjohnlev   * Shadow pagetables are refcounted: guest does not use explicit mmu
196843e1988Sjohnlev   * operations nor write-protect its pagetables.
197843e1988Sjohnlev   */
198843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT  (1 << 1)
199843e1988Sjohnlev  /*
200843e1988Sjohnlev   * Log pages in a bitmap as they are dirtied.
201843e1988Sjohnlev   * Used for live relocation to determine which pages must be re-sent.
202843e1988Sjohnlev   */
203843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY (1 << 2)
204843e1988Sjohnlev  /*
205843e1988Sjohnlev   * Automatically translate GPFNs into MFNs.
206843e1988Sjohnlev   */
207843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_ENABLE_TRANSLATE (1 << 3)
208843e1988Sjohnlev  /*
209843e1988Sjohnlev   * Xen does not steal virtual address space from the guest.
210843e1988Sjohnlev   * Requires HVM support.
211843e1988Sjohnlev   */
212843e1988Sjohnlev #define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL  (1 << 4)
213843e1988Sjohnlev 
214843e1988Sjohnlev struct xen_domctl_shadow_op_stats {
215843e1988Sjohnlev     uint32_t fault_count;
216843e1988Sjohnlev     uint32_t dirty_count;
217843e1988Sjohnlev };
218843e1988Sjohnlev typedef struct xen_domctl_shadow_op_stats xen_domctl_shadow_op_stats_t;
219843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_stats_t);
220843e1988Sjohnlev 
221843e1988Sjohnlev struct xen_domctl_shadow_op {
222843e1988Sjohnlev     /* IN variables. */
223843e1988Sjohnlev     uint32_t       op;       /* XEN_DOMCTL_SHADOW_OP_* */
224843e1988Sjohnlev 
225843e1988Sjohnlev     /* OP_ENABLE */
226843e1988Sjohnlev     uint32_t       mode;     /* XEN_DOMCTL_SHADOW_ENABLE_* */
227843e1988Sjohnlev 
228843e1988Sjohnlev     /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */
229843e1988Sjohnlev     uint32_t       mb;       /* Shadow memory allocation in MB */
230843e1988Sjohnlev 
231843e1988Sjohnlev     /* OP_PEEK / OP_CLEAN */
232349b53ddSStuart Maybee     XEN_GUEST_HANDLE_64(uint8) dirty_bitmap;
233a576ab5bSrab     uint64_aligned_t pages; /* Size of buffer. Updated with actual size. */
234843e1988Sjohnlev     struct xen_domctl_shadow_op_stats stats;
235843e1988Sjohnlev };
236843e1988Sjohnlev typedef struct xen_domctl_shadow_op xen_domctl_shadow_op_t;
237843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_t);
238843e1988Sjohnlev 
239843e1988Sjohnlev 
240843e1988Sjohnlev #define XEN_DOMCTL_max_mem           11
241843e1988Sjohnlev struct xen_domctl_max_mem {
242843e1988Sjohnlev     /* IN variables. */
243a576ab5bSrab     uint64_aligned_t max_memkb;
244843e1988Sjohnlev };
245843e1988Sjohnlev typedef struct xen_domctl_max_mem xen_domctl_max_mem_t;
246843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_mem_t);
247843e1988Sjohnlev 
248843e1988Sjohnlev 
249843e1988Sjohnlev #define XEN_DOMCTL_setvcpucontext    12
250843e1988Sjohnlev #define XEN_DOMCTL_getvcpucontext    13
251843e1988Sjohnlev struct xen_domctl_vcpucontext {
252843e1988Sjohnlev     uint32_t              vcpu;                  /* IN */
253a576ab5bSrab     XEN_GUEST_HANDLE_64(vcpu_guest_context_t) ctxt; /* IN/OUT */
254843e1988Sjohnlev };
255843e1988Sjohnlev typedef struct xen_domctl_vcpucontext xen_domctl_vcpucontext_t;
256843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpucontext_t);
257843e1988Sjohnlev 
258843e1988Sjohnlev 
259843e1988Sjohnlev #define XEN_DOMCTL_getvcpuinfo       14
260843e1988Sjohnlev struct xen_domctl_getvcpuinfo {
261843e1988Sjohnlev     /* IN variables. */
262843e1988Sjohnlev     uint32_t vcpu;
263843e1988Sjohnlev     /* OUT variables. */
264843e1988Sjohnlev     uint8_t  online;                  /* currently online (not hotplugged)? */
265843e1988Sjohnlev     uint8_t  blocked;                 /* blocked waiting for an event? */
266843e1988Sjohnlev     uint8_t  running;                 /* currently scheduled on its CPU? */
267a576ab5bSrab     uint64_aligned_t cpu_time;        /* total cpu time consumed (ns) */
268843e1988Sjohnlev     uint32_t cpu;                     /* current mapping   */
269843e1988Sjohnlev };
270843e1988Sjohnlev typedef struct xen_domctl_getvcpuinfo xen_domctl_getvcpuinfo_t;
271843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
272843e1988Sjohnlev 
273843e1988Sjohnlev 
274843e1988Sjohnlev /* Get/set which physical cpus a vcpu can execute on. */
275843e1988Sjohnlev #define XEN_DOMCTL_setvcpuaffinity    9
276843e1988Sjohnlev #define XEN_DOMCTL_getvcpuaffinity   25
277843e1988Sjohnlev struct xen_domctl_vcpuaffinity {
278843e1988Sjohnlev     uint32_t  vcpu;              /* IN */
279843e1988Sjohnlev     struct xenctl_cpumap cpumap; /* IN/OUT */
280843e1988Sjohnlev };
281843e1988Sjohnlev typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
282843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
283843e1988Sjohnlev 
284843e1988Sjohnlev 
285843e1988Sjohnlev #define XEN_DOMCTL_max_vcpus         15
286843e1988Sjohnlev struct xen_domctl_max_vcpus {
287843e1988Sjohnlev     uint32_t max;           /* maximum number of vcpus */
288843e1988Sjohnlev };
289843e1988Sjohnlev typedef struct xen_domctl_max_vcpus xen_domctl_max_vcpus_t;
290843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t);
291843e1988Sjohnlev 
292843e1988Sjohnlev 
293843e1988Sjohnlev #define XEN_DOMCTL_scheduler_op      16
294843e1988Sjohnlev /* Scheduler types. */
295843e1988Sjohnlev #define XEN_SCHEDULER_SEDF     4
296843e1988Sjohnlev #define XEN_SCHEDULER_CREDIT   5
297843e1988Sjohnlev /* Set or get info? */
298843e1988Sjohnlev #define XEN_DOMCTL_SCHEDOP_putinfo 0
299843e1988Sjohnlev #define XEN_DOMCTL_SCHEDOP_getinfo 1
300843e1988Sjohnlev struct xen_domctl_scheduler_op {
301843e1988Sjohnlev     uint32_t sched_id;  /* XEN_SCHEDULER_* */
302843e1988Sjohnlev     uint32_t cmd;       /* XEN_DOMCTL_SCHEDOP_* */
303843e1988Sjohnlev     union {
304843e1988Sjohnlev         struct xen_domctl_sched_sedf {
305a576ab5bSrab             uint64_aligned_t period;
306a576ab5bSrab             uint64_aligned_t slice;
307a576ab5bSrab             uint64_aligned_t latency;
308843e1988Sjohnlev             uint32_t extratime;
309843e1988Sjohnlev             uint32_t weight;
310843e1988Sjohnlev         } sedf;
311843e1988Sjohnlev         struct xen_domctl_sched_credit {
312843e1988Sjohnlev             uint16_t weight;
313843e1988Sjohnlev             uint16_t cap;
314843e1988Sjohnlev         } credit;
315843e1988Sjohnlev     } u;
316843e1988Sjohnlev };
317843e1988Sjohnlev typedef struct xen_domctl_scheduler_op xen_domctl_scheduler_op_t;
318843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_scheduler_op_t);
319843e1988Sjohnlev 
320843e1988Sjohnlev 
321843e1988Sjohnlev #define XEN_DOMCTL_setdomainhandle   17
322843e1988Sjohnlev struct xen_domctl_setdomainhandle {
323843e1988Sjohnlev     xen_domain_handle_t handle;
324843e1988Sjohnlev };
325843e1988Sjohnlev typedef struct xen_domctl_setdomainhandle xen_domctl_setdomainhandle_t;
326843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdomainhandle_t);
327843e1988Sjohnlev 
328843e1988Sjohnlev 
329843e1988Sjohnlev #define XEN_DOMCTL_setdebugging      18
330843e1988Sjohnlev struct xen_domctl_setdebugging {
331843e1988Sjohnlev     uint8_t enable;
332843e1988Sjohnlev };
333843e1988Sjohnlev typedef struct xen_domctl_setdebugging xen_domctl_setdebugging_t;
334843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdebugging_t);
335843e1988Sjohnlev 
336843e1988Sjohnlev 
337843e1988Sjohnlev #define XEN_DOMCTL_irq_permission    19
338843e1988Sjohnlev struct xen_domctl_irq_permission {
339843e1988Sjohnlev     uint8_t pirq;
340843e1988Sjohnlev     uint8_t allow_access;    /* flag to specify enable/disable of IRQ access */
341843e1988Sjohnlev };
342843e1988Sjohnlev typedef struct xen_domctl_irq_permission xen_domctl_irq_permission_t;
343843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_irq_permission_t);
344843e1988Sjohnlev 
345843e1988Sjohnlev 
346843e1988Sjohnlev #define XEN_DOMCTL_iomem_permission  20
347843e1988Sjohnlev struct xen_domctl_iomem_permission {
348a576ab5bSrab     uint64_aligned_t first_mfn;/* first page (physical page number) in range */
349a576ab5bSrab     uint64_aligned_t nr_mfns;  /* number of pages in range (>0) */
350843e1988Sjohnlev     uint8_t  allow_access;     /* allow (!0) or deny (0) access to range? */
351843e1988Sjohnlev };
352843e1988Sjohnlev typedef struct xen_domctl_iomem_permission xen_domctl_iomem_permission_t;
353843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_iomem_permission_t);
354843e1988Sjohnlev 
355843e1988Sjohnlev 
356843e1988Sjohnlev #define XEN_DOMCTL_ioport_permission 21
357843e1988Sjohnlev struct xen_domctl_ioport_permission {
358843e1988Sjohnlev     uint32_t first_port;              /* first port int range */
359843e1988Sjohnlev     uint32_t nr_ports;                /* size of port range */
360843e1988Sjohnlev     uint8_t  allow_access;            /* allow or deny access to range? */
361843e1988Sjohnlev };
362843e1988Sjohnlev typedef struct xen_domctl_ioport_permission xen_domctl_ioport_permission_t;
363843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_permission_t);
364843e1988Sjohnlev 
365a576ab5bSrab 
366843e1988Sjohnlev #define XEN_DOMCTL_hypercall_init    22
367843e1988Sjohnlev struct xen_domctl_hypercall_init {
368a576ab5bSrab     uint64_aligned_t  gmfn;           /* GMFN to be initialised */
369843e1988Sjohnlev };
370843e1988Sjohnlev typedef struct xen_domctl_hypercall_init xen_domctl_hypercall_init_t;
371843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t);
372843e1988Sjohnlev 
373a576ab5bSrab 
374843e1988Sjohnlev #define XEN_DOMCTL_arch_setup        23
375843e1988Sjohnlev #define _XEN_DOMAINSETUP_hvm_guest 0
376843e1988Sjohnlev #define XEN_DOMAINSETUP_hvm_guest  (1UL<<_XEN_DOMAINSETUP_hvm_guest)
377843e1988Sjohnlev #define _XEN_DOMAINSETUP_query 1 /* Get parameters (for save)  */
378843e1988Sjohnlev #define XEN_DOMAINSETUP_query  (1UL<<_XEN_DOMAINSETUP_query)
379349b53ddSStuart Maybee #define _XEN_DOMAINSETUP_sioemu_guest 2
380349b53ddSStuart Maybee #define XEN_DOMAINSETUP_sioemu_guest  (1UL<<_XEN_DOMAINSETUP_sioemu_guest)
381843e1988Sjohnlev typedef struct xen_domctl_arch_setup {
382a576ab5bSrab     uint64_aligned_t flags;  /* XEN_DOMAINSETUP_* */
383843e1988Sjohnlev #ifdef __ia64__
384a576ab5bSrab     uint64_aligned_t bp;     /* mpaddr of boot param area */
385a576ab5bSrab     uint64_aligned_t maxmem; /* Highest memory address for MDT.  */
386a576ab5bSrab     uint64_aligned_t xsi_va; /* Xen shared_info area virtual address.  */
387843e1988Sjohnlev     uint32_t hypercall_imm;  /* Break imm for Xen hypercalls.  */
388349b53ddSStuart Maybee     int8_t vhpt_size_log2;   /* Log2 of VHPT size. */
389843e1988Sjohnlev #endif
390843e1988Sjohnlev } xen_domctl_arch_setup_t;
391843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
392843e1988Sjohnlev 
393a576ab5bSrab 
394843e1988Sjohnlev #define XEN_DOMCTL_settimeoffset     24
395843e1988Sjohnlev struct xen_domctl_settimeoffset {
396843e1988Sjohnlev     int32_t  time_offset_seconds; /* applied to domain wallclock time */
397843e1988Sjohnlev };
398843e1988Sjohnlev typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
399843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
400843e1988Sjohnlev 
401a576ab5bSrab 
402a576ab5bSrab #define XEN_DOMCTL_gethvmcontext     33
403a576ab5bSrab #define XEN_DOMCTL_sethvmcontext     34
404a576ab5bSrab typedef struct xen_domctl_hvmcontext {
405a576ab5bSrab     uint32_t size; /* IN/OUT: size of buffer / bytes filled */
406349b53ddSStuart Maybee     XEN_GUEST_HANDLE_64(uint8) buffer; /* IN/OUT: data, or call
407a576ab5bSrab                                         * gethvmcontext with NULL
408349b53ddSStuart Maybee                                         * buffer to get size req'd */
409a576ab5bSrab } xen_domctl_hvmcontext_t;
410a576ab5bSrab DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_t);
411a576ab5bSrab 
412a576ab5bSrab 
413a576ab5bSrab #define XEN_DOMCTL_set_address_size  35
414a576ab5bSrab #define XEN_DOMCTL_get_address_size  36
415a576ab5bSrab typedef struct xen_domctl_address_size {
416a576ab5bSrab     uint32_t size;
417a576ab5bSrab } xen_domctl_address_size_t;
418a576ab5bSrab DEFINE_XEN_GUEST_HANDLE(xen_domctl_address_size_t);
419a576ab5bSrab 
420a576ab5bSrab 
421843e1988Sjohnlev #define XEN_DOMCTL_real_mode_area    26
422843e1988Sjohnlev struct xen_domctl_real_mode_area {
423843e1988Sjohnlev     uint32_t log; /* log2 of Real Mode Area size */
424843e1988Sjohnlev };
425843e1988Sjohnlev typedef struct xen_domctl_real_mode_area xen_domctl_real_mode_area_t;
426843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_real_mode_area_t);
427843e1988Sjohnlev 
428a576ab5bSrab 
429a576ab5bSrab #define XEN_DOMCTL_sendtrigger       28
430a576ab5bSrab #define XEN_DOMCTL_SENDTRIGGER_NMI    0
431a576ab5bSrab #define XEN_DOMCTL_SENDTRIGGER_RESET  1
432a576ab5bSrab #define XEN_DOMCTL_SENDTRIGGER_INIT   2
433*ad09f8b8SMark Johnson #define XEN_DOMCTL_SENDTRIGGER_POWER  3
434a576ab5bSrab struct xen_domctl_sendtrigger {
435a576ab5bSrab     uint32_t  trigger;  /* IN */
436a576ab5bSrab     uint32_t  vcpu;     /* IN */
437a576ab5bSrab };
438a576ab5bSrab typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t;
439a576ab5bSrab DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
440a576ab5bSrab 
441a576ab5bSrab 
442349b53ddSStuart Maybee /* Assign PCI device to HVM guest. Sets up IOMMU structures. */
443349b53ddSStuart Maybee #define XEN_DOMCTL_assign_device      37
444349b53ddSStuart Maybee #define XEN_DOMCTL_test_assign_device 45
445349b53ddSStuart Maybee #define XEN_DOMCTL_deassign_device 47
446349b53ddSStuart Maybee struct xen_domctl_assign_device {
447349b53ddSStuart Maybee     uint32_t  machine_bdf;   /* machine PCI ID of assigned device */
448349b53ddSStuart Maybee };
449349b53ddSStuart Maybee typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
450349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
451349b53ddSStuart Maybee 
452349b53ddSStuart Maybee /* Retrieve sibling devices infomation of machine_bdf */
453349b53ddSStuart Maybee #define XEN_DOMCTL_get_device_group 50
454349b53ddSStuart Maybee struct xen_domctl_get_device_group {
455349b53ddSStuart Maybee     uint32_t  machine_bdf;      /* IN */
456349b53ddSStuart Maybee     uint32_t  max_sdevs;        /* IN */
457349b53ddSStuart Maybee     uint32_t  num_sdevs;        /* OUT */
458349b53ddSStuart Maybee     XEN_GUEST_HANDLE_64(uint32)  sdev_array;   /* OUT */
459349b53ddSStuart Maybee };
460349b53ddSStuart Maybee typedef struct xen_domctl_get_device_group xen_domctl_get_device_group_t;
461349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_get_device_group_t);
462349b53ddSStuart Maybee 
463349b53ddSStuart Maybee /* Pass-through interrupts: bind real irq -> hvm devfn. */
464349b53ddSStuart Maybee #define XEN_DOMCTL_bind_pt_irq       38
465349b53ddSStuart Maybee #define XEN_DOMCTL_unbind_pt_irq     48
466349b53ddSStuart Maybee typedef enum pt_irq_type_e {
467349b53ddSStuart Maybee     PT_IRQ_TYPE_PCI,
468349b53ddSStuart Maybee     PT_IRQ_TYPE_ISA,
469349b53ddSStuart Maybee     PT_IRQ_TYPE_MSI,
470*ad09f8b8SMark Johnson     PT_IRQ_TYPE_MSI_TRANSLATE,
471349b53ddSStuart Maybee } pt_irq_type_t;
472349b53ddSStuart Maybee struct xen_domctl_bind_pt_irq {
473349b53ddSStuart Maybee     uint32_t machine_irq;
474349b53ddSStuart Maybee     pt_irq_type_t irq_type;
475349b53ddSStuart Maybee     uint32_t hvm_domid;
476349b53ddSStuart Maybee 
477349b53ddSStuart Maybee     union {
478349b53ddSStuart Maybee         struct {
479349b53ddSStuart Maybee             uint8_t isa_irq;
480349b53ddSStuart Maybee         } isa;
481349b53ddSStuart Maybee         struct {
482349b53ddSStuart Maybee             uint8_t bus;
483349b53ddSStuart Maybee             uint8_t device;
484349b53ddSStuart Maybee             uint8_t intx;
485349b53ddSStuart Maybee         } pci;
486349b53ddSStuart Maybee         struct {
487349b53ddSStuart Maybee             uint8_t gvec;
488349b53ddSStuart Maybee             uint32_t gflags;
489*ad09f8b8SMark Johnson             uint64_aligned_t gtable;
490349b53ddSStuart Maybee         } msi;
491349b53ddSStuart Maybee     } u;
492349b53ddSStuart Maybee };
493349b53ddSStuart Maybee typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t;
494349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_pt_irq_t);
495349b53ddSStuart Maybee 
496349b53ddSStuart Maybee 
497349b53ddSStuart Maybee /* Bind machine I/O address range -> HVM address range. */
498349b53ddSStuart Maybee #define XEN_DOMCTL_memory_mapping    39
499349b53ddSStuart Maybee #define DPCI_ADD_MAPPING         1
500349b53ddSStuart Maybee #define DPCI_REMOVE_MAPPING      0
501349b53ddSStuart Maybee struct xen_domctl_memory_mapping {
502349b53ddSStuart Maybee     uint64_aligned_t first_gfn; /* first page (hvm guest phys page) in range */
503349b53ddSStuart Maybee     uint64_aligned_t first_mfn; /* first page (machine page) in range */
504349b53ddSStuart Maybee     uint64_aligned_t nr_mfns;   /* number of pages in range (>0) */
505349b53ddSStuart Maybee     uint32_t add_mapping;       /* add or remove mapping */
506349b53ddSStuart Maybee     uint32_t padding;           /* padding for 64-bit aligned structure */
507349b53ddSStuart Maybee };
508349b53ddSStuart Maybee typedef struct xen_domctl_memory_mapping xen_domctl_memory_mapping_t;
509349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_memory_mapping_t);
510349b53ddSStuart Maybee 
511349b53ddSStuart Maybee 
512349b53ddSStuart Maybee /* Bind machine I/O port range -> HVM I/O port range. */
513349b53ddSStuart Maybee #define XEN_DOMCTL_ioport_mapping    40
514349b53ddSStuart Maybee struct xen_domctl_ioport_mapping {
515349b53ddSStuart Maybee     uint32_t first_gport;     /* first guest IO port*/
516349b53ddSStuart Maybee     uint32_t first_mport;     /* first machine IO port */
517349b53ddSStuart Maybee     uint32_t nr_ports;        /* size of port range */
518349b53ddSStuart Maybee     uint32_t add_mapping;     /* add or remove mapping */
519349b53ddSStuart Maybee };
520349b53ddSStuart Maybee typedef struct xen_domctl_ioport_mapping xen_domctl_ioport_mapping_t;
521349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_mapping_t);
522349b53ddSStuart Maybee 
523349b53ddSStuart Maybee 
524349b53ddSStuart Maybee /*
525349b53ddSStuart Maybee  * Pin caching type of RAM space for x86 HVM domU.
526349b53ddSStuart Maybee  */
527349b53ddSStuart Maybee #define XEN_DOMCTL_pin_mem_cacheattr 41
528349b53ddSStuart Maybee /* Caching types: these happen to be the same as x86 MTRR/PAT type codes. */
529349b53ddSStuart Maybee #define XEN_DOMCTL_MEM_CACHEATTR_UC  0
530349b53ddSStuart Maybee #define XEN_DOMCTL_MEM_CACHEATTR_WC  1
531349b53ddSStuart Maybee #define XEN_DOMCTL_MEM_CACHEATTR_WT  4
532349b53ddSStuart Maybee #define XEN_DOMCTL_MEM_CACHEATTR_WP  5
533349b53ddSStuart Maybee #define XEN_DOMCTL_MEM_CACHEATTR_WB  6
534349b53ddSStuart Maybee #define XEN_DOMCTL_MEM_CACHEATTR_UCM 7
535349b53ddSStuart Maybee struct xen_domctl_pin_mem_cacheattr {
536349b53ddSStuart Maybee     uint64_aligned_t start, end;
537349b53ddSStuart Maybee     unsigned int type; /* XEN_DOMCTL_MEM_CACHEATTR_* */
538349b53ddSStuart Maybee };
539349b53ddSStuart Maybee typedef struct xen_domctl_pin_mem_cacheattr xen_domctl_pin_mem_cacheattr_t;
540349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_pin_mem_cacheattr_t);
541349b53ddSStuart Maybee 
542349b53ddSStuart Maybee 
543349b53ddSStuart Maybee #define XEN_DOMCTL_set_ext_vcpucontext 42
544349b53ddSStuart Maybee #define XEN_DOMCTL_get_ext_vcpucontext 43
545349b53ddSStuart Maybee struct xen_domctl_ext_vcpucontext {
546349b53ddSStuart Maybee     /* IN: VCPU that this call applies to. */
547349b53ddSStuart Maybee     uint32_t         vcpu;
548349b53ddSStuart Maybee     /*
549349b53ddSStuart Maybee      * SET: Size of struct (IN)
550349b53ddSStuart Maybee      * GET: Size of struct (OUT)
551349b53ddSStuart Maybee      */
552349b53ddSStuart Maybee     uint32_t         size;
553349b53ddSStuart Maybee #if defined(__i386__) || defined(__x86_64__)
554349b53ddSStuart Maybee     /* SYSCALL from 32-bit mode and SYSENTER callback information. */
555349b53ddSStuart Maybee     /* NB. SYSCALL from 64-bit mode is contained in vcpu_guest_context_t */
556349b53ddSStuart Maybee     uint64_aligned_t syscall32_callback_eip;
557349b53ddSStuart Maybee     uint64_aligned_t sysenter_callback_eip;
558349b53ddSStuart Maybee     uint16_t         syscall32_callback_cs;
559349b53ddSStuart Maybee     uint16_t         sysenter_callback_cs;
560349b53ddSStuart Maybee     uint8_t          syscall32_disables_events;
561349b53ddSStuart Maybee     uint8_t          sysenter_disables_events;
562349b53ddSStuart Maybee #endif
563349b53ddSStuart Maybee };
564349b53ddSStuart Maybee typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
565349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_ext_vcpucontext_t);
566349b53ddSStuart Maybee 
567349b53ddSStuart Maybee /*
568349b53ddSStuart Maybee  * Set optimizaton features for a domain
569349b53ddSStuart Maybee  */
570349b53ddSStuart Maybee #define XEN_DOMCTL_set_opt_feature    44
571349b53ddSStuart Maybee struct xen_domctl_set_opt_feature {
572349b53ddSStuart Maybee #if defined(__ia64__)
573349b53ddSStuart Maybee     struct xen_ia64_opt_feature optf;
574349b53ddSStuart Maybee #else
575349b53ddSStuart Maybee     /* Make struct non-empty: do not depend on this field name! */
576349b53ddSStuart Maybee     uint64_t dummy;
577349b53ddSStuart Maybee #endif
578349b53ddSStuart Maybee };
579349b53ddSStuart Maybee typedef struct xen_domctl_set_opt_feature xen_domctl_set_opt_feature_t;
580349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_opt_feature_t);
581349b53ddSStuart Maybee 
582349b53ddSStuart Maybee /*
583349b53ddSStuart Maybee  * Set the target domain for a domain
584349b53ddSStuart Maybee  */
585349b53ddSStuart Maybee #define XEN_DOMCTL_set_target    46
586349b53ddSStuart Maybee struct xen_domctl_set_target {
587349b53ddSStuart Maybee     domid_t target;
588349b53ddSStuart Maybee };
589349b53ddSStuart Maybee typedef struct xen_domctl_set_target xen_domctl_set_target_t;
590349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_target_t);
591349b53ddSStuart Maybee 
592349b53ddSStuart Maybee #if defined(__i386__) || defined(__x86_64__)
593349b53ddSStuart Maybee # define XEN_CPUID_INPUT_UNUSED  0xFFFFFFFF
594349b53ddSStuart Maybee # define XEN_DOMCTL_set_cpuid 49
595349b53ddSStuart Maybee struct xen_domctl_cpuid {
596349b53ddSStuart Maybee   unsigned int  input[2];
597349b53ddSStuart Maybee   unsigned int  eax;
598349b53ddSStuart Maybee   unsigned int  ebx;
599349b53ddSStuart Maybee   unsigned int  ecx;
600349b53ddSStuart Maybee   unsigned int  edx;
601349b53ddSStuart Maybee };
602349b53ddSStuart Maybee typedef struct xen_domctl_cpuid xen_domctl_cpuid_t;
603349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_cpuid_t);
604349b53ddSStuart Maybee #endif
605349b53ddSStuart Maybee 
606349b53ddSStuart Maybee #define XEN_DOMCTL_subscribe          29
607349b53ddSStuart Maybee struct xen_domctl_subscribe {
608349b53ddSStuart Maybee     uint32_t port; /* IN */
609349b53ddSStuart Maybee };
610349b53ddSStuart Maybee typedef struct xen_domctl_subscribe xen_domctl_subscribe_t;
611349b53ddSStuart Maybee DEFINE_XEN_GUEST_HANDLE(xen_domctl_subscribe_t);
612349b53ddSStuart Maybee 
613349b53ddSStuart Maybee /*
614349b53ddSStuart Maybee  * Define the maximum machine address size which should be allocated
615349b53ddSStuart Maybee  * to a guest.
616349b53ddSStuart Maybee  */
617349b53ddSStuart Maybee #define XEN_DOMCTL_set_machine_address_size  51
618349b53ddSStuart Maybee #define XEN_DOMCTL_get_machine_address_size  52
619349b53ddSStuart Maybee 
620349b53ddSStuart Maybee /*
621349b53ddSStuart Maybee  * Do not inject spurious page faults into this domain.
622349b53ddSStuart Maybee  */
623349b53ddSStuart Maybee #define XEN_DOMCTL_suppress_spurious_page_faults 53
624349b53ddSStuart Maybee 
625*ad09f8b8SMark Johnson #define XEN_DOMCTL_debug_op    54
626*ad09f8b8SMark Johnson #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF         0
627*ad09f8b8SMark Johnson #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON          1
628*ad09f8b8SMark Johnson struct xen_domctl_debug_op {
629*ad09f8b8SMark Johnson     uint32_t op;   /* IN */
630*ad09f8b8SMark Johnson     uint32_t vcpu; /* IN */
631*ad09f8b8SMark Johnson };
632*ad09f8b8SMark Johnson typedef struct xen_domctl_debug_op xen_domctl_debug_op_t;
633*ad09f8b8SMark Johnson DEFINE_XEN_GUEST_HANDLE(xen_domctl_debug_op_t);
634*ad09f8b8SMark Johnson 
635*ad09f8b8SMark Johnson /*
636*ad09f8b8SMark Johnson  * Request a particular record from the HVM context
637*ad09f8b8SMark Johnson  */
638*ad09f8b8SMark Johnson #define XEN_DOMCTL_gethvmcontext_partial   55
639*ad09f8b8SMark Johnson typedef struct xen_domctl_hvmcontext_partial {
640*ad09f8b8SMark Johnson     uint32_t type;                      /* IN: Type of record required */
641*ad09f8b8SMark Johnson     uint32_t instance;                  /* IN: Instance of that type */
642*ad09f8b8SMark Johnson     XEN_GUEST_HANDLE_64(uint8) buffer;  /* OUT: buffer to write record into */
643*ad09f8b8SMark Johnson } xen_domctl_hvmcontext_partial_t;
644*ad09f8b8SMark Johnson DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_partial_t);
645*ad09f8b8SMark Johnson 
646*ad09f8b8SMark Johnson 
647843e1988Sjohnlev struct xen_domctl {
648843e1988Sjohnlev     uint32_t cmd;
649843e1988Sjohnlev     uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
650843e1988Sjohnlev     domid_t  domain;
651843e1988Sjohnlev     union {
652843e1988Sjohnlev         struct xen_domctl_createdomain      createdomain;
653843e1988Sjohnlev         struct xen_domctl_getdomaininfo     getdomaininfo;
654843e1988Sjohnlev         struct xen_domctl_getmemlist        getmemlist;
655843e1988Sjohnlev         struct xen_domctl_getpageframeinfo  getpageframeinfo;
656843e1988Sjohnlev         struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
657843e1988Sjohnlev         struct xen_domctl_vcpuaffinity      vcpuaffinity;
658843e1988Sjohnlev         struct xen_domctl_shadow_op         shadow_op;
659843e1988Sjohnlev         struct xen_domctl_max_mem           max_mem;
660843e1988Sjohnlev         struct xen_domctl_vcpucontext       vcpucontext;
661843e1988Sjohnlev         struct xen_domctl_getvcpuinfo       getvcpuinfo;
662843e1988Sjohnlev         struct xen_domctl_max_vcpus         max_vcpus;
663843e1988Sjohnlev         struct xen_domctl_scheduler_op      scheduler_op;
664843e1988Sjohnlev         struct xen_domctl_setdomainhandle   setdomainhandle;
665843e1988Sjohnlev         struct xen_domctl_setdebugging      setdebugging;
666843e1988Sjohnlev         struct xen_domctl_irq_permission    irq_permission;
667843e1988Sjohnlev         struct xen_domctl_iomem_permission  iomem_permission;
668843e1988Sjohnlev         struct xen_domctl_ioport_permission ioport_permission;
669843e1988Sjohnlev         struct xen_domctl_hypercall_init    hypercall_init;
670843e1988Sjohnlev         struct xen_domctl_arch_setup        arch_setup;
671843e1988Sjohnlev         struct xen_domctl_settimeoffset     settimeoffset;
672843e1988Sjohnlev         struct xen_domctl_real_mode_area    real_mode_area;
673a576ab5bSrab         struct xen_domctl_hvmcontext        hvmcontext;
674*ad09f8b8SMark Johnson         struct xen_domctl_hvmcontext_partial hvmcontext_partial;
675a576ab5bSrab         struct xen_domctl_address_size      address_size;
676a576ab5bSrab         struct xen_domctl_sendtrigger       sendtrigger;
677349b53ddSStuart Maybee         struct xen_domctl_get_device_group  get_device_group;
678349b53ddSStuart Maybee         struct xen_domctl_assign_device     assign_device;
679349b53ddSStuart Maybee         struct xen_domctl_bind_pt_irq       bind_pt_irq;
680349b53ddSStuart Maybee         struct xen_domctl_memory_mapping    memory_mapping;
681349b53ddSStuart Maybee         struct xen_domctl_ioport_mapping    ioport_mapping;
682349b53ddSStuart Maybee         struct xen_domctl_pin_mem_cacheattr pin_mem_cacheattr;
683349b53ddSStuart Maybee         struct xen_domctl_ext_vcpucontext   ext_vcpucontext;
684349b53ddSStuart Maybee         struct xen_domctl_set_opt_feature   set_opt_feature;
685349b53ddSStuart Maybee         struct xen_domctl_set_target        set_target;
686349b53ddSStuart Maybee         struct xen_domctl_subscribe         subscribe;
687*ad09f8b8SMark Johnson         struct xen_domctl_debug_op          debug_op;
688349b53ddSStuart Maybee #if defined(__i386__) || defined(__x86_64__)
689349b53ddSStuart Maybee         struct xen_domctl_cpuid             cpuid;
690349b53ddSStuart Maybee #endif
691843e1988Sjohnlev         uint8_t                             pad[128];
692843e1988Sjohnlev     } u;
693843e1988Sjohnlev };
694843e1988Sjohnlev typedef struct xen_domctl xen_domctl_t;
695843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xen_domctl_t);
696843e1988Sjohnlev 
697843e1988Sjohnlev #endif /* __XEN_PUBLIC_DOMCTL_H__ */
698843e1988Sjohnlev 
699843e1988Sjohnlev /*
700843e1988Sjohnlev  * Local variables:
701843e1988Sjohnlev  * mode: C
702843e1988Sjohnlev  * c-set-style: "BSD"
703843e1988Sjohnlev  * c-basic-offset: 4
704843e1988Sjohnlev  * tab-width: 4
705843e1988Sjohnlev  * indent-tabs-mode: nil
706843e1988Sjohnlev  * End:
707843e1988Sjohnlev  */
708