ia64/xen-unstable

view xen/include/public/dom0_ops.h @ 6788:e939d5c5e646

Pass the root directory to Doxyfilter and thence pythfilter.py so that the latter can get the namespace/packages correct.
author ewan@linford.intra
date Tue Sep 13 14:42:21 2005 +0100 (2005-09-13)
parents 813c37b68376
children b35215021b32 9af349b055e5 3233e7ecfa9f
line source
1 /******************************************************************************
2 * dom0_ops.h
3 *
4 * Process command requests from domain-0 guest OS.
5 *
6 * Copyright (c) 2002-2003, B Dragovic
7 * Copyright (c) 2002-2004, K Fraser
8 */
11 #ifndef __XEN_PUBLIC_DOM0_OPS_H__
12 #define __XEN_PUBLIC_DOM0_OPS_H__
14 #include "xen.h"
15 #include "sched_ctl.h"
17 /*
18 * Make sure you increment the interface version whenever you modify this file!
19 * This makes sure that old versions of dom0 tools will stop working in a
20 * well-defined way (rather than crashing the machine, for instance).
21 */
22 #define DOM0_INTERFACE_VERSION 0xAAAA1010
24 /************************************************************************/
26 #define DOM0_GETMEMLIST 2
27 typedef struct {
28 /* IN variables. */
29 domid_t domain;
30 unsigned long max_pfns;
31 void *buffer;
32 /* OUT variables. */
33 unsigned long num_pfns;
34 } dom0_getmemlist_t;
36 #define DOM0_SCHEDCTL 6
37 /* struct sched_ctl_cmd is from sched-ctl.h */
38 typedef struct sched_ctl_cmd dom0_schedctl_t;
40 #define DOM0_ADJUSTDOM 7
41 /* struct sched_adjdom_cmd is from sched-ctl.h */
42 typedef struct sched_adjdom_cmd dom0_adjustdom_t;
44 #define DOM0_CREATEDOMAIN 8
45 typedef struct {
46 /* IN parameters */
47 u32 ssidref;
48 /* IN/OUT parameters. */
49 /* Identifier for new domain (auto-allocate if zero is specified). */
50 domid_t domain;
51 } dom0_createdomain_t;
53 #define DOM0_DESTROYDOMAIN 9
54 typedef struct {
55 /* IN variables. */
56 domid_t domain;
57 } dom0_destroydomain_t;
59 #define DOM0_PAUSEDOMAIN 10
60 typedef struct {
61 /* IN parameters. */
62 domid_t domain;
63 } dom0_pausedomain_t;
65 #define DOM0_UNPAUSEDOMAIN 11
66 typedef struct {
67 /* IN parameters. */
68 domid_t domain;
69 } dom0_unpausedomain_t;
71 #define DOM0_GETDOMAININFO 12
72 typedef struct {
73 /* IN variables. */
74 domid_t domain; /* NB. IN/OUT variable. */
75 /* OUT variables. */
76 #define DOMFLAGS_DYING (1<<0) /* Domain is scheduled to die. */
77 #define DOMFLAGS_SHUTDOWN (1<<2) /* The guest OS has shut down. */
78 #define DOMFLAGS_PAUSED (1<<3) /* Currently paused by control software. */
79 #define DOMFLAGS_BLOCKED (1<<4) /* Currently blocked pending an event. */
80 #define DOMFLAGS_RUNNING (1<<5) /* Domain is currently running. */
81 #define DOMFLAGS_CPUMASK 255 /* CPU to which this domain is bound. */
82 #define DOMFLAGS_CPUSHIFT 8
83 #define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code. */
84 #define DOMFLAGS_SHUTDOWNSHIFT 16
85 u32 flags;
86 unsigned long tot_pages;
87 unsigned long max_pages;
88 unsigned long shared_info_frame; /* MFN of shared_info struct */
89 u64 cpu_time;
90 u32 n_vcpu;
91 s32 vcpu_to_cpu[MAX_VIRT_CPUS]; /* current mapping */
92 cpumap_t cpumap[MAX_VIRT_CPUS]; /* allowable mapping */
93 u32 ssidref;
94 } dom0_getdomaininfo_t;
96 #define DOM0_SETDOMAININFO 13
97 typedef struct {
98 /* IN variables. */
99 domid_t domain;
100 u16 vcpu;
101 /* IN/OUT parameters */
102 vcpu_guest_context_t *ctxt;
103 } dom0_setdomaininfo_t;
105 #define DOM0_MSR 15
106 typedef struct {
107 /* IN variables. */
108 u32 write;
109 u32 cpu_mask;
110 u32 msr;
111 u32 in1;
112 u32 in2;
113 /* OUT variables. */
114 u32 out1;
115 u32 out2;
116 } dom0_msr_t;
118 #define DOM0_DEBUG 16
119 typedef struct {
120 /* IN variables. */
121 domid_t domain;
122 u8 opcode;
123 u32 in1;
124 u32 in2;
125 u32 in3;
126 u32 in4;
127 /* OUT variables. */
128 u32 status;
129 u32 out1;
130 u32 out2;
131 } dom0_debug_t;
133 /*
134 * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
135 * 1 January, 1970 if the current system time was <system_time>.
136 */
137 #define DOM0_SETTIME 17
138 typedef struct {
139 /* IN variables. */
140 u32 secs;
141 u32 nsecs;
142 u64 system_time;
143 } dom0_settime_t;
145 #define DOM0_GETPAGEFRAMEINFO 18
146 #define NOTAB 0 /* normal page */
147 #define L1TAB (1<<28)
148 #define L2TAB (2<<28)
149 #define L3TAB (3<<28)
150 #define L4TAB (4<<28)
151 #define LPINTAB (1<<31)
152 #define XTAB (0xf<<28) /* invalid page */
153 #define LTAB_MASK XTAB
154 #define LTABTYPE_MASK (0x7<<28)
156 typedef struct {
157 /* IN variables. */
158 unsigned long pfn; /* Machine page frame number to query. */
159 domid_t domain; /* To which domain does the frame belong? */
160 /* OUT variables. */
161 /* Is the page PINNED to a type? */
162 u32 type; /* see above type defs */
163 } dom0_getpageframeinfo_t;
165 /*
166 * Read console content from Xen buffer ring.
167 */
168 #define DOM0_READCONSOLE 19
169 typedef struct {
170 /* IN variables. */
171 u32 clear; /* Non-zero -> clear after reading. */
172 /* IN/OUT variables. */
173 char *buffer; /* In: Buffer start; Out: Used buffer start */
174 u32 count; /* In: Buffer size; Out: Used buffer size */
175 } dom0_readconsole_t;
177 /*
178 * Set which physical cpus a vcpu can execute on.
179 */
180 #define DOM0_PINCPUDOMAIN 20
181 typedef struct {
182 /* IN variables. */
183 domid_t domain;
184 u16 vcpu;
185 cpumap_t *cpumap;
186 } dom0_pincpudomain_t;
188 /* Get trace buffers machine base address */
189 #define DOM0_TBUFCONTROL 21
190 typedef struct {
191 /* IN variables */
192 #define DOM0_TBUF_GET_INFO 0
193 #define DOM0_TBUF_SET_CPU_MASK 1
194 #define DOM0_TBUF_SET_EVT_MASK 2
195 u8 op;
196 /* IN/OUT variables */
197 unsigned long cpu_mask;
198 u32 evt_mask;
199 /* OUT variables */
200 unsigned long buffer_mfn;
201 u32 size;
202 } dom0_tbufcontrol_t;
204 /*
205 * Get physical information about the host machine
206 */
207 #define DOM0_PHYSINFO 22
208 typedef struct {
209 u32 threads_per_core;
210 u32 cores_per_socket;
211 u32 sockets_per_node;
212 u32 nr_nodes;
213 u32 cpu_khz;
214 unsigned long total_pages;
215 unsigned long free_pages;
216 u32 hw_cap[8];
217 } dom0_physinfo_t;
219 /*
220 * Get the ID of the current scheduler.
221 */
222 #define DOM0_SCHED_ID 24
223 typedef struct {
224 /* OUT variable */
225 u32 sched_id;
226 } dom0_sched_id_t;
228 /*
229 * Control shadow pagetables operation
230 */
231 #define DOM0_SHADOW_CONTROL 25
233 #define DOM0_SHADOW_CONTROL_OP_OFF 0
234 #define DOM0_SHADOW_CONTROL_OP_ENABLE_TEST 1
235 #define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2
236 #define DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE 3
238 #define DOM0_SHADOW_CONTROL_OP_FLUSH 10 /* table ops */
239 #define DOM0_SHADOW_CONTROL_OP_CLEAN 11
240 #define DOM0_SHADOW_CONTROL_OP_PEEK 12
242 typedef struct dom0_shadow_control
243 {
244 u32 fault_count;
245 u32 dirty_count;
246 u32 dirty_net_count;
247 u32 dirty_block_count;
248 } dom0_shadow_control_stats_t;
250 typedef struct {
251 /* IN variables. */
252 domid_t domain;
253 u32 op;
254 unsigned long *dirty_bitmap; /* pointer to locked buffer */
255 /* IN/OUT variables. */
256 unsigned long pages; /* size of buffer, updated with actual size */
257 /* OUT variables. */
258 dom0_shadow_control_stats_t stats;
259 } dom0_shadow_control_t;
261 #define DOM0_SETDOMAINMAXMEM 28
262 typedef struct {
263 /* IN variables. */
264 domid_t domain;
265 unsigned long max_memkb;
266 } dom0_setdomainmaxmem_t;
268 #define DOM0_GETPAGEFRAMEINFO2 29 /* batched interface */
269 typedef struct {
270 /* IN variables. */
271 domid_t domain;
272 unsigned long num;
273 /* IN/OUT variables. */
274 unsigned long *array;
275 } dom0_getpageframeinfo2_t;
277 /*
278 * Request memory range (@pfn, @pfn+@nr_pfns-1) to have type @type.
279 * On x86, @type is an architecture-defined MTRR memory type.
280 * On success, returns the MTRR that was used (@reg) and a handle that can
281 * be passed to DOM0_DEL_MEMTYPE to accurately tear down the new setting.
282 * (x86-specific).
283 */
284 #define DOM0_ADD_MEMTYPE 31
285 typedef struct {
286 /* IN variables. */
287 unsigned long pfn;
288 unsigned long nr_pfns;
289 u32 type;
290 /* OUT variables. */
291 u32 handle;
292 u32 reg;
293 } dom0_add_memtype_t;
295 /*
296 * Tear down an existing memory-range type. If @handle is remembered then it
297 * should be passed in to accurately tear down the correct setting (in case
298 * of overlapping memory regions with differing types). If it is not known
299 * then @handle should be set to zero. In all cases @reg must be set.
300 * (x86-specific).
301 */
302 #define DOM0_DEL_MEMTYPE 32
303 typedef struct {
304 /* IN variables. */
305 u32 handle;
306 u32 reg;
307 } dom0_del_memtype_t;
309 /* Read current type of an MTRR (x86-specific). */
310 #define DOM0_READ_MEMTYPE 33
311 typedef struct {
312 /* IN variables. */
313 u32 reg;
314 /* OUT variables. */
315 unsigned long pfn;
316 unsigned long nr_pfns;
317 u32 type;
318 } dom0_read_memtype_t;
320 /* Interface for controlling Xen software performance counters. */
321 #define DOM0_PERFCCONTROL 34
322 /* Sub-operations: */
323 #define DOM0_PERFCCONTROL_OP_RESET 1 /* Reset all counters to zero. */
324 #define DOM0_PERFCCONTROL_OP_QUERY 2 /* Get perfctr information. */
325 typedef struct {
326 u8 name[80]; /* name of perf counter */
327 u32 nr_vals; /* number of values for this counter */
328 u32 vals[64]; /* array of values */
329 } dom0_perfc_desc_t;
330 typedef struct {
331 /* IN variables. */
332 u32 op; /* DOM0_PERFCCONTROL_OP_??? */
333 /* OUT variables. */
334 u32 nr_counters; /* number of counters */
335 dom0_perfc_desc_t *desc; /* counter information (or NULL) */
336 } dom0_perfccontrol_t;
338 #define DOM0_MICROCODE 35
339 typedef struct {
340 /* IN variables. */
341 void *data; /* Pointer to microcode data */
342 u32 length; /* Length of microcode data. */
343 } dom0_microcode_t;
345 #define DOM0_IOPORT_PERMISSION 36
346 typedef struct {
347 domid_t domain; /* domain to be affected */
348 u16 first_port; /* first port int range */
349 u16 nr_ports; /* size of port range */
350 u16 allow_access; /* allow or deny access to range? */
351 } dom0_ioport_permission_t;
353 #define DOM0_GETVCPUCONTEXT 37
354 typedef struct {
355 domid_t domain; /* domain to be affected */
356 u16 vcpu; /* vcpu # */
357 vcpu_guest_context_t *ctxt; /* NB. IN/OUT variable. */
358 u64 cpu_time;
359 } dom0_getvcpucontext_t;
361 #define DOM0_GETDOMAININFOLIST 38
362 typedef struct {
363 /* IN variables. */
364 domid_t first_domain;
365 unsigned int max_domains;
366 dom0_getdomaininfo_t *buffer;
367 /* OUT variables. */
368 unsigned int num_domains;
369 } dom0_getdomaininfolist_t;
371 #define DOM0_PLATFORM_QUIRK 39
372 #define QUIRK_NOIRQBALANCING 1
373 typedef struct {
374 /* IN variables. */
375 int quirk_id;
376 } dom0_platform_quirk_t;
378 #define DOM0_PHYSICAL_MEMORY_MAP 40
379 typedef struct {
380 /* IN variables. */
381 int max_map_entries;
382 /* OUT variables. */
383 int nr_map_entries;
384 struct dom0_memory_map_entry {
385 u64 start, end;
386 int is_ram;
387 } *memory_map;
388 } dom0_physical_memory_map_t;
390 typedef struct {
391 u32 cmd;
392 u32 interface_version; /* DOM0_INTERFACE_VERSION */
393 union {
394 dom0_createdomain_t createdomain;
395 dom0_pausedomain_t pausedomain;
396 dom0_unpausedomain_t unpausedomain;
397 dom0_destroydomain_t destroydomain;
398 dom0_getmemlist_t getmemlist;
399 dom0_schedctl_t schedctl;
400 dom0_adjustdom_t adjustdom;
401 dom0_setdomaininfo_t setdomaininfo;
402 dom0_getdomaininfo_t getdomaininfo;
403 dom0_getpageframeinfo_t getpageframeinfo;
404 dom0_msr_t msr;
405 dom0_debug_t debug;
406 dom0_settime_t settime;
407 dom0_readconsole_t readconsole;
408 dom0_pincpudomain_t pincpudomain;
409 dom0_tbufcontrol_t tbufcontrol;
410 dom0_physinfo_t physinfo;
411 dom0_sched_id_t sched_id;
412 dom0_shadow_control_t shadow_control;
413 dom0_setdomainmaxmem_t setdomainmaxmem;
414 dom0_getpageframeinfo2_t getpageframeinfo2;
415 dom0_add_memtype_t add_memtype;
416 dom0_del_memtype_t del_memtype;
417 dom0_read_memtype_t read_memtype;
418 dom0_perfccontrol_t perfccontrol;
419 dom0_microcode_t microcode;
420 dom0_ioport_permission_t ioport_permission;
421 dom0_getvcpucontext_t getvcpucontext;
422 dom0_getdomaininfolist_t getdomaininfolist;
423 dom0_platform_quirk_t platform_quirk;
424 dom0_physical_memory_map_t physical_memory_map;
425 } u;
426 } dom0_op_t;
428 #endif /* __XEN_PUBLIC_DOM0_OPS_H__ */