Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / xen / include / xen3-public / domctl.h
blobb0cb9b896a7de375e5bbdb7e6625b7139237a4a7
1 /* $NetBSD: domctl.h,v 1.3 2008/05/04 19:56:28 cegger Exp $ */
2 /******************************************************************************
3 * domctl.h
4 *
5 * Domain management operations. For use by node control stack.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to
9 * deal in the Software without restriction, including without limitation the
10 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
25 * Copyright (c) 2002-2003, B Dragovic
26 * Copyright (c) 2002-2006, K Fraser
29 #ifndef __XEN_PUBLIC_DOMCTL_H__
30 #define __XEN_PUBLIC_DOMCTL_H__
32 #if !defined(__XEN__) && !defined(__XEN_TOOLS__)
33 #error "domctl operations are intended for use by node control tools only"
34 #endif
36 #include "xen.h"
38 #define XEN_DOMCTL_INTERFACE_VERSION 0x00000005
40 struct xenctl_cpumap {
41 XEN_GUEST_HANDLE_64(uint8) bitmap;
42 uint32_t nr_cpus;
46 * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
47 * If it is specified as zero, an id is auto-allocated and returned.
49 #define XEN_DOMCTL_createdomain 1
50 struct xen_domctl_createdomain {
51 /* IN parameters */
52 uint32_t ssidref;
53 xen_domain_handle_t handle;
54 /* Is this an HVM guest (as opposed to a PV guest)? */
55 #define _XEN_DOMCTL_CDF_hvm_guest 0
56 #define XEN_DOMCTL_CDF_hvm_guest (1U<<_XEN_DOMCTL_CDF_hvm_guest)
57 /* Use hardware-assisted paging if available? */
58 #define _XEN_DOMCTL_CDF_hap 1
59 #define XEN_DOMCTL_CDF_hap (1U<<_XEN_DOMCTL_CDF_hap)
60 uint32_t flags;
62 typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
63 DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t);
65 #define XEN_DOMCTL_destroydomain 2
66 #define XEN_DOMCTL_pausedomain 3
67 #define XEN_DOMCTL_unpausedomain 4
68 #define XEN_DOMCTL_resumedomain 27
70 #define XEN_DOMCTL_getdomaininfo 5
71 struct xen_domctl_getdomaininfo {
72 /* OUT variables. */
73 domid_t domain; /* Also echoed in domctl.domain */
74 /* Domain is scheduled to die. */
75 #define _XEN_DOMINF_dying 0
76 #define XEN_DOMINF_dying (1U<<_XEN_DOMINF_dying)
77 /* Domain is an HVM guest (as opposed to a PV guest). */
78 #define _XEN_DOMINF_hvm_guest 1
79 #define XEN_DOMINF_hvm_guest (1U<<_XEN_DOMINF_hvm_guest)
80 /* The guest OS has shut down. */
81 #define _XEN_DOMINF_shutdown 2
82 #define XEN_DOMINF_shutdown (1U<<_XEN_DOMINF_shutdown)
83 /* Currently paused by control software. */
84 #define _XEN_DOMINF_paused 3
85 #define XEN_DOMINF_paused (1U<<_XEN_DOMINF_paused)
86 /* Currently blocked pending an event. */
87 #define _XEN_DOMINF_blocked 4
88 #define XEN_DOMINF_blocked (1U<<_XEN_DOMINF_blocked)
89 /* Domain is currently running. */
90 #define _XEN_DOMINF_running 5
91 #define XEN_DOMINF_running (1U<<_XEN_DOMINF_running)
92 /* Being debugged. */
93 #define _XEN_DOMINF_debugged 6
94 #define XEN_DOMINF_debugged (1U<<_XEN_DOMINF_debugged)
95 /* CPU to which this domain is bound. */
96 #define XEN_DOMINF_cpumask 255
97 #define XEN_DOMINF_cpushift 8
98 /* XEN_DOMINF_shutdown guest-supplied code. */
99 #define XEN_DOMINF_shutdownmask 255
100 #define XEN_DOMINF_shutdownshift 16
101 uint32_t flags; /* XEN_DOMINF_* */
102 uint64_aligned_t tot_pages;
103 uint64_aligned_t max_pages;
104 uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
105 uint64_aligned_t cpu_time;
106 uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
107 uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */
108 uint32_t ssidref;
109 xen_domain_handle_t handle;
111 typedef struct xen_domctl_getdomaininfo xen_domctl_getdomaininfo_t;
112 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t);
115 #define XEN_DOMCTL_getmemlist 6
116 struct xen_domctl_getmemlist {
117 /* IN variables. */
118 /* Max entries to write to output buffer. */
119 uint64_aligned_t max_pfns;
120 /* Start index in guest's page list. */
121 uint64_aligned_t start_pfn;
122 XEN_GUEST_HANDLE_64(uint64) buffer;
123 /* OUT variables. */
124 uint64_aligned_t num_pfns;
126 typedef struct xen_domctl_getmemlist xen_domctl_getmemlist_t;
127 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getmemlist_t);
130 #define XEN_DOMCTL_getpageframeinfo 7
132 #define XEN_DOMCTL_PFINFO_LTAB_SHIFT 28
133 #define XEN_DOMCTL_PFINFO_NOTAB (0x0U<<28)
134 #define XEN_DOMCTL_PFINFO_L1TAB (0x1U<<28)
135 #define XEN_DOMCTL_PFINFO_L2TAB (0x2U<<28)
136 #define XEN_DOMCTL_PFINFO_L3TAB (0x3U<<28)
137 #define XEN_DOMCTL_PFINFO_L4TAB (0x4U<<28)
138 #define XEN_DOMCTL_PFINFO_LTABTYPE_MASK (0x7U<<28)
139 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
140 #define XEN_DOMCTL_PFINFO_XTAB (0xfU<<28) /* invalid page */
141 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
143 struct xen_domctl_getpageframeinfo {
144 /* IN variables. */
145 uint64_aligned_t gmfn; /* GMFN to query */
146 /* OUT variables. */
147 /* Is the page PINNED to a type? */
148 uint32_t type; /* see above type defs */
150 typedef struct xen_domctl_getpageframeinfo xen_domctl_getpageframeinfo_t;
151 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo_t);
154 #define XEN_DOMCTL_getpageframeinfo2 8
155 struct xen_domctl_getpageframeinfo2 {
156 /* IN variables. */
157 uint64_aligned_t num;
158 /* IN/OUT variables. */
159 XEN_GUEST_HANDLE_64(uint32) array;
161 typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
162 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
166 * Control shadow pagetables operation
168 #define XEN_DOMCTL_shadow_op 10
170 /* Disable shadow mode. */
171 #define XEN_DOMCTL_SHADOW_OP_OFF 0
173 /* Enable shadow mode (mode contains ORed XEN_DOMCTL_SHADOW_ENABLE_* flags). */
174 #define XEN_DOMCTL_SHADOW_OP_ENABLE 32
176 /* Log-dirty bitmap operations. */
177 /* Return the bitmap and clean internal copy for next round. */
178 #define XEN_DOMCTL_SHADOW_OP_CLEAN 11
179 /* Return the bitmap but do not modify internal copy. */
180 #define XEN_DOMCTL_SHADOW_OP_PEEK 12
182 /* Memory allocation accessors. */
183 #define XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION 30
184 #define XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION 31
186 /* Legacy enable operations. */
187 /* Equiv. to ENABLE with no mode flags. */
188 #define XEN_DOMCTL_SHADOW_OP_ENABLE_TEST 1
189 /* Equiv. to ENABLE with mode flag ENABLE_LOG_DIRTY. */
190 #define XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY 2
191 /* Equiv. to ENABLE with mode flags ENABLE_REFCOUNT and ENABLE_TRANSLATE. */
192 #define XEN_DOMCTL_SHADOW_OP_ENABLE_TRANSLATE 3
194 /* Mode flags for XEN_DOMCTL_SHADOW_OP_ENABLE. */
196 * Shadow pagetables are refcounted: guest does not use explicit mmu
197 * operations nor write-protect its pagetables.
199 #define XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT (1 << 1)
201 * Log pages in a bitmap as they are dirtied.
202 * Used for live relocation to determine which pages must be re-sent.
204 #define XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY (1 << 2)
206 * Automatically translate GPFNs into MFNs.
208 #define XEN_DOMCTL_SHADOW_ENABLE_TRANSLATE (1 << 3)
210 * Xen does not steal virtual address space from the guest.
211 * Requires HVM support.
213 #define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL (1 << 4)
215 struct xen_domctl_shadow_op_stats {
216 uint32_t fault_count;
217 uint32_t dirty_count;
219 typedef struct xen_domctl_shadow_op_stats xen_domctl_shadow_op_stats_t;
220 DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_stats_t);
222 struct xen_domctl_shadow_op {
223 /* IN variables. */
224 uint32_t op; /* XEN_DOMCTL_SHADOW_OP_* */
226 /* OP_ENABLE */
227 uint32_t mode; /* XEN_DOMCTL_SHADOW_ENABLE_* */
229 /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */
230 uint32_t mb; /* Shadow memory allocation in MB */
232 /* OP_PEEK / OP_CLEAN */
233 XEN_GUEST_HANDLE_64(uint8) dirty_bitmap;
234 uint64_aligned_t pages; /* Size of buffer. Updated with actual size. */
235 struct xen_domctl_shadow_op_stats stats;
237 typedef struct xen_domctl_shadow_op xen_domctl_shadow_op_t;
238 DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_t);
241 #define XEN_DOMCTL_max_mem 11
242 struct xen_domctl_max_mem {
243 /* IN variables. */
244 uint64_aligned_t max_memkb;
246 typedef struct xen_domctl_max_mem xen_domctl_max_mem_t;
247 DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_mem_t);
250 #define XEN_DOMCTL_setvcpucontext 12
251 #define XEN_DOMCTL_getvcpucontext 13
252 struct xen_domctl_vcpucontext {
253 uint32_t vcpu; /* IN */
254 XEN_GUEST_HANDLE_64(vcpu_guest_context_t) ctxt; /* IN/OUT */
256 typedef struct xen_domctl_vcpucontext xen_domctl_vcpucontext_t;
257 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpucontext_t);
260 #define XEN_DOMCTL_getvcpuinfo 14
261 struct xen_domctl_getvcpuinfo {
262 /* IN variables. */
263 uint32_t vcpu;
264 /* OUT variables. */
265 uint8_t online; /* currently online (not hotplugged)? */
266 uint8_t blocked; /* blocked waiting for an event? */
267 uint8_t running; /* currently scheduled on its CPU? */
268 uint64_aligned_t cpu_time; /* total cpu time consumed (ns) */
269 uint32_t cpu; /* current mapping */
271 typedef struct xen_domctl_getvcpuinfo xen_domctl_getvcpuinfo_t;
272 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
275 /* Get/set which physical cpus a vcpu can execute on. */
276 #define XEN_DOMCTL_setvcpuaffinity 9
277 #define XEN_DOMCTL_getvcpuaffinity 25
278 struct xen_domctl_vcpuaffinity {
279 uint32_t vcpu; /* IN */
280 struct xenctl_cpumap cpumap; /* IN/OUT */
282 typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
283 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
286 #define XEN_DOMCTL_max_vcpus 15
287 struct xen_domctl_max_vcpus {
288 uint32_t max; /* maximum number of vcpus */
290 typedef struct xen_domctl_max_vcpus xen_domctl_max_vcpus_t;
291 DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t);
294 #define XEN_DOMCTL_scheduler_op 16
295 /* Scheduler types. */
296 #define XEN_SCHEDULER_SEDF 4
297 #define XEN_SCHEDULER_CREDIT 5
298 /* Set or get info? */
299 #define XEN_DOMCTL_SCHEDOP_putinfo 0
300 #define XEN_DOMCTL_SCHEDOP_getinfo 1
301 struct xen_domctl_scheduler_op {
302 uint32_t sched_id; /* XEN_SCHEDULER_* */
303 uint32_t cmd; /* XEN_DOMCTL_SCHEDOP_* */
304 union {
305 struct xen_domctl_sched_sedf {
306 uint64_aligned_t period;
307 uint64_aligned_t slice;
308 uint64_aligned_t latency;
309 uint32_t extratime;
310 uint32_t weight;
311 } sedf;
312 struct xen_domctl_sched_credit {
313 uint16_t weight;
314 uint16_t cap;
315 } credit;
316 } u;
318 typedef struct xen_domctl_scheduler_op xen_domctl_scheduler_op_t;
319 DEFINE_XEN_GUEST_HANDLE(xen_domctl_scheduler_op_t);
322 #define XEN_DOMCTL_setdomainhandle 17
323 struct xen_domctl_setdomainhandle {
324 xen_domain_handle_t handle;
326 typedef struct xen_domctl_setdomainhandle xen_domctl_setdomainhandle_t;
327 DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdomainhandle_t);
330 #define XEN_DOMCTL_setdebugging 18
331 struct xen_domctl_setdebugging {
332 uint8_t enable;
334 typedef struct xen_domctl_setdebugging xen_domctl_setdebugging_t;
335 DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdebugging_t);
338 #define XEN_DOMCTL_irq_permission 19
339 struct xen_domctl_irq_permission {
340 uint8_t pirq;
341 uint8_t allow_access; /* flag to specify enable/disable of IRQ access */
343 typedef struct xen_domctl_irq_permission xen_domctl_irq_permission_t;
344 DEFINE_XEN_GUEST_HANDLE(xen_domctl_irq_permission_t);
347 #define XEN_DOMCTL_iomem_permission 20
348 struct xen_domctl_iomem_permission {
349 uint64_aligned_t first_mfn;/* first page (physical page number) in range */
350 uint64_aligned_t nr_mfns; /* number of pages in range (>0) */
351 uint8_t allow_access; /* allow (!0) or deny (0) access to range? */
353 typedef struct xen_domctl_iomem_permission xen_domctl_iomem_permission_t;
354 DEFINE_XEN_GUEST_HANDLE(xen_domctl_iomem_permission_t);
357 #define XEN_DOMCTL_ioport_permission 21
358 struct xen_domctl_ioport_permission {
359 uint32_t first_port; /* first port int range */
360 uint32_t nr_ports; /* size of port range */
361 uint8_t allow_access; /* allow or deny access to range? */
363 typedef struct xen_domctl_ioport_permission xen_domctl_ioport_permission_t;
364 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_permission_t);
367 #define XEN_DOMCTL_hypercall_init 22
368 struct xen_domctl_hypercall_init {
369 uint64_aligned_t gmfn; /* GMFN to be initialised */
371 typedef struct xen_domctl_hypercall_init xen_domctl_hypercall_init_t;
372 DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t);
375 #define XEN_DOMCTL_arch_setup 23
376 #define _XEN_DOMAINSETUP_hvm_guest 0
377 #define XEN_DOMAINSETUP_hvm_guest (1UL<<_XEN_DOMAINSETUP_hvm_guest)
378 #define _XEN_DOMAINSETUP_query 1 /* Get parameters (for save) */
379 #define XEN_DOMAINSETUP_query (1UL<<_XEN_DOMAINSETUP_query)
380 #define _XEN_DOMAINSETUP_sioemu_guest 2
381 #define XEN_DOMAINSETUP_sioemu_guest (1UL<<_XEN_DOMAINSETUP_sioemu_guest)
382 typedef struct xen_domctl_arch_setup {
383 uint64_aligned_t flags; /* XEN_DOMAINSETUP_* */
384 #ifdef __ia64__
385 uint64_aligned_t bp; /* mpaddr of boot param area */
386 uint64_aligned_t maxmem; /* Highest memory address for MDT. */
387 uint64_aligned_t xsi_va; /* Xen shared_info area virtual address. */
388 uint32_t hypercall_imm; /* Break imm for Xen hypercalls. */
389 int8_t vhpt_size_log2; /* Log2 of VHPT size. */
390 #endif
391 } xen_domctl_arch_setup_t;
392 DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
395 #define XEN_DOMCTL_settimeoffset 24
396 struct xen_domctl_settimeoffset {
397 int32_t time_offset_seconds; /* applied to domain wallclock time */
399 typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
400 DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
403 #define XEN_DOMCTL_gethvmcontext 33
404 #define XEN_DOMCTL_sethvmcontext 34
405 typedef struct xen_domctl_hvmcontext {
406 uint32_t size; /* IN/OUT: size of buffer / bytes filled */
407 XEN_GUEST_HANDLE_64(uint8) buffer; /* IN/OUT: data, or call
408 * gethvmcontext with NULL
409 * buffer to get size req'd */
410 } xen_domctl_hvmcontext_t;
411 DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_t);
414 #define XEN_DOMCTL_set_address_size 35
415 #define XEN_DOMCTL_get_address_size 36
416 typedef struct xen_domctl_address_size {
417 uint32_t size;
418 } xen_domctl_address_size_t;
419 DEFINE_XEN_GUEST_HANDLE(xen_domctl_address_size_t);
422 #define XEN_DOMCTL_real_mode_area 26
423 struct xen_domctl_real_mode_area {
424 uint32_t log; /* log2 of Real Mode Area size */
426 typedef struct xen_domctl_real_mode_area xen_domctl_real_mode_area_t;
427 DEFINE_XEN_GUEST_HANDLE(xen_domctl_real_mode_area_t);
430 #define XEN_DOMCTL_sendtrigger 28
431 #define XEN_DOMCTL_SENDTRIGGER_NMI 0
432 #define XEN_DOMCTL_SENDTRIGGER_RESET 1
433 #define XEN_DOMCTL_SENDTRIGGER_INIT 2
434 struct xen_domctl_sendtrigger {
435 uint32_t trigger; /* IN */
436 uint32_t vcpu; /* IN */
438 typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t;
439 DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
442 /* Assign PCI device to HVM guest. Sets up IOMMU structures. */
443 #define XEN_DOMCTL_assign_device 37
444 #define XEN_DOMCTL_test_assign_device 45
445 #define XEN_DOMCTL_deassign_device 47
446 struct xen_domctl_assign_device {
447 uint32_t machine_bdf; /* machine PCI ID of assigned device */
449 typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
450 DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
452 /* Retrieve sibling devices infomation of machine_bdf */
453 #define XEN_DOMCTL_get_device_group 50
454 struct xen_domctl_get_device_group {
455 uint32_t machine_bdf; /* IN */
456 uint32_t max_sdevs; /* IN */
457 uint32_t num_sdevs; /* OUT */
458 XEN_GUEST_HANDLE_64(uint32) sdev_array; /* OUT */
460 typedef struct xen_domctl_get_device_group xen_domctl_get_device_group_t;
461 DEFINE_XEN_GUEST_HANDLE(xen_domctl_get_device_group_t);
463 /* Pass-through interrupts: bind real irq -> hvm devfn. */
464 #define XEN_DOMCTL_bind_pt_irq 38
465 #define XEN_DOMCTL_unbind_pt_irq 48
466 typedef enum pt_irq_type_e {
467 PT_IRQ_TYPE_PCI,
468 PT_IRQ_TYPE_ISA,
469 PT_IRQ_TYPE_MSI,
470 } pt_irq_type_t;
471 struct xen_domctl_bind_pt_irq {
472 uint32_t machine_irq;
473 pt_irq_type_t irq_type;
474 uint32_t hvm_domid;
476 union {
477 struct {
478 uint8_t isa_irq;
479 } isa;
480 struct {
481 uint8_t bus;
482 uint8_t device;
483 uint8_t intx;
484 } pci;
485 struct {
486 uint8_t gvec;
487 uint32_t gflags;
488 } msi;
489 } u;
491 typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t;
492 DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_pt_irq_t);
495 /* Bind machine I/O address range -> HVM address range. */
496 #define XEN_DOMCTL_memory_mapping 39
497 #define DPCI_ADD_MAPPING 1
498 #define DPCI_REMOVE_MAPPING 0
499 struct xen_domctl_memory_mapping {
500 uint64_aligned_t first_gfn; /* first page (hvm guest phys page) in range */
501 uint64_aligned_t first_mfn; /* first page (machine page) in range */
502 uint64_aligned_t nr_mfns; /* number of pages in range (>0) */
503 uint32_t add_mapping; /* add or remove mapping */
504 uint32_t padding; /* padding for 64-bit aligned structure */
506 typedef struct xen_domctl_memory_mapping xen_domctl_memory_mapping_t;
507 DEFINE_XEN_GUEST_HANDLE(xen_domctl_memory_mapping_t);
510 /* Bind machine I/O port range -> HVM I/O port range. */
511 #define XEN_DOMCTL_ioport_mapping 40
512 struct xen_domctl_ioport_mapping {
513 uint32_t first_gport; /* first guest IO port*/
514 uint32_t first_mport; /* first machine IO port */
515 uint32_t nr_ports; /* size of port range */
516 uint32_t add_mapping; /* add or remove mapping */
518 typedef struct xen_domctl_ioport_mapping xen_domctl_ioport_mapping_t;
519 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_mapping_t);
523 * Pin caching type of RAM space for x86 HVM domU.
525 #define XEN_DOMCTL_pin_mem_cacheattr 41
526 /* Caching types: these happen to be the same as x86 MTRR/PAT type codes. */
527 #define XEN_DOMCTL_MEM_CACHEATTR_UC 0
528 #define XEN_DOMCTL_MEM_CACHEATTR_WC 1
529 #define XEN_DOMCTL_MEM_CACHEATTR_WT 4
530 #define XEN_DOMCTL_MEM_CACHEATTR_WP 5
531 #define XEN_DOMCTL_MEM_CACHEATTR_WB 6
532 #define XEN_DOMCTL_MEM_CACHEATTR_UCM 7
533 struct xen_domctl_pin_mem_cacheattr {
534 uint64_aligned_t start, end;
535 unsigned int type; /* XEN_DOMCTL_MEM_CACHEATTR_* */
537 typedef struct xen_domctl_pin_mem_cacheattr xen_domctl_pin_mem_cacheattr_t;
538 DEFINE_XEN_GUEST_HANDLE(xen_domctl_pin_mem_cacheattr_t);
541 #define XEN_DOMCTL_set_ext_vcpucontext 42
542 #define XEN_DOMCTL_get_ext_vcpucontext 43
543 struct xen_domctl_ext_vcpucontext {
544 /* IN: VCPU that this call applies to. */
545 uint32_t vcpu;
547 * SET: Size of struct (IN)
548 * GET: Size of struct (OUT)
550 uint32_t size;
551 #if defined(__i386__) || defined(__x86_64__)
552 /* SYSCALL from 32-bit mode and SYSENTER callback information. */
553 /* NB. SYSCALL from 64-bit mode is contained in vcpu_guest_context_t */
554 uint64_aligned_t syscall32_callback_eip;
555 uint64_aligned_t sysenter_callback_eip;
556 uint16_t syscall32_callback_cs;
557 uint16_t sysenter_callback_cs;
558 uint8_t syscall32_disables_events;
559 uint8_t sysenter_disables_events;
560 #endif
562 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
563 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ext_vcpucontext_t);
566 * Set optimizaton features for a domain
568 #define XEN_DOMCTL_set_opt_feature 44
569 struct xen_domctl_set_opt_feature {
570 #if defined(__ia64__)
571 struct xen_ia64_opt_feature optf;
572 #else
573 /* Make struct non-empty: do not depend on this field name! */
574 uint64_t dummy;
575 #endif
577 typedef struct xen_domctl_set_opt_feature xen_domctl_set_opt_feature_t;
578 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_opt_feature_t);
581 * Set the target domain for a domain
583 #define XEN_DOMCTL_set_target 46
584 struct xen_domctl_set_target {
585 domid_t target;
587 typedef struct xen_domctl_set_target xen_domctl_set_target_t;
588 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_target_t);
590 #if defined(__i386__) || defined(__x86_64__)
591 # define XEN_CPUID_INPUT_UNUSED 0xFFFFFFFF
592 # define XEN_DOMCTL_set_cpuid 49
593 struct xen_domctl_cpuid {
594 unsigned int input[2];
595 unsigned int eax;
596 unsigned int ebx;
597 unsigned int ecx;
598 unsigned int edx;
600 typedef struct xen_domctl_cpuid xen_domctl_cpuid_t;
601 DEFINE_XEN_GUEST_HANDLE(xen_domctl_cpuid_t);
602 #endif
604 #define XEN_DOMCTL_subscribe 29
605 struct xen_domctl_subscribe {
606 uint32_t port; /* IN */
608 typedef struct xen_domctl_subscribe xen_domctl_subscribe_t;
609 DEFINE_XEN_GUEST_HANDLE(xen_domctl_subscribe_t);
612 * Define the maximum machine address size which should be allocated
613 * to a guest.
615 #define XEN_DOMCTL_set_machine_address_size 51
616 #define XEN_DOMCTL_get_machine_address_size 52
619 struct xen_domctl {
620 uint32_t cmd;
621 uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
622 domid_t domain;
623 union {
624 struct xen_domctl_createdomain createdomain;
625 struct xen_domctl_getdomaininfo getdomaininfo;
626 struct xen_domctl_getmemlist getmemlist;
627 struct xen_domctl_getpageframeinfo getpageframeinfo;
628 struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
629 struct xen_domctl_vcpuaffinity vcpuaffinity;
630 struct xen_domctl_shadow_op shadow_op;
631 struct xen_domctl_max_mem max_mem;
632 struct xen_domctl_vcpucontext vcpucontext;
633 struct xen_domctl_getvcpuinfo getvcpuinfo;
634 struct xen_domctl_max_vcpus max_vcpus;
635 struct xen_domctl_scheduler_op scheduler_op;
636 struct xen_domctl_setdomainhandle setdomainhandle;
637 struct xen_domctl_setdebugging setdebugging;
638 struct xen_domctl_irq_permission irq_permission;
639 struct xen_domctl_iomem_permission iomem_permission;
640 struct xen_domctl_ioport_permission ioport_permission;
641 struct xen_domctl_hypercall_init hypercall_init;
642 struct xen_domctl_arch_setup arch_setup;
643 struct xen_domctl_settimeoffset settimeoffset;
644 struct xen_domctl_real_mode_area real_mode_area;
645 struct xen_domctl_hvmcontext hvmcontext;
646 struct xen_domctl_address_size address_size;
647 struct xen_domctl_sendtrigger sendtrigger;
648 struct xen_domctl_get_device_group get_device_group;
649 struct xen_domctl_assign_device assign_device;
650 struct xen_domctl_bind_pt_irq bind_pt_irq;
651 struct xen_domctl_memory_mapping memory_mapping;
652 struct xen_domctl_ioport_mapping ioport_mapping;
653 struct xen_domctl_pin_mem_cacheattr pin_mem_cacheattr;
654 struct xen_domctl_ext_vcpucontext ext_vcpucontext;
655 struct xen_domctl_set_opt_feature set_opt_feature;
656 struct xen_domctl_set_target set_target;
657 struct xen_domctl_subscribe subscribe;
658 #if defined(__i386__) || defined(__x86_64__)
659 struct xen_domctl_cpuid cpuid;
660 #endif
661 uint8_t pad[128];
662 } u;
664 typedef struct xen_domctl xen_domctl_t;
665 DEFINE_XEN_GUEST_HANDLE(xen_domctl_t);
667 #endif /* __XEN_PUBLIC_DOMCTL_H__ */
670 * Local variables:
671 * mode: C
672 * c-set-style: "BSD"
673 * c-basic-offset: 4
674 * tab-width: 4
675 * indent-tabs-mode: nil
676 * End: