ia64/xen-unstable

view xen/include/public/domctl.h @ 19836:d9890e67d2b7

tools: add SHAREDIR to buildmakevars2file

c/s 19818 dropped SHAREDIR from xen/util/path.py, which broke the "xm
new" command. This patch adds SHAREDIR back to the new
buildmakevars2file-closure function.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:05:10 2009 +0100 (2009-06-25)
parents 567d312e80ad
children
line source
1 /******************************************************************************
2 * domctl.h
3 *
4 * Domain management operations. For use by node control stack.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Copyright (c) 2002-2003, B Dragovic
25 * Copyright (c) 2002-2006, K Fraser
26 */
28 #ifndef __XEN_PUBLIC_DOMCTL_H__
29 #define __XEN_PUBLIC_DOMCTL_H__
31 #if !defined(__XEN__) && !defined(__XEN_TOOLS__)
32 #error "domctl operations are intended for use by node control tools only"
33 #endif
35 #include "xen.h"
37 #define XEN_DOMCTL_INTERFACE_VERSION 0x00000005
39 struct xenctl_cpumap {
40 XEN_GUEST_HANDLE_64(uint8) bitmap;
41 uint32_t nr_cpus;
42 };
44 /*
45 * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
46 * If it is specified as zero, an id is auto-allocated and returned.
47 */
48 #define XEN_DOMCTL_createdomain 1
49 struct xen_domctl_createdomain {
50 /* IN parameters */
51 uint32_t ssidref;
52 xen_domain_handle_t handle;
53 /* Is this an HVM guest (as opposed to a PV guest)? */
54 #define _XEN_DOMCTL_CDF_hvm_guest 0
55 #define XEN_DOMCTL_CDF_hvm_guest (1U<<_XEN_DOMCTL_CDF_hvm_guest)
56 /* Use hardware-assisted paging if available? */
57 #define _XEN_DOMCTL_CDF_hap 1
58 #define XEN_DOMCTL_CDF_hap (1U<<_XEN_DOMCTL_CDF_hap)
59 /* Should domain memory integrity be verifed by tboot during Sx? */
60 #define _XEN_DOMCTL_CDF_s3_integrity 2
61 #define XEN_DOMCTL_CDF_s3_integrity (1U<<_XEN_DOMCTL_CDF_s3_integrity)
62 uint32_t flags;
63 };
64 typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
65 DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t);
67 #define XEN_DOMCTL_destroydomain 2
68 #define XEN_DOMCTL_pausedomain 3
69 #define XEN_DOMCTL_unpausedomain 4
70 #define XEN_DOMCTL_resumedomain 27
72 #define XEN_DOMCTL_getdomaininfo 5
73 struct xen_domctl_getdomaininfo {
74 /* OUT variables. */
75 domid_t domain; /* Also echoed in domctl.domain */
76 /* Domain is scheduled to die. */
77 #define _XEN_DOMINF_dying 0
78 #define XEN_DOMINF_dying (1U<<_XEN_DOMINF_dying)
79 /* Domain is an HVM guest (as opposed to a PV guest). */
80 #define _XEN_DOMINF_hvm_guest 1
81 #define XEN_DOMINF_hvm_guest (1U<<_XEN_DOMINF_hvm_guest)
82 /* The guest OS has shut down. */
83 #define _XEN_DOMINF_shutdown 2
84 #define XEN_DOMINF_shutdown (1U<<_XEN_DOMINF_shutdown)
85 /* Currently paused by control software. */
86 #define _XEN_DOMINF_paused 3
87 #define XEN_DOMINF_paused (1U<<_XEN_DOMINF_paused)
88 /* Currently blocked pending an event. */
89 #define _XEN_DOMINF_blocked 4
90 #define XEN_DOMINF_blocked (1U<<_XEN_DOMINF_blocked)
91 /* Domain is currently running. */
92 #define _XEN_DOMINF_running 5
93 #define XEN_DOMINF_running (1U<<_XEN_DOMINF_running)
94 /* Being debugged. */
95 #define _XEN_DOMINF_debugged 6
96 #define XEN_DOMINF_debugged (1U<<_XEN_DOMINF_debugged)
97 /* CPU to which this domain is bound. */
98 #define XEN_DOMINF_cpumask 255
99 #define XEN_DOMINF_cpushift 8
100 /* XEN_DOMINF_shutdown guest-supplied code. */
101 #define XEN_DOMINF_shutdownmask 255
102 #define XEN_DOMINF_shutdownshift 16
103 uint32_t flags; /* XEN_DOMINF_* */
104 uint64_aligned_t tot_pages;
105 uint64_aligned_t max_pages;
106 uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
107 uint64_aligned_t cpu_time;
108 uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
109 uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */
110 uint32_t ssidref;
111 xen_domain_handle_t handle;
112 };
113 typedef struct xen_domctl_getdomaininfo xen_domctl_getdomaininfo_t;
114 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t);
117 #define XEN_DOMCTL_getmemlist 6
118 struct xen_domctl_getmemlist {
119 /* IN variables. */
120 /* Max entries to write to output buffer. */
121 uint64_aligned_t max_pfns;
122 /* Start index in guest's page list. */
123 uint64_aligned_t start_pfn;
124 XEN_GUEST_HANDLE_64(uint64) buffer;
125 /* OUT variables. */
126 uint64_aligned_t num_pfns;
127 };
128 typedef struct xen_domctl_getmemlist xen_domctl_getmemlist_t;
129 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getmemlist_t);
132 #define XEN_DOMCTL_getpageframeinfo 7
134 #define XEN_DOMCTL_PFINFO_LTAB_SHIFT 28
135 #define XEN_DOMCTL_PFINFO_NOTAB (0x0U<<28)
136 #define XEN_DOMCTL_PFINFO_L1TAB (0x1U<<28)
137 #define XEN_DOMCTL_PFINFO_L2TAB (0x2U<<28)
138 #define XEN_DOMCTL_PFINFO_L3TAB (0x3U<<28)
139 #define XEN_DOMCTL_PFINFO_L4TAB (0x4U<<28)
140 #define XEN_DOMCTL_PFINFO_LTABTYPE_MASK (0x7U<<28)
141 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
142 #define XEN_DOMCTL_PFINFO_XTAB (0xfU<<28) /* invalid page */
143 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
145 struct xen_domctl_getpageframeinfo {
146 /* IN variables. */
147 uint64_aligned_t gmfn; /* GMFN to query */
148 /* OUT variables. */
149 /* Is the page PINNED to a type? */
150 uint32_t type; /* see above type defs */
151 };
152 typedef struct xen_domctl_getpageframeinfo xen_domctl_getpageframeinfo_t;
153 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo_t);
156 #define XEN_DOMCTL_getpageframeinfo2 8
157 struct xen_domctl_getpageframeinfo2 {
158 /* IN variables. */
159 uint64_aligned_t num;
160 /* IN/OUT variables. */
161 XEN_GUEST_HANDLE_64(uint32) array;
162 };
163 typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
164 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
167 /*
168 * Control shadow pagetables operation
169 */
170 #define XEN_DOMCTL_shadow_op 10
172 /* Disable shadow mode. */
173 #define XEN_DOMCTL_SHADOW_OP_OFF 0
175 /* Enable shadow mode (mode contains ORed XEN_DOMCTL_SHADOW_ENABLE_* flags). */
176 #define XEN_DOMCTL_SHADOW_OP_ENABLE 32
178 /* Log-dirty bitmap operations. */
179 /* Return the bitmap and clean internal copy for next round. */
180 #define XEN_DOMCTL_SHADOW_OP_CLEAN 11
181 /* Return the bitmap but do not modify internal copy. */
182 #define XEN_DOMCTL_SHADOW_OP_PEEK 12
184 /* Memory allocation accessors. */
185 #define XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION 30
186 #define XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION 31
188 /* Legacy enable operations. */
189 /* Equiv. to ENABLE with no mode flags. */
190 #define XEN_DOMCTL_SHADOW_OP_ENABLE_TEST 1
191 /* Equiv. to ENABLE with mode flag ENABLE_LOG_DIRTY. */
192 #define XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY 2
193 /* Equiv. to ENABLE with mode flags ENABLE_REFCOUNT and ENABLE_TRANSLATE. */
194 #define XEN_DOMCTL_SHADOW_OP_ENABLE_TRANSLATE 3
196 /* Mode flags for XEN_DOMCTL_SHADOW_OP_ENABLE. */
197 /*
198 * Shadow pagetables are refcounted: guest does not use explicit mmu
199 * operations nor write-protect its pagetables.
200 */
201 #define XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT (1 << 1)
202 /*
203 * Log pages in a bitmap as they are dirtied.
204 * Used for live relocation to determine which pages must be re-sent.
205 */
206 #define XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY (1 << 2)
207 /*
208 * Automatically translate GPFNs into MFNs.
209 */
210 #define XEN_DOMCTL_SHADOW_ENABLE_TRANSLATE (1 << 3)
211 /*
212 * Xen does not steal virtual address space from the guest.
213 * Requires HVM support.
214 */
215 #define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL (1 << 4)
217 struct xen_domctl_shadow_op_stats {
218 uint32_t fault_count;
219 uint32_t dirty_count;
220 };
221 typedef struct xen_domctl_shadow_op_stats xen_domctl_shadow_op_stats_t;
222 DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_stats_t);
224 struct xen_domctl_shadow_op {
225 /* IN variables. */
226 uint32_t op; /* XEN_DOMCTL_SHADOW_OP_* */
228 /* OP_ENABLE */
229 uint32_t mode; /* XEN_DOMCTL_SHADOW_ENABLE_* */
231 /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */
232 uint32_t mb; /* Shadow memory allocation in MB */
234 /* OP_PEEK / OP_CLEAN */
235 XEN_GUEST_HANDLE_64(uint8) dirty_bitmap;
236 uint64_aligned_t pages; /* Size of buffer. Updated with actual size. */
237 struct xen_domctl_shadow_op_stats stats;
238 };
239 typedef struct xen_domctl_shadow_op xen_domctl_shadow_op_t;
240 DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_t);
243 #define XEN_DOMCTL_max_mem 11
244 struct xen_domctl_max_mem {
245 /* IN variables. */
246 uint64_aligned_t max_memkb;
247 };
248 typedef struct xen_domctl_max_mem xen_domctl_max_mem_t;
249 DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_mem_t);
252 #define XEN_DOMCTL_setvcpucontext 12
253 #define XEN_DOMCTL_getvcpucontext 13
254 struct xen_domctl_vcpucontext {
255 uint32_t vcpu; /* IN */
256 XEN_GUEST_HANDLE_64(vcpu_guest_context_t) ctxt; /* IN/OUT */
257 };
258 typedef struct xen_domctl_vcpucontext xen_domctl_vcpucontext_t;
259 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpucontext_t);
262 #define XEN_DOMCTL_getvcpuinfo 14
263 struct xen_domctl_getvcpuinfo {
264 /* IN variables. */
265 uint32_t vcpu;
266 /* OUT variables. */
267 uint8_t online; /* currently online (not hotplugged)? */
268 uint8_t blocked; /* blocked waiting for an event? */
269 uint8_t running; /* currently scheduled on its CPU? */
270 uint64_aligned_t cpu_time; /* total cpu time consumed (ns) */
271 uint32_t cpu; /* current mapping */
272 };
273 typedef struct xen_domctl_getvcpuinfo xen_domctl_getvcpuinfo_t;
274 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
277 /* Get/set which physical cpus a vcpu can execute on. */
278 #define XEN_DOMCTL_setvcpuaffinity 9
279 #define XEN_DOMCTL_getvcpuaffinity 25
280 struct xen_domctl_vcpuaffinity {
281 uint32_t vcpu; /* IN */
282 struct xenctl_cpumap cpumap; /* IN/OUT */
283 };
284 typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
285 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
288 #define XEN_DOMCTL_max_vcpus 15
289 struct xen_domctl_max_vcpus {
290 uint32_t max; /* maximum number of vcpus */
291 };
292 typedef struct xen_domctl_max_vcpus xen_domctl_max_vcpus_t;
293 DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t);
296 #define XEN_DOMCTL_scheduler_op 16
297 /* Scheduler types. */
298 #define XEN_SCHEDULER_SEDF 4
299 #define XEN_SCHEDULER_CREDIT 5
300 /* Set or get info? */
301 #define XEN_DOMCTL_SCHEDOP_putinfo 0
302 #define XEN_DOMCTL_SCHEDOP_getinfo 1
303 struct xen_domctl_scheduler_op {
304 uint32_t sched_id; /* XEN_SCHEDULER_* */
305 uint32_t cmd; /* XEN_DOMCTL_SCHEDOP_* */
306 union {
307 struct xen_domctl_sched_sedf {
308 uint64_aligned_t period;
309 uint64_aligned_t slice;
310 uint64_aligned_t latency;
311 uint32_t extratime;
312 uint32_t weight;
313 } sedf;
314 struct xen_domctl_sched_credit {
315 uint16_t weight;
316 uint16_t cap;
317 } credit;
318 } u;
319 };
320 typedef struct xen_domctl_scheduler_op xen_domctl_scheduler_op_t;
321 DEFINE_XEN_GUEST_HANDLE(xen_domctl_scheduler_op_t);
324 #define XEN_DOMCTL_setdomainhandle 17
325 struct xen_domctl_setdomainhandle {
326 xen_domain_handle_t handle;
327 };
328 typedef struct xen_domctl_setdomainhandle xen_domctl_setdomainhandle_t;
329 DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdomainhandle_t);
332 #define XEN_DOMCTL_setdebugging 18
333 struct xen_domctl_setdebugging {
334 uint8_t enable;
335 };
336 typedef struct xen_domctl_setdebugging xen_domctl_setdebugging_t;
337 DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdebugging_t);
340 #define XEN_DOMCTL_irq_permission 19
341 struct xen_domctl_irq_permission {
342 uint8_t pirq;
343 uint8_t allow_access; /* flag to specify enable/disable of IRQ access */
344 };
345 typedef struct xen_domctl_irq_permission xen_domctl_irq_permission_t;
346 DEFINE_XEN_GUEST_HANDLE(xen_domctl_irq_permission_t);
349 #define XEN_DOMCTL_iomem_permission 20
350 struct xen_domctl_iomem_permission {
351 uint64_aligned_t first_mfn;/* first page (physical page number) in range */
352 uint64_aligned_t nr_mfns; /* number of pages in range (>0) */
353 uint8_t allow_access; /* allow (!0) or deny (0) access to range? */
354 };
355 typedef struct xen_domctl_iomem_permission xen_domctl_iomem_permission_t;
356 DEFINE_XEN_GUEST_HANDLE(xen_domctl_iomem_permission_t);
359 #define XEN_DOMCTL_ioport_permission 21
360 struct xen_domctl_ioport_permission {
361 uint32_t first_port; /* first port int range */
362 uint32_t nr_ports; /* size of port range */
363 uint8_t allow_access; /* allow or deny access to range? */
364 };
365 typedef struct xen_domctl_ioport_permission xen_domctl_ioport_permission_t;
366 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_permission_t);
369 #define XEN_DOMCTL_hypercall_init 22
370 struct xen_domctl_hypercall_init {
371 uint64_aligned_t gmfn; /* GMFN to be initialised */
372 };
373 typedef struct xen_domctl_hypercall_init xen_domctl_hypercall_init_t;
374 DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t);
377 #define XEN_DOMCTL_arch_setup 23
378 #define _XEN_DOMAINSETUP_hvm_guest 0
379 #define XEN_DOMAINSETUP_hvm_guest (1UL<<_XEN_DOMAINSETUP_hvm_guest)
380 #define _XEN_DOMAINSETUP_query 1 /* Get parameters (for save) */
381 #define XEN_DOMAINSETUP_query (1UL<<_XEN_DOMAINSETUP_query)
382 #define _XEN_DOMAINSETUP_sioemu_guest 2
383 #define XEN_DOMAINSETUP_sioemu_guest (1UL<<_XEN_DOMAINSETUP_sioemu_guest)
384 typedef struct xen_domctl_arch_setup {
385 uint64_aligned_t flags; /* XEN_DOMAINSETUP_* */
386 #ifdef __ia64__
387 uint64_aligned_t bp; /* mpaddr of boot param area */
388 uint64_aligned_t maxmem; /* Highest memory address for MDT. */
389 uint64_aligned_t xsi_va; /* Xen shared_info area virtual address. */
390 uint32_t hypercall_imm; /* Break imm for Xen hypercalls. */
391 int8_t vhpt_size_log2; /* Log2 of VHPT size. */
392 #endif
393 } xen_domctl_arch_setup_t;
394 DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
397 #define XEN_DOMCTL_settimeoffset 24
398 struct xen_domctl_settimeoffset {
399 int32_t time_offset_seconds; /* applied to domain wallclock time */
400 };
401 typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
402 DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
405 #define XEN_DOMCTL_gethvmcontext 33
406 #define XEN_DOMCTL_sethvmcontext 34
407 typedef struct xen_domctl_hvmcontext {
408 uint32_t size; /* IN/OUT: size of buffer / bytes filled */
409 XEN_GUEST_HANDLE_64(uint8) buffer; /* IN/OUT: data, or call
410 * gethvmcontext with NULL
411 * buffer to get size req'd */
412 } xen_domctl_hvmcontext_t;
413 DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_t);
416 #define XEN_DOMCTL_set_address_size 35
417 #define XEN_DOMCTL_get_address_size 36
418 typedef struct xen_domctl_address_size {
419 uint32_t size;
420 } xen_domctl_address_size_t;
421 DEFINE_XEN_GUEST_HANDLE(xen_domctl_address_size_t);
424 #define XEN_DOMCTL_real_mode_area 26
425 struct xen_domctl_real_mode_area {
426 uint32_t log; /* log2 of Real Mode Area size */
427 };
428 typedef struct xen_domctl_real_mode_area xen_domctl_real_mode_area_t;
429 DEFINE_XEN_GUEST_HANDLE(xen_domctl_real_mode_area_t);
432 #define XEN_DOMCTL_sendtrigger 28
433 #define XEN_DOMCTL_SENDTRIGGER_NMI 0
434 #define XEN_DOMCTL_SENDTRIGGER_RESET 1
435 #define XEN_DOMCTL_SENDTRIGGER_INIT 2
436 #define XEN_DOMCTL_SENDTRIGGER_POWER 3
437 struct xen_domctl_sendtrigger {
438 uint32_t trigger; /* IN */
439 uint32_t vcpu; /* IN */
440 };
441 typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t;
442 DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
445 /* Assign PCI device to HVM guest. Sets up IOMMU structures. */
446 #define XEN_DOMCTL_assign_device 37
447 #define XEN_DOMCTL_test_assign_device 45
448 #define XEN_DOMCTL_deassign_device 47
449 struct xen_domctl_assign_device {
450 uint32_t machine_bdf; /* machine PCI ID of assigned device */
451 };
452 typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
453 DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
455 /* Retrieve sibling devices infomation of machine_bdf */
456 #define XEN_DOMCTL_get_device_group 50
457 struct xen_domctl_get_device_group {
458 uint32_t machine_bdf; /* IN */
459 uint32_t max_sdevs; /* IN */
460 uint32_t num_sdevs; /* OUT */
461 XEN_GUEST_HANDLE_64(uint32) sdev_array; /* OUT */
462 };
463 typedef struct xen_domctl_get_device_group xen_domctl_get_device_group_t;
464 DEFINE_XEN_GUEST_HANDLE(xen_domctl_get_device_group_t);
466 /* Pass-through interrupts: bind real irq -> hvm devfn. */
467 #define XEN_DOMCTL_bind_pt_irq 38
468 #define XEN_DOMCTL_unbind_pt_irq 48
469 typedef enum pt_irq_type_e {
470 PT_IRQ_TYPE_PCI,
471 PT_IRQ_TYPE_ISA,
472 PT_IRQ_TYPE_MSI,
473 PT_IRQ_TYPE_MSI_TRANSLATE,
474 } pt_irq_type_t;
475 struct xen_domctl_bind_pt_irq {
476 uint32_t machine_irq;
477 pt_irq_type_t irq_type;
478 uint32_t hvm_domid;
480 union {
481 struct {
482 uint8_t isa_irq;
483 } isa;
484 struct {
485 uint8_t bus;
486 uint8_t device;
487 uint8_t intx;
488 } pci;
489 struct {
490 uint8_t gvec;
491 uint32_t gflags;
492 uint64_aligned_t gtable;
493 } msi;
494 } u;
495 };
496 typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t;
497 DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_pt_irq_t);
500 /* Bind machine I/O address range -> HVM address range. */
501 #define XEN_DOMCTL_memory_mapping 39
502 #define DPCI_ADD_MAPPING 1
503 #define DPCI_REMOVE_MAPPING 0
504 struct xen_domctl_memory_mapping {
505 uint64_aligned_t first_gfn; /* first page (hvm guest phys page) in range */
506 uint64_aligned_t first_mfn; /* first page (machine page) in range */
507 uint64_aligned_t nr_mfns; /* number of pages in range (>0) */
508 uint32_t add_mapping; /* add or remove mapping */
509 uint32_t padding; /* padding for 64-bit aligned structure */
510 };
511 typedef struct xen_domctl_memory_mapping xen_domctl_memory_mapping_t;
512 DEFINE_XEN_GUEST_HANDLE(xen_domctl_memory_mapping_t);
515 /* Bind machine I/O port range -> HVM I/O port range. */
516 #define XEN_DOMCTL_ioport_mapping 40
517 struct xen_domctl_ioport_mapping {
518 uint32_t first_gport; /* first guest IO port*/
519 uint32_t first_mport; /* first machine IO port */
520 uint32_t nr_ports; /* size of port range */
521 uint32_t add_mapping; /* add or remove mapping */
522 };
523 typedef struct xen_domctl_ioport_mapping xen_domctl_ioport_mapping_t;
524 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_mapping_t);
527 /*
528 * Pin caching type of RAM space for x86 HVM domU.
529 */
530 #define XEN_DOMCTL_pin_mem_cacheattr 41
531 /* Caching types: these happen to be the same as x86 MTRR/PAT type codes. */
532 #define XEN_DOMCTL_MEM_CACHEATTR_UC 0
533 #define XEN_DOMCTL_MEM_CACHEATTR_WC 1
534 #define XEN_DOMCTL_MEM_CACHEATTR_WT 4
535 #define XEN_DOMCTL_MEM_CACHEATTR_WP 5
536 #define XEN_DOMCTL_MEM_CACHEATTR_WB 6
537 #define XEN_DOMCTL_MEM_CACHEATTR_UCM 7
538 struct xen_domctl_pin_mem_cacheattr {
539 uint64_aligned_t start, end;
540 unsigned int type; /* XEN_DOMCTL_MEM_CACHEATTR_* */
541 };
542 typedef struct xen_domctl_pin_mem_cacheattr xen_domctl_pin_mem_cacheattr_t;
543 DEFINE_XEN_GUEST_HANDLE(xen_domctl_pin_mem_cacheattr_t);
546 #define XEN_DOMCTL_set_ext_vcpucontext 42
547 #define XEN_DOMCTL_get_ext_vcpucontext 43
548 struct xen_domctl_ext_vcpucontext {
549 /* IN: VCPU that this call applies to. */
550 uint32_t vcpu;
551 /*
552 * SET: Size of struct (IN)
553 * GET: Size of struct (OUT)
554 */
555 uint32_t size;
556 #if defined(__i386__) || defined(__x86_64__)
557 /* SYSCALL from 32-bit mode and SYSENTER callback information. */
558 /* NB. SYSCALL from 64-bit mode is contained in vcpu_guest_context_t */
559 uint64_aligned_t syscall32_callback_eip;
560 uint64_aligned_t sysenter_callback_eip;
561 uint16_t syscall32_callback_cs;
562 uint16_t sysenter_callback_cs;
563 uint8_t syscall32_disables_events;
564 uint8_t sysenter_disables_events;
565 #endif
566 };
567 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
568 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ext_vcpucontext_t);
570 /*
571 * Set optimizaton features for a domain
572 */
573 #define XEN_DOMCTL_set_opt_feature 44
574 struct xen_domctl_set_opt_feature {
575 #if defined(__ia64__)
576 struct xen_ia64_opt_feature optf;
577 #else
578 /* Make struct non-empty: do not depend on this field name! */
579 uint64_t dummy;
580 #endif
581 };
582 typedef struct xen_domctl_set_opt_feature xen_domctl_set_opt_feature_t;
583 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_opt_feature_t);
585 /*
586 * Set the target domain for a domain
587 */
588 #define XEN_DOMCTL_set_target 46
589 struct xen_domctl_set_target {
590 domid_t target;
591 };
592 typedef struct xen_domctl_set_target xen_domctl_set_target_t;
593 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_target_t);
595 #if defined(__i386__) || defined(__x86_64__)
596 # define XEN_CPUID_INPUT_UNUSED 0xFFFFFFFF
597 # define XEN_DOMCTL_set_cpuid 49
598 struct xen_domctl_cpuid {
599 unsigned int input[2];
600 unsigned int eax;
601 unsigned int ebx;
602 unsigned int ecx;
603 unsigned int edx;
604 };
605 typedef struct xen_domctl_cpuid xen_domctl_cpuid_t;
606 DEFINE_XEN_GUEST_HANDLE(xen_domctl_cpuid_t);
607 #endif
609 #define XEN_DOMCTL_subscribe 29
610 struct xen_domctl_subscribe {
611 uint32_t port; /* IN */
612 };
613 typedef struct xen_domctl_subscribe xen_domctl_subscribe_t;
614 DEFINE_XEN_GUEST_HANDLE(xen_domctl_subscribe_t);
616 /*
617 * Define the maximum machine address size which should be allocated
618 * to a guest.
619 */
620 #define XEN_DOMCTL_set_machine_address_size 51
621 #define XEN_DOMCTL_get_machine_address_size 52
623 /*
624 * Do not inject spurious page faults into this domain.
625 */
626 #define XEN_DOMCTL_suppress_spurious_page_faults 53
628 #define XEN_DOMCTL_debug_op 54
629 #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF 0
630 #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON 1
631 struct xen_domctl_debug_op {
632 uint32_t op; /* IN */
633 uint32_t vcpu; /* IN */
634 };
635 typedef struct xen_domctl_debug_op xen_domctl_debug_op_t;
636 DEFINE_XEN_GUEST_HANDLE(xen_domctl_debug_op_t);
638 /*
639 * Request a particular record from the HVM context
640 */
641 #define XEN_DOMCTL_gethvmcontext_partial 55
642 typedef struct xen_domctl_hvmcontext_partial {
643 uint32_t type; /* IN: Type of record required */
644 uint32_t instance; /* IN: Instance of that type */
645 XEN_GUEST_HANDLE_64(uint8) buffer; /* OUT: buffer to write record into */
646 } xen_domctl_hvmcontext_partial_t;
647 DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_partial_t);
650 struct xen_domctl {
651 uint32_t cmd;
652 uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
653 domid_t domain;
654 union {
655 struct xen_domctl_createdomain createdomain;
656 struct xen_domctl_getdomaininfo getdomaininfo;
657 struct xen_domctl_getmemlist getmemlist;
658 struct xen_domctl_getpageframeinfo getpageframeinfo;
659 struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
660 struct xen_domctl_vcpuaffinity vcpuaffinity;
661 struct xen_domctl_shadow_op shadow_op;
662 struct xen_domctl_max_mem max_mem;
663 struct xen_domctl_vcpucontext vcpucontext;
664 struct xen_domctl_getvcpuinfo getvcpuinfo;
665 struct xen_domctl_max_vcpus max_vcpus;
666 struct xen_domctl_scheduler_op scheduler_op;
667 struct xen_domctl_setdomainhandle setdomainhandle;
668 struct xen_domctl_setdebugging setdebugging;
669 struct xen_domctl_irq_permission irq_permission;
670 struct xen_domctl_iomem_permission iomem_permission;
671 struct xen_domctl_ioport_permission ioport_permission;
672 struct xen_domctl_hypercall_init hypercall_init;
673 struct xen_domctl_arch_setup arch_setup;
674 struct xen_domctl_settimeoffset settimeoffset;
675 struct xen_domctl_real_mode_area real_mode_area;
676 struct xen_domctl_hvmcontext hvmcontext;
677 struct xen_domctl_hvmcontext_partial hvmcontext_partial;
678 struct xen_domctl_address_size address_size;
679 struct xen_domctl_sendtrigger sendtrigger;
680 struct xen_domctl_get_device_group get_device_group;
681 struct xen_domctl_assign_device assign_device;
682 struct xen_domctl_bind_pt_irq bind_pt_irq;
683 struct xen_domctl_memory_mapping memory_mapping;
684 struct xen_domctl_ioport_mapping ioport_mapping;
685 struct xen_domctl_pin_mem_cacheattr pin_mem_cacheattr;
686 struct xen_domctl_ext_vcpucontext ext_vcpucontext;
687 struct xen_domctl_set_opt_feature set_opt_feature;
688 struct xen_domctl_set_target set_target;
689 struct xen_domctl_subscribe subscribe;
690 struct xen_domctl_debug_op debug_op;
691 #if defined(__i386__) || defined(__x86_64__)
692 struct xen_domctl_cpuid cpuid;
693 #endif
694 uint8_t pad[128];
695 } u;
696 };
697 typedef struct xen_domctl xen_domctl_t;
698 DEFINE_XEN_GUEST_HANDLE(xen_domctl_t);
700 #endif /* __XEN_PUBLIC_DOMCTL_H__ */
702 /*
703 * Local variables:
704 * mode: C
705 * c-set-style: "BSD"
706 * c-basic-offset: 4
707 * tab-width: 4
708 * indent-tabs-mode: nil
709 * End:
710 */