ia64/linux-2.6.18-xen.hg

view include/xen/interface/domctl.h @ 540:db71fb3204b5

Sync public Xen hedaers with xen-unstable.hg
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon May 12 10:03:08 2008 +0100 (2008-05-12)
parents 06ffa3eb5e3f
children c110692c140f
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 uint32_t flags;
60 };
61 typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
62 DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t);
64 #define XEN_DOMCTL_destroydomain 2
65 #define XEN_DOMCTL_pausedomain 3
66 #define XEN_DOMCTL_unpausedomain 4
67 #define XEN_DOMCTL_resumedomain 27
69 #define XEN_DOMCTL_getdomaininfo 5
70 struct xen_domctl_getdomaininfo {
71 /* OUT variables. */
72 domid_t domain; /* Also echoed in domctl.domain */
73 /* Domain is scheduled to die. */
74 #define _XEN_DOMINF_dying 0
75 #define XEN_DOMINF_dying (1U<<_XEN_DOMINF_dying)
76 /* Domain is an HVM guest (as opposed to a PV guest). */
77 #define _XEN_DOMINF_hvm_guest 1
78 #define XEN_DOMINF_hvm_guest (1U<<_XEN_DOMINF_hvm_guest)
79 /* The guest OS has shut down. */
80 #define _XEN_DOMINF_shutdown 2
81 #define XEN_DOMINF_shutdown (1U<<_XEN_DOMINF_shutdown)
82 /* Currently paused by control software. */
83 #define _XEN_DOMINF_paused 3
84 #define XEN_DOMINF_paused (1U<<_XEN_DOMINF_paused)
85 /* Currently blocked pending an event. */
86 #define _XEN_DOMINF_blocked 4
87 #define XEN_DOMINF_blocked (1U<<_XEN_DOMINF_blocked)
88 /* Domain is currently running. */
89 #define _XEN_DOMINF_running 5
90 #define XEN_DOMINF_running (1U<<_XEN_DOMINF_running)
91 /* Being debugged. */
92 #define _XEN_DOMINF_debugged 6
93 #define XEN_DOMINF_debugged (1U<<_XEN_DOMINF_debugged)
94 /* CPU to which this domain is bound. */
95 #define XEN_DOMINF_cpumask 255
96 #define XEN_DOMINF_cpushift 8
97 /* XEN_DOMINF_shutdown guest-supplied code. */
98 #define XEN_DOMINF_shutdownmask 255
99 #define XEN_DOMINF_shutdownshift 16
100 uint32_t flags; /* XEN_DOMINF_* */
101 uint64_aligned_t tot_pages;
102 uint64_aligned_t max_pages;
103 uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
104 uint64_aligned_t cpu_time;
105 uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
106 uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */
107 uint32_t ssidref;
108 xen_domain_handle_t handle;
109 };
110 typedef struct xen_domctl_getdomaininfo xen_domctl_getdomaininfo_t;
111 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t);
114 #define XEN_DOMCTL_getmemlist 6
115 struct xen_domctl_getmemlist {
116 /* IN variables. */
117 /* Max entries to write to output buffer. */
118 uint64_aligned_t max_pfns;
119 /* Start index in guest's page list. */
120 uint64_aligned_t start_pfn;
121 XEN_GUEST_HANDLE_64(uint64) buffer;
122 /* OUT variables. */
123 uint64_aligned_t num_pfns;
124 };
125 typedef struct xen_domctl_getmemlist xen_domctl_getmemlist_t;
126 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getmemlist_t);
129 #define XEN_DOMCTL_getpageframeinfo 7
131 #define XEN_DOMCTL_PFINFO_LTAB_SHIFT 28
132 #define XEN_DOMCTL_PFINFO_NOTAB (0x0U<<28)
133 #define XEN_DOMCTL_PFINFO_L1TAB (0x1U<<28)
134 #define XEN_DOMCTL_PFINFO_L2TAB (0x2U<<28)
135 #define XEN_DOMCTL_PFINFO_L3TAB (0x3U<<28)
136 #define XEN_DOMCTL_PFINFO_L4TAB (0x4U<<28)
137 #define XEN_DOMCTL_PFINFO_LTABTYPE_MASK (0x7U<<28)
138 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
139 #define XEN_DOMCTL_PFINFO_XTAB (0xfU<<28) /* invalid page */
140 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
142 struct xen_domctl_getpageframeinfo {
143 /* IN variables. */
144 uint64_aligned_t gmfn; /* GMFN to query */
145 /* OUT variables. */
146 /* Is the page PINNED to a type? */
147 uint32_t type; /* see above type defs */
148 };
149 typedef struct xen_domctl_getpageframeinfo xen_domctl_getpageframeinfo_t;
150 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo_t);
153 #define XEN_DOMCTL_getpageframeinfo2 8
154 struct xen_domctl_getpageframeinfo2 {
155 /* IN variables. */
156 uint64_aligned_t num;
157 /* IN/OUT variables. */
158 XEN_GUEST_HANDLE_64(uint32) array;
159 };
160 typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
161 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
164 /*
165 * Control shadow pagetables operation
166 */
167 #define XEN_DOMCTL_shadow_op 10
169 /* Disable shadow mode. */
170 #define XEN_DOMCTL_SHADOW_OP_OFF 0
172 /* Enable shadow mode (mode contains ORed XEN_DOMCTL_SHADOW_ENABLE_* flags). */
173 #define XEN_DOMCTL_SHADOW_OP_ENABLE 32
175 /* Log-dirty bitmap operations. */
176 /* Return the bitmap and clean internal copy for next round. */
177 #define XEN_DOMCTL_SHADOW_OP_CLEAN 11
178 /* Return the bitmap but do not modify internal copy. */
179 #define XEN_DOMCTL_SHADOW_OP_PEEK 12
181 /* Memory allocation accessors. */
182 #define XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION 30
183 #define XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION 31
185 /* Legacy enable operations. */
186 /* Equiv. to ENABLE with no mode flags. */
187 #define XEN_DOMCTL_SHADOW_OP_ENABLE_TEST 1
188 /* Equiv. to ENABLE with mode flag ENABLE_LOG_DIRTY. */
189 #define XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY 2
190 /* Equiv. to ENABLE with mode flags ENABLE_REFCOUNT and ENABLE_TRANSLATE. */
191 #define XEN_DOMCTL_SHADOW_OP_ENABLE_TRANSLATE 3
193 /* Mode flags for XEN_DOMCTL_SHADOW_OP_ENABLE. */
194 /*
195 * Shadow pagetables are refcounted: guest does not use explicit mmu
196 * operations nor write-protect its pagetables.
197 */
198 #define XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT (1 << 1)
199 /*
200 * Log pages in a bitmap as they are dirtied.
201 * Used for live relocation to determine which pages must be re-sent.
202 */
203 #define XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY (1 << 2)
204 /*
205 * Automatically translate GPFNs into MFNs.
206 */
207 #define XEN_DOMCTL_SHADOW_ENABLE_TRANSLATE (1 << 3)
208 /*
209 * Xen does not steal virtual address space from the guest.
210 * Requires HVM support.
211 */
212 #define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL (1 << 4)
214 struct xen_domctl_shadow_op_stats {
215 uint32_t fault_count;
216 uint32_t dirty_count;
217 };
218 typedef struct xen_domctl_shadow_op_stats xen_domctl_shadow_op_stats_t;
219 DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_stats_t);
221 struct xen_domctl_shadow_op {
222 /* IN variables. */
223 uint32_t op; /* XEN_DOMCTL_SHADOW_OP_* */
225 /* OP_ENABLE */
226 uint32_t mode; /* XEN_DOMCTL_SHADOW_ENABLE_* */
228 /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */
229 uint32_t mb; /* Shadow memory allocation in MB */
231 /* OP_PEEK / OP_CLEAN */
232 XEN_GUEST_HANDLE_64(uint8) dirty_bitmap;
233 uint64_aligned_t pages; /* Size of buffer. Updated with actual size. */
234 struct xen_domctl_shadow_op_stats stats;
235 };
236 typedef struct xen_domctl_shadow_op xen_domctl_shadow_op_t;
237 DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_t);
240 #define XEN_DOMCTL_max_mem 11
241 struct xen_domctl_max_mem {
242 /* IN variables. */
243 uint64_aligned_t max_memkb;
244 };
245 typedef struct xen_domctl_max_mem xen_domctl_max_mem_t;
246 DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_mem_t);
249 #define XEN_DOMCTL_setvcpucontext 12
250 #define XEN_DOMCTL_getvcpucontext 13
251 struct xen_domctl_vcpucontext {
252 uint32_t vcpu; /* IN */
253 XEN_GUEST_HANDLE_64(vcpu_guest_context_t) ctxt; /* IN/OUT */
254 };
255 typedef struct xen_domctl_vcpucontext xen_domctl_vcpucontext_t;
256 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpucontext_t);
259 #define XEN_DOMCTL_getvcpuinfo 14
260 struct xen_domctl_getvcpuinfo {
261 /* IN variables. */
262 uint32_t vcpu;
263 /* OUT variables. */
264 uint8_t online; /* currently online (not hotplugged)? */
265 uint8_t blocked; /* blocked waiting for an event? */
266 uint8_t running; /* currently scheduled on its CPU? */
267 uint64_aligned_t cpu_time; /* total cpu time consumed (ns) */
268 uint32_t cpu; /* current mapping */
269 };
270 typedef struct xen_domctl_getvcpuinfo xen_domctl_getvcpuinfo_t;
271 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
274 /* Get/set which physical cpus a vcpu can execute on. */
275 #define XEN_DOMCTL_setvcpuaffinity 9
276 #define XEN_DOMCTL_getvcpuaffinity 25
277 struct xen_domctl_vcpuaffinity {
278 uint32_t vcpu; /* IN */
279 struct xenctl_cpumap cpumap; /* IN/OUT */
280 };
281 typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
282 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
285 #define XEN_DOMCTL_max_vcpus 15
286 struct xen_domctl_max_vcpus {
287 uint32_t max; /* maximum number of vcpus */
288 };
289 typedef struct xen_domctl_max_vcpus xen_domctl_max_vcpus_t;
290 DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t);
293 #define XEN_DOMCTL_scheduler_op 16
294 /* Scheduler types. */
295 #define XEN_SCHEDULER_SEDF 4
296 #define XEN_SCHEDULER_CREDIT 5
297 /* Set or get info? */
298 #define XEN_DOMCTL_SCHEDOP_putinfo 0
299 #define XEN_DOMCTL_SCHEDOP_getinfo 1
300 struct xen_domctl_scheduler_op {
301 uint32_t sched_id; /* XEN_SCHEDULER_* */
302 uint32_t cmd; /* XEN_DOMCTL_SCHEDOP_* */
303 union {
304 struct xen_domctl_sched_sedf {
305 uint64_aligned_t period;
306 uint64_aligned_t slice;
307 uint64_aligned_t latency;
308 uint32_t extratime;
309 uint32_t weight;
310 } sedf;
311 struct xen_domctl_sched_credit {
312 uint16_t weight;
313 uint16_t cap;
314 } credit;
315 } u;
316 };
317 typedef struct xen_domctl_scheduler_op xen_domctl_scheduler_op_t;
318 DEFINE_XEN_GUEST_HANDLE(xen_domctl_scheduler_op_t);
321 #define XEN_DOMCTL_setdomainhandle 17
322 struct xen_domctl_setdomainhandle {
323 xen_domain_handle_t handle;
324 };
325 typedef struct xen_domctl_setdomainhandle xen_domctl_setdomainhandle_t;
326 DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdomainhandle_t);
329 #define XEN_DOMCTL_setdebugging 18
330 struct xen_domctl_setdebugging {
331 uint8_t enable;
332 };
333 typedef struct xen_domctl_setdebugging xen_domctl_setdebugging_t;
334 DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdebugging_t);
337 #define XEN_DOMCTL_irq_permission 19
338 struct xen_domctl_irq_permission {
339 uint8_t pirq;
340 uint8_t allow_access; /* flag to specify enable/disable of IRQ access */
341 };
342 typedef struct xen_domctl_irq_permission xen_domctl_irq_permission_t;
343 DEFINE_XEN_GUEST_HANDLE(xen_domctl_irq_permission_t);
346 #define XEN_DOMCTL_iomem_permission 20
347 struct xen_domctl_iomem_permission {
348 uint64_aligned_t first_mfn;/* first page (physical page number) in range */
349 uint64_aligned_t nr_mfns; /* number of pages in range (>0) */
350 uint8_t allow_access; /* allow (!0) or deny (0) access to range? */
351 };
352 typedef struct xen_domctl_iomem_permission xen_domctl_iomem_permission_t;
353 DEFINE_XEN_GUEST_HANDLE(xen_domctl_iomem_permission_t);
356 #define XEN_DOMCTL_ioport_permission 21
357 struct xen_domctl_ioport_permission {
358 uint32_t first_port; /* first port int range */
359 uint32_t nr_ports; /* size of port range */
360 uint8_t allow_access; /* allow or deny access to range? */
361 };
362 typedef struct xen_domctl_ioport_permission xen_domctl_ioport_permission_t;
363 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_permission_t);
366 #define XEN_DOMCTL_hypercall_init 22
367 struct xen_domctl_hypercall_init {
368 uint64_aligned_t gmfn; /* GMFN to be initialised */
369 };
370 typedef struct xen_domctl_hypercall_init xen_domctl_hypercall_init_t;
371 DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t);
374 #define XEN_DOMCTL_arch_setup 23
375 #define _XEN_DOMAINSETUP_hvm_guest 0
376 #define XEN_DOMAINSETUP_hvm_guest (1UL<<_XEN_DOMAINSETUP_hvm_guest)
377 #define _XEN_DOMAINSETUP_query 1 /* Get parameters (for save) */
378 #define XEN_DOMAINSETUP_query (1UL<<_XEN_DOMAINSETUP_query)
379 #define _XEN_DOMAINSETUP_sioemu_guest 2
380 #define XEN_DOMAINSETUP_sioemu_guest (1UL<<_XEN_DOMAINSETUP_sioemu_guest)
381 typedef struct xen_domctl_arch_setup {
382 uint64_aligned_t flags; /* XEN_DOMAINSETUP_* */
383 #ifdef __ia64__
384 uint64_aligned_t bp; /* mpaddr of boot param area */
385 uint64_aligned_t maxmem; /* Highest memory address for MDT. */
386 uint64_aligned_t xsi_va; /* Xen shared_info area virtual address. */
387 uint32_t hypercall_imm; /* Break imm for Xen hypercalls. */
388 int8_t vhpt_size_log2; /* Log2 of VHPT size. */
389 #endif
390 } xen_domctl_arch_setup_t;
391 DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
394 #define XEN_DOMCTL_settimeoffset 24
395 struct xen_domctl_settimeoffset {
396 int32_t time_offset_seconds; /* applied to domain wallclock time */
397 };
398 typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
399 DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
402 #define XEN_DOMCTL_gethvmcontext 33
403 #define XEN_DOMCTL_sethvmcontext 34
404 typedef struct xen_domctl_hvmcontext {
405 uint32_t size; /* IN/OUT: size of buffer / bytes filled */
406 XEN_GUEST_HANDLE_64(uint8) buffer; /* IN/OUT: data, or call
407 * gethvmcontext with NULL
408 * buffer to get size req'd */
409 } xen_domctl_hvmcontext_t;
410 DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_t);
413 #define XEN_DOMCTL_set_address_size 35
414 #define XEN_DOMCTL_get_address_size 36
415 typedef struct xen_domctl_address_size {
416 uint32_t size;
417 } xen_domctl_address_size_t;
418 DEFINE_XEN_GUEST_HANDLE(xen_domctl_address_size_t);
421 #define XEN_DOMCTL_real_mode_area 26
422 struct xen_domctl_real_mode_area {
423 uint32_t log; /* log2 of Real Mode Area size */
424 };
425 typedef struct xen_domctl_real_mode_area xen_domctl_real_mode_area_t;
426 DEFINE_XEN_GUEST_HANDLE(xen_domctl_real_mode_area_t);
429 #define XEN_DOMCTL_sendtrigger 28
430 #define XEN_DOMCTL_SENDTRIGGER_NMI 0
431 #define XEN_DOMCTL_SENDTRIGGER_RESET 1
432 #define XEN_DOMCTL_SENDTRIGGER_INIT 2
433 struct xen_domctl_sendtrigger {
434 uint32_t trigger; /* IN */
435 uint32_t vcpu; /* IN */
436 };
437 typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t;
438 DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
441 /* Assign PCI device to HVM guest. Sets up IOMMU structures. */
442 #define XEN_DOMCTL_assign_device 37
443 #define XEN_DOMCTL_test_assign_device 45
444 #define XEN_DOMCTL_deassign_device 47
445 struct xen_domctl_assign_device {
446 uint32_t machine_bdf; /* machine PCI ID of assigned device */
447 };
448 typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
449 DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
452 /* Pass-through interrupts: bind real irq -> hvm devfn. */
453 #define XEN_DOMCTL_bind_pt_irq 38
454 #define XEN_DOMCTL_unbind_pt_irq 48
455 typedef enum pt_irq_type_e {
456 PT_IRQ_TYPE_PCI,
457 PT_IRQ_TYPE_ISA,
458 PT_IRQ_TYPE_MSI,
459 } pt_irq_type_t;
460 struct xen_domctl_bind_pt_irq {
461 uint32_t machine_irq;
462 pt_irq_type_t irq_type;
463 uint32_t hvm_domid;
465 union {
466 struct {
467 uint8_t isa_irq;
468 } isa;
469 struct {
470 uint8_t bus;
471 uint8_t device;
472 uint8_t intx;
473 } pci;
474 struct {
475 uint8_t gvec;
476 uint32_t gflags;
477 } msi;
478 } u;
479 };
480 typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t;
481 DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_pt_irq_t);
484 /* Bind machine I/O address range -> HVM address range. */
485 #define XEN_DOMCTL_memory_mapping 39
486 #define DPCI_ADD_MAPPING 1
487 #define DPCI_REMOVE_MAPPING 0
488 struct xen_domctl_memory_mapping {
489 uint64_aligned_t first_gfn; /* first page (hvm guest phys page) in range */
490 uint64_aligned_t first_mfn; /* first page (machine page) in range */
491 uint64_aligned_t nr_mfns; /* number of pages in range (>0) */
492 uint32_t add_mapping; /* add or remove mapping */
493 uint32_t padding; /* padding for 64-bit aligned structure */
494 };
495 typedef struct xen_domctl_memory_mapping xen_domctl_memory_mapping_t;
496 DEFINE_XEN_GUEST_HANDLE(xen_domctl_memory_mapping_t);
499 /* Bind machine I/O port range -> HVM I/O port range. */
500 #define XEN_DOMCTL_ioport_mapping 40
501 struct xen_domctl_ioport_mapping {
502 uint32_t first_gport; /* first guest IO port*/
503 uint32_t first_mport; /* first machine IO port */
504 uint32_t nr_ports; /* size of port range */
505 uint32_t add_mapping; /* add or remove mapping */
506 };
507 typedef struct xen_domctl_ioport_mapping xen_domctl_ioport_mapping_t;
508 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_mapping_t);
511 /*
512 * Pin caching type of RAM space for x86 HVM domU.
513 */
514 #define XEN_DOMCTL_pin_mem_cacheattr 41
515 /* Caching types: these happen to be the same as x86 MTRR/PAT type codes. */
516 #define XEN_DOMCTL_MEM_CACHEATTR_UC 0
517 #define XEN_DOMCTL_MEM_CACHEATTR_WC 1
518 #define XEN_DOMCTL_MEM_CACHEATTR_WT 4
519 #define XEN_DOMCTL_MEM_CACHEATTR_WP 5
520 #define XEN_DOMCTL_MEM_CACHEATTR_WB 6
521 #define XEN_DOMCTL_MEM_CACHEATTR_UCM 7
522 struct xen_domctl_pin_mem_cacheattr {
523 uint64_aligned_t start, end;
524 unsigned int type; /* XEN_DOMCTL_MEM_CACHEATTR_* */
525 };
526 typedef struct xen_domctl_pin_mem_cacheattr xen_domctl_pin_mem_cacheattr_t;
527 DEFINE_XEN_GUEST_HANDLE(xen_domctl_pin_mem_cacheattr_t);
530 #define XEN_DOMCTL_set_ext_vcpucontext 42
531 #define XEN_DOMCTL_get_ext_vcpucontext 43
532 struct xen_domctl_ext_vcpucontext {
533 /* IN: VCPU that this call applies to. */
534 uint32_t vcpu;
535 /*
536 * SET: Size of struct (IN)
537 * GET: Size of struct (OUT)
538 */
539 uint32_t size;
540 #if defined(__i386__) || defined(__x86_64__)
541 /* SYSCALL from 32-bit mode and SYSENTER callback information. */
542 /* NB. SYSCALL from 64-bit mode is contained in vcpu_guest_context_t */
543 uint64_aligned_t syscall32_callback_eip;
544 uint64_aligned_t sysenter_callback_eip;
545 uint16_t syscall32_callback_cs;
546 uint16_t sysenter_callback_cs;
547 uint8_t syscall32_disables_events;
548 uint8_t sysenter_disables_events;
549 #endif
550 };
551 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
552 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ext_vcpucontext_t);
554 /*
555 * Set optimizaton features for a domain
556 */
557 #define XEN_DOMCTL_set_opt_feature 44
558 struct xen_domctl_set_opt_feature {
559 #if defined(__ia64__)
560 struct xen_ia64_opt_feature optf;
561 #else
562 /* Make struct non-empty: do not depend on this field name! */
563 uint64_t dummy;
564 #endif
565 };
566 typedef struct xen_domctl_set_opt_feature xen_domctl_set_opt_feature_t;
567 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_opt_feature_t);
569 /*
570 * Set the target domain for a domain
571 */
572 #define XEN_DOMCTL_set_target 46
573 struct xen_domctl_set_target {
574 domid_t target;
575 };
576 typedef struct xen_domctl_set_target xen_domctl_set_target_t;
577 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_target_t);
579 #if defined(__i386__) || defined(__x86_64__)
580 # define XEN_CPUID_INPUT_UNUSED 0xFFFFFFFF
581 # define XEN_DOMCTL_set_cpuid 49
582 struct xen_domctl_cpuid {
583 unsigned int input[2];
584 unsigned int eax;
585 unsigned int ebx;
586 unsigned int ecx;
587 unsigned int edx;
588 };
589 typedef struct xen_domctl_cpuid xen_domctl_cpuid_t;
590 DEFINE_XEN_GUEST_HANDLE(xen_domctl_cpuid_t);
591 #endif
593 struct xen_domctl {
594 uint32_t cmd;
595 uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
596 domid_t domain;
597 union {
598 struct xen_domctl_createdomain createdomain;
599 struct xen_domctl_getdomaininfo getdomaininfo;
600 struct xen_domctl_getmemlist getmemlist;
601 struct xen_domctl_getpageframeinfo getpageframeinfo;
602 struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
603 struct xen_domctl_vcpuaffinity vcpuaffinity;
604 struct xen_domctl_shadow_op shadow_op;
605 struct xen_domctl_max_mem max_mem;
606 struct xen_domctl_vcpucontext vcpucontext;
607 struct xen_domctl_getvcpuinfo getvcpuinfo;
608 struct xen_domctl_max_vcpus max_vcpus;
609 struct xen_domctl_scheduler_op scheduler_op;
610 struct xen_domctl_setdomainhandle setdomainhandle;
611 struct xen_domctl_setdebugging setdebugging;
612 struct xen_domctl_irq_permission irq_permission;
613 struct xen_domctl_iomem_permission iomem_permission;
614 struct xen_domctl_ioport_permission ioport_permission;
615 struct xen_domctl_hypercall_init hypercall_init;
616 struct xen_domctl_arch_setup arch_setup;
617 struct xen_domctl_settimeoffset settimeoffset;
618 struct xen_domctl_real_mode_area real_mode_area;
619 struct xen_domctl_hvmcontext hvmcontext;
620 struct xen_domctl_address_size address_size;
621 struct xen_domctl_sendtrigger sendtrigger;
622 struct xen_domctl_assign_device assign_device;
623 struct xen_domctl_bind_pt_irq bind_pt_irq;
624 struct xen_domctl_memory_mapping memory_mapping;
625 struct xen_domctl_ioport_mapping ioport_mapping;
626 struct xen_domctl_pin_mem_cacheattr pin_mem_cacheattr;
627 struct xen_domctl_ext_vcpucontext ext_vcpucontext;
628 struct xen_domctl_set_opt_feature set_opt_feature;
629 struct xen_domctl_set_target set_target;
630 #if defined(__i386__) || defined(__x86_64__)
631 struct xen_domctl_cpuid cpuid;
632 #endif
633 uint8_t pad[128];
634 } u;
635 };
636 typedef struct xen_domctl xen_domctl_t;
637 DEFINE_XEN_GUEST_HANDLE(xen_domctl_t);
639 #endif /* __XEN_PUBLIC_DOMCTL_H__ */
641 /*
642 * Local variables:
643 * mode: C
644 * c-set-style: "BSD"
645 * c-basic-offset: 4
646 * tab-width: 4
647 * indent-tabs-mode: nil
648 * End:
649 */