ia64/xen-unstable

view xen/include/hypervisor-ifs/dom0_ops.h @ 938:eaaf88bbc222

bitkeeper revision 1.597 (3fb26743975c08pGlW-UntXWf-IBnQ)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/br260/xeno.bk
author br260@labyrinth.cl.cam.ac.uk
date Wed Nov 12 17:00:51 2003 +0000 (2003-11-12)
parents 4b4252761715 106bc1c68738
children 151801bd4e5e
line source
1 /******************************************************************************
2 * dom0_ops.h
3 *
4 * Process command requests from domain-0 guest OS.
5 *
6 * Copyright (c) 2002-2003, K A Fraser, B Dragovic
7 */
10 #ifndef __DOM0_OPS_H__
11 #define __DOM0_OPS_H__
13 #include "hypervisor-if.h"
15 /*
16 * Make sure you increment the interface version whenever you modify this file!
17 * This makes sure that old versions of dom0 tools will stop working in a
18 * well-defined way (rather than crashing the machine, for instance).
19 */
20 #define DOM0_INTERFACE_VERSION 0xAAAA0003
23 /*
24 * The following is all CPU context. Note that the i387_ctxt block is filled
25 * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
26 */
27 typedef struct full_execution_context_st
28 {
29 #define ECF_I387_VALID (1<<0)
30 unsigned long flags;
31 execution_context_t i386_ctxt; /* User-level CPU registers */
32 char i387_ctxt[256]; /* User-level FPU registers */
33 trap_info_t trap_ctxt[256]; /* Virtual IDT */
34 unsigned int fast_trap_idx; /* "Fast trap" vector offset */
35 unsigned long ldt_base, ldt_ents; /* LDT (linear address, # ents) */
36 unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
37 unsigned long ring1_ss, ring1_esp; /* Virtual TSS (only SS1/ESP1) */
38 unsigned long pt_base; /* CR3 (pagetable base) */
39 unsigned long debugreg[8]; /* DB0-DB7 (debug registers) */
40 unsigned long event_callback_cs; /* CS:EIP of event callback */
41 unsigned long event_callback_eip;
42 unsigned long failsafe_callback_cs; /* CS:EIP of failsafe callback */
43 unsigned long failsafe_callback_eip;
44 } full_execution_context_t;
46 #define MAX_CMD_LEN 256
47 #define MAX_DOMAIN_NAME 16
49 #define DOM0_CREATEDOMAIN 8
50 typedef struct dom0_createdomain_st
51 {
52 /* IN parameters. */
53 unsigned int memory_kb;
54 char name[MAX_DOMAIN_NAME];
55 /* OUT parameters. */
56 unsigned int domain;
57 } dom0_createdomain_t;
59 #define DOM0_STARTDOMAIN 10
60 typedef struct dom0_startdomain_st
61 {
62 /* IN parameters. */
63 unsigned int domain;
64 } dom0_startdomain_t;
66 #define DOM0_STOPDOMAIN 11
67 typedef struct dom0_stopdomain_st
68 {
69 /* IN parameters. */
70 unsigned int domain;
71 } dom0_stopdomain_t;
73 #define DOM0_DESTROYDOMAIN 9
74 typedef struct dom0_destroydomain_st
75 {
76 /* IN variables. */
77 unsigned int domain;
78 int force;
79 } dom0_destroydomain_t;
81 #define DOM0_GETMEMLIST 2
82 typedef struct dom0_getmemlist_st
83 {
84 /* IN variables. */
85 unsigned int domain;
86 unsigned long max_pfns;
87 void *buffer;
88 /* OUT variables. */
89 unsigned long num_pfns;
90 } dom0_getmemlist_t;
92 #define DOM0_BUILDDOMAIN 13
93 typedef struct dom0_builddomain_st
94 {
95 /* IN variables. */
96 unsigned int domain;
97 unsigned int num_vifs;
98 full_execution_context_t ctxt;
99 } dom0_builddomain_t;
101 #define DOM0_BVTCTL 6
102 typedef struct dom0_bvtctl_st
103 {
104 /* IN variables. */
105 unsigned long ctx_allow; /* context switch allowance */
106 } dom0_bvtctl_t;
108 #define DOM0_ADJUSTDOM 7
109 typedef struct dom0_adjustdom_st
110 {
111 /* IN variables. */
112 unsigned int domain; /* domain id */
113 unsigned long mcu_adv; /* mcu advance: inverse of weight */
114 unsigned long warp; /* time warp */
115 unsigned long warpl; /* warp limit */
116 unsigned long warpu; /* unwarp time requirement */
117 } dom0_adjustdom_t;
119 #define DOM0_GETDOMAININFO 12
120 typedef struct dom0_getdomaininfo_st
121 {
122 /* IN variables. */
123 unsigned int domain;
124 /* OUT variables. */
125 char name[MAX_DOMAIN_NAME];
126 int processor;
127 int has_cpu;
128 #define DOMSTATE_ACTIVE 0
129 #define DOMSTATE_STOPPED 1
130 int state;
131 int hyp_events;
132 unsigned long mcu_advance;
133 unsigned int tot_pages;
134 long long cpu_time;
135 unsigned long shared_info_frame; /* MFN of shared_info struct */
136 full_execution_context_t ctxt;
137 } dom0_getdomaininfo_t;
139 #define DOM0_GETPAGEFRAMEINFO 18
140 typedef struct dom0_getpageframeinfo_st
141 {
142 /* IN variables. */
143 unsigned long pfn; /* Machine page frame number to query. */
144 /* OUT variables. */
145 unsigned int domain; /* To which domain does the frame belong? */
146 enum { NONE, L1TAB, L2TAB } type; /* Is the page PINNED to a type? */
147 } dom0_getpageframeinfo_t;
149 #define DOM0_IOPL 14
150 typedef struct dom0_iopl_st
151 {
152 unsigned int domain;
153 unsigned int iopl;
154 } dom0_iopl_t;
156 #define DOM0_MSR 15
157 typedef struct dom0_msr_st
158 {
159 /* IN variables. */
160 int write, cpu_mask, msr;
161 unsigned int in1, in2;
162 /* OUT variables. */
163 unsigned int out1, out2;
164 } dom0_msr_t;
166 #define DOM0_DEBUG 16
167 typedef struct dom0_debug_st
168 {
169 /* IN variables. */
170 char opcode;
171 int domain, in1, in2;
172 /* OUT variables. */
173 int status, out1, out2;
174 } dom0_debug_t;
176 /*
177 * Set clock such that it would read <secs,usecs> after 00:00:00 UTC,
178 * 1 January, 1970 if the current system time was <system_time>.
179 */
180 #define DOM0_SETTIME 17
181 typedef struct dom0_settime_st
182 {
183 /* IN variables. */
184 unsigned long secs, usecs;
185 u64 system_time;
186 } dom0_settime_t;
188 /*
189 * Read console content from Xen buffer ring.
190 */
192 #define DOM0_READCONSOLE 19
193 typedef struct dom0_readconsole_st
194 {
195 char *str;
196 unsigned int count;
197 } dom0_readconsole_t;
199 typedef struct dom0_op_st
200 {
201 unsigned long cmd;
202 unsigned long interface_version; /* DOM0_INTERFACE_VERSION */
203 union
204 {
205 dom0_createdomain_t createdomain;
206 dom0_startdomain_t startdomain;
207 dom0_stopdomain_t stopdomain;
208 dom0_destroydomain_t destroydomain;
209 dom0_getmemlist_t getmemlist;
210 dom0_bvtctl_t bvtctl;
211 dom0_adjustdom_t adjustdom;
212 dom0_builddomain_t builddomain;
213 dom0_getdomaininfo_t getdomaininfo;
214 dom0_getpageframeinfo_t getpageframeinfo;
215 dom0_iopl_t iopl;
216 dom0_msr_t msr;
217 dom0_debug_t debug;
218 dom0_settime_t settime;
219 dom0_readconsole_t readconsole;
220 } u;
221 } dom0_op_t;
223 #endif