]>
Commit | Line | Data |
---|---|---|
6a930a95 BS |
1 | Subject: xen3 include-xen-interface |
2 | From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 728:832aac894efd) | |
3 | Patch-mainline: obsolete | |
4 | Acked-by: jbeulich@novell.com | |
5 | ||
6 | Index: head-2008-11-25/include/xen/interface/COPYING | |
7 | =================================================================== | |
8 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
9 | +++ head-2008-11-25/include/xen/interface/COPYING 2007-06-12 13:14:19.000000000 +0200 | |
10 | @@ -0,0 +1,38 @@ | |
11 | +XEN NOTICE | |
12 | +========== | |
13 | + | |
14 | +This copyright applies to all files within this subdirectory and its | |
15 | +subdirectories: | |
16 | + include/public/*.h | |
17 | + include/public/hvm/*.h | |
18 | + include/public/io/*.h | |
19 | + | |
20 | +The intention is that these files can be freely copied into the source | |
21 | +tree of an operating system when porting that OS to run on Xen. Doing | |
22 | +so does *not* cause the OS to become subject to the terms of the GPL. | |
23 | + | |
24 | +All other files in the Xen source distribution are covered by version | |
25 | +2 of the GNU General Public License except where explicitly stated | |
26 | +otherwise within individual source files. | |
27 | + | |
28 | + -- Keir Fraser (on behalf of the Xen team) | |
29 | + | |
30 | +===================================================================== | |
31 | + | |
32 | +Permission is hereby granted, free of charge, to any person obtaining a copy | |
33 | +of this software and associated documentation files (the "Software"), to | |
34 | +deal in the Software without restriction, including without limitation the | |
35 | +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
36 | +sell copies of the Software, and to permit persons to whom the Software is | |
37 | +furnished to do so, subject to the following conditions: | |
38 | + | |
39 | +The above copyright notice and this permission notice shall be included in | |
40 | +all copies or substantial portions of the Software. | |
41 | + | |
42 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
43 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
44 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
45 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
46 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
47 | +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
48 | +DEALINGS IN THE SOFTWARE. | |
49 | Index: head-2008-11-25/include/xen/interface/arch-x86/cpuid.h | |
50 | =================================================================== | |
51 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
52 | +++ head-2008-11-25/include/xen/interface/arch-x86/cpuid.h 2008-01-21 11:15:27.000000000 +0100 | |
53 | @@ -0,0 +1,68 @@ | |
54 | +/****************************************************************************** | |
55 | + * arch-x86/cpuid.h | |
56 | + * | |
57 | + * CPUID interface to Xen. | |
58 | + * | |
59 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
60 | + * of this software and associated documentation files (the "Software"), to | |
61 | + * deal in the Software without restriction, including without limitation the | |
62 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
63 | + * sell copies of the Software, and to permit persons to whom the Software is | |
64 | + * furnished to do so, subject to the following conditions: | |
65 | + * | |
66 | + * The above copyright notice and this permission notice shall be included in | |
67 | + * all copies or substantial portions of the Software. | |
68 | + * | |
69 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
70 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
71 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
72 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
73 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
74 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
75 | + * DEALINGS IN THE SOFTWARE. | |
76 | + * | |
77 | + * Copyright (c) 2007 Citrix Systems, Inc. | |
78 | + * | |
79 | + * Authors: | |
80 | + * Keir Fraser <keir.fraser@citrix.com> | |
81 | + */ | |
82 | + | |
83 | +#ifndef __XEN_PUBLIC_ARCH_X86_CPUID_H__ | |
84 | +#define __XEN_PUBLIC_ARCH_X86_CPUID_H__ | |
85 | + | |
86 | +/* Xen identification leaves start at 0x40000000. */ | |
87 | +#define XEN_CPUID_FIRST_LEAF 0x40000000 | |
88 | +#define XEN_CPUID_LEAF(i) (XEN_CPUID_FIRST_LEAF + (i)) | |
89 | + | |
90 | +/* | |
91 | + * Leaf 1 (0x40000000) | |
92 | + * EAX: Largest Xen-information leaf. All leaves up to an including @EAX | |
93 | + * are supported by the Xen host. | |
94 | + * EBX-EDX: "XenVMMXenVMM" signature, allowing positive identification | |
95 | + * of a Xen host. | |
96 | + */ | |
97 | +#define XEN_CPUID_SIGNATURE_EBX 0x566e6558 /* "XenV" */ | |
98 | +#define XEN_CPUID_SIGNATURE_ECX 0x65584d4d /* "MMXe" */ | |
99 | +#define XEN_CPUID_SIGNATURE_EDX 0x4d4d566e /* "nVMM" */ | |
100 | + | |
101 | +/* | |
102 | + * Leaf 2 (0x40000001) | |
103 | + * EAX[31:16]: Xen major version. | |
104 | + * EAX[15: 0]: Xen minor version. | |
105 | + * EBX-EDX: Reserved (currently all zeroes). | |
106 | + */ | |
107 | + | |
108 | +/* | |
109 | + * Leaf 3 (0x40000002) | |
110 | + * EAX: Number of hypercall transfer pages. This register is always guaranteed | |
111 | + * to specify one hypercall page. | |
112 | + * EBX: Base address of Xen-specific MSRs. | |
113 | + * ECX: Features 1. Unused bits are set to zero. | |
114 | + * EDX: Features 2. Unused bits are set to zero. | |
115 | + */ | |
116 | + | |
117 | +/* Does the host support MMU_PT_UPDATE_PRESERVE_AD for this guest? */ | |
118 | +#define _XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD 0 | |
119 | +#define XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD (1u<<0) | |
120 | + | |
121 | +#endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */ | |
122 | Index: head-2008-11-25/include/xen/interface/arch-x86/hvm/save.h | |
123 | =================================================================== | |
124 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
125 | +++ head-2008-11-25/include/xen/interface/arch-x86/hvm/save.h 2008-10-29 09:55:56.000000000 +0100 | |
126 | @@ -0,0 +1,440 @@ | |
127 | +/* | |
128 | + * Structure definitions for HVM state that is held by Xen and must | |
129 | + * be saved along with the domain's memory and device-model state. | |
130 | + * | |
131 | + * Copyright (c) 2007 XenSource Ltd. | |
132 | + * | |
133 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
134 | + * of this software and associated documentation files (the "Software"), to | |
135 | + * deal in the Software without restriction, including without limitation the | |
136 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
137 | + * sell copies of the Software, and to permit persons to whom the Software is | |
138 | + * furnished to do so, subject to the following conditions: | |
139 | + * | |
140 | + * The above copyright notice and this permission notice shall be included in | |
141 | + * all copies or substantial portions of the Software. | |
142 | + * | |
143 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
144 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
145 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
146 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
147 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
148 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
149 | + * DEALINGS IN THE SOFTWARE. | |
150 | + */ | |
151 | + | |
152 | +#ifndef __XEN_PUBLIC_HVM_SAVE_X86_H__ | |
153 | +#define __XEN_PUBLIC_HVM_SAVE_X86_H__ | |
154 | + | |
155 | +/* | |
156 | + * Save/restore header: general info about the save file. | |
157 | + */ | |
158 | + | |
159 | +#define HVM_FILE_MAGIC 0x54381286 | |
160 | +#define HVM_FILE_VERSION 0x00000001 | |
161 | + | |
162 | +struct hvm_save_header { | |
163 | + uint32_t magic; /* Must be HVM_FILE_MAGIC */ | |
164 | + uint32_t version; /* File format version */ | |
165 | + uint64_t changeset; /* Version of Xen that saved this file */ | |
166 | + uint32_t cpuid; /* CPUID[0x01][%eax] on the saving machine */ | |
167 | + uint32_t pad0; | |
168 | +}; | |
169 | + | |
170 | +DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header); | |
171 | + | |
172 | + | |
173 | +/* | |
174 | + * Processor | |
175 | + */ | |
176 | + | |
177 | +struct hvm_hw_cpu { | |
178 | + uint8_t fpu_regs[512]; | |
179 | + | |
180 | + uint64_t rax; | |
181 | + uint64_t rbx; | |
182 | + uint64_t rcx; | |
183 | + uint64_t rdx; | |
184 | + uint64_t rbp; | |
185 | + uint64_t rsi; | |
186 | + uint64_t rdi; | |
187 | + uint64_t rsp; | |
188 | + uint64_t r8; | |
189 | + uint64_t r9; | |
190 | + uint64_t r10; | |
191 | + uint64_t r11; | |
192 | + uint64_t r12; | |
193 | + uint64_t r13; | |
194 | + uint64_t r14; | |
195 | + uint64_t r15; | |
196 | + | |
197 | + uint64_t rip; | |
198 | + uint64_t rflags; | |
199 | + | |
200 | + uint64_t cr0; | |
201 | + uint64_t cr2; | |
202 | + uint64_t cr3; | |
203 | + uint64_t cr4; | |
204 | + | |
205 | + uint64_t dr0; | |
206 | + uint64_t dr1; | |
207 | + uint64_t dr2; | |
208 | + uint64_t dr3; | |
209 | + uint64_t dr6; | |
210 | + uint64_t dr7; | |
211 | + | |
212 | + uint32_t cs_sel; | |
213 | + uint32_t ds_sel; | |
214 | + uint32_t es_sel; | |
215 | + uint32_t fs_sel; | |
216 | + uint32_t gs_sel; | |
217 | + uint32_t ss_sel; | |
218 | + uint32_t tr_sel; | |
219 | + uint32_t ldtr_sel; | |
220 | + | |
221 | + uint32_t cs_limit; | |
222 | + uint32_t ds_limit; | |
223 | + uint32_t es_limit; | |
224 | + uint32_t fs_limit; | |
225 | + uint32_t gs_limit; | |
226 | + uint32_t ss_limit; | |
227 | + uint32_t tr_limit; | |
228 | + uint32_t ldtr_limit; | |
229 | + uint32_t idtr_limit; | |
230 | + uint32_t gdtr_limit; | |
231 | + | |
232 | + uint64_t cs_base; | |
233 | + uint64_t ds_base; | |
234 | + uint64_t es_base; | |
235 | + uint64_t fs_base; | |
236 | + uint64_t gs_base; | |
237 | + uint64_t ss_base; | |
238 | + uint64_t tr_base; | |
239 | + uint64_t ldtr_base; | |
240 | + uint64_t idtr_base; | |
241 | + uint64_t gdtr_base; | |
242 | + | |
243 | + uint32_t cs_arbytes; | |
244 | + uint32_t ds_arbytes; | |
245 | + uint32_t es_arbytes; | |
246 | + uint32_t fs_arbytes; | |
247 | + uint32_t gs_arbytes; | |
248 | + uint32_t ss_arbytes; | |
249 | + uint32_t tr_arbytes; | |
250 | + uint32_t ldtr_arbytes; | |
251 | + | |
252 | + uint32_t sysenter_cs; | |
253 | + uint32_t padding0; | |
254 | + | |
255 | + uint64_t sysenter_esp; | |
256 | + uint64_t sysenter_eip; | |
257 | + | |
258 | + /* msr for em64t */ | |
259 | + uint64_t shadow_gs; | |
260 | + | |
261 | + /* msr content saved/restored. */ | |
262 | + uint64_t msr_flags; | |
263 | + uint64_t msr_lstar; | |
264 | + uint64_t msr_star; | |
265 | + uint64_t msr_cstar; | |
266 | + uint64_t msr_syscall_mask; | |
267 | + uint64_t msr_efer; | |
268 | + | |
269 | + /* guest's idea of what rdtsc() would return */ | |
270 | + uint64_t tsc; | |
271 | + | |
272 | + /* pending event, if any */ | |
273 | + union { | |
274 | + uint32_t pending_event; | |
275 | + struct { | |
276 | + uint8_t pending_vector:8; | |
277 | + uint8_t pending_type:3; | |
278 | + uint8_t pending_error_valid:1; | |
279 | + uint32_t pending_reserved:19; | |
280 | + uint8_t pending_valid:1; | |
281 | + }; | |
282 | + }; | |
283 | + /* error code for pending event */ | |
284 | + uint32_t error_code; | |
285 | +}; | |
286 | + | |
287 | +DECLARE_HVM_SAVE_TYPE(CPU, 2, struct hvm_hw_cpu); | |
288 | + | |
289 | + | |
290 | +/* | |
291 | + * PIC | |
292 | + */ | |
293 | + | |
294 | +struct hvm_hw_vpic { | |
295 | + /* IR line bitmasks. */ | |
296 | + uint8_t irr; | |
297 | + uint8_t imr; | |
298 | + uint8_t isr; | |
299 | + | |
300 | + /* Line IRx maps to IRQ irq_base+x */ | |
301 | + uint8_t irq_base; | |
302 | + | |
303 | + /* | |
304 | + * Where are we in ICW2-4 initialisation (0 means no init in progress)? | |
305 | + * Bits 0-1 (=x): Next write at A=1 sets ICW(x+1). | |
306 | + * Bit 2: ICW1.IC4 (1 == ICW4 included in init sequence) | |
307 | + * Bit 3: ICW1.SNGL (0 == ICW3 included in init sequence) | |
308 | + */ | |
309 | + uint8_t init_state:4; | |
310 | + | |
311 | + /* IR line with highest priority. */ | |
312 | + uint8_t priority_add:4; | |
313 | + | |
314 | + /* Reads from A=0 obtain ISR or IRR? */ | |
315 | + uint8_t readsel_isr:1; | |
316 | + | |
317 | + /* Reads perform a polling read? */ | |
318 | + uint8_t poll:1; | |
319 | + | |
320 | + /* Automatically clear IRQs from the ISR during INTA? */ | |
321 | + uint8_t auto_eoi:1; | |
322 | + | |
323 | + /* Automatically rotate IRQ priorities during AEOI? */ | |
324 | + uint8_t rotate_on_auto_eoi:1; | |
325 | + | |
326 | + /* Exclude slave inputs when considering in-service IRQs? */ | |
327 | + uint8_t special_fully_nested_mode:1; | |
328 | + | |
329 | + /* Special mask mode excludes masked IRs from AEOI and priority checks. */ | |
330 | + uint8_t special_mask_mode:1; | |
331 | + | |
332 | + /* Is this a master PIC or slave PIC? (NB. This is not programmable.) */ | |
333 | + uint8_t is_master:1; | |
334 | + | |
335 | + /* Edge/trigger selection. */ | |
336 | + uint8_t elcr; | |
337 | + | |
338 | + /* Virtual INT output. */ | |
339 | + uint8_t int_output; | |
340 | +}; | |
341 | + | |
342 | +DECLARE_HVM_SAVE_TYPE(PIC, 3, struct hvm_hw_vpic); | |
343 | + | |
344 | + | |
345 | +/* | |
346 | + * IO-APIC | |
347 | + */ | |
348 | + | |
349 | +#ifdef __ia64__ | |
350 | +#define VIOAPIC_IS_IOSAPIC 1 | |
351 | +#define VIOAPIC_NUM_PINS 24 | |
352 | +#else | |
353 | +#define VIOAPIC_NUM_PINS 48 /* 16 ISA IRQs, 32 non-legacy PCI IRQS. */ | |
354 | +#endif | |
355 | + | |
356 | +struct hvm_hw_vioapic { | |
357 | + uint64_t base_address; | |
358 | + uint32_t ioregsel; | |
359 | + uint32_t id; | |
360 | + union vioapic_redir_entry | |
361 | + { | |
362 | + uint64_t bits; | |
363 | + struct { | |
364 | + uint8_t vector; | |
365 | + uint8_t delivery_mode:3; | |
366 | + uint8_t dest_mode:1; | |
367 | + uint8_t delivery_status:1; | |
368 | + uint8_t polarity:1; | |
369 | + uint8_t remote_irr:1; | |
370 | + uint8_t trig_mode:1; | |
371 | + uint8_t mask:1; | |
372 | + uint8_t reserve:7; | |
373 | +#if !VIOAPIC_IS_IOSAPIC | |
374 | + uint8_t reserved[4]; | |
375 | + uint8_t dest_id; | |
376 | +#else | |
377 | + uint8_t reserved[3]; | |
378 | + uint16_t dest_id; | |
379 | +#endif | |
380 | + } fields; | |
381 | + } redirtbl[VIOAPIC_NUM_PINS]; | |
382 | +}; | |
383 | + | |
384 | +DECLARE_HVM_SAVE_TYPE(IOAPIC, 4, struct hvm_hw_vioapic); | |
385 | + | |
386 | + | |
387 | +/* | |
388 | + * LAPIC | |
389 | + */ | |
390 | + | |
391 | +struct hvm_hw_lapic { | |
392 | + uint64_t apic_base_msr; | |
393 | + uint32_t disabled; /* VLAPIC_xx_DISABLED */ | |
394 | + uint32_t timer_divisor; | |
395 | +}; | |
396 | + | |
397 | +DECLARE_HVM_SAVE_TYPE(LAPIC, 5, struct hvm_hw_lapic); | |
398 | + | |
399 | +struct hvm_hw_lapic_regs { | |
400 | + uint8_t data[1024]; | |
401 | +}; | |
402 | + | |
403 | +DECLARE_HVM_SAVE_TYPE(LAPIC_REGS, 6, struct hvm_hw_lapic_regs); | |
404 | + | |
405 | + | |
406 | +/* | |
407 | + * IRQs | |
408 | + */ | |
409 | + | |
410 | +struct hvm_hw_pci_irqs { | |
411 | + /* | |
412 | + * Virtual interrupt wires for a single PCI bus. | |
413 | + * Indexed by: device*4 + INTx#. | |
414 | + */ | |
415 | + union { | |
416 | + DECLARE_BITMAP(i, 32*4); | |
417 | + uint64_t pad[2]; | |
418 | + }; | |
419 | +}; | |
420 | + | |
421 | +DECLARE_HVM_SAVE_TYPE(PCI_IRQ, 7, struct hvm_hw_pci_irqs); | |
422 | + | |
423 | +struct hvm_hw_isa_irqs { | |
424 | + /* | |
425 | + * Virtual interrupt wires for ISA devices. | |
426 | + * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing). | |
427 | + */ | |
428 | + union { | |
429 | + DECLARE_BITMAP(i, 16); | |
430 | + uint64_t pad[1]; | |
431 | + }; | |
432 | +}; | |
433 | + | |
434 | +DECLARE_HVM_SAVE_TYPE(ISA_IRQ, 8, struct hvm_hw_isa_irqs); | |
435 | + | |
436 | +struct hvm_hw_pci_link { | |
437 | + /* | |
438 | + * PCI-ISA interrupt router. | |
439 | + * Each PCI <device:INTx#> is 'wire-ORed' into one of four links using | |
440 | + * the traditional 'barber's pole' mapping ((device + INTx#) & 3). | |
441 | + * The router provides a programmable mapping from each link to a GSI. | |
442 | + */ | |
443 | + uint8_t route[4]; | |
444 | + uint8_t pad0[4]; | |
445 | +}; | |
446 | + | |
447 | +DECLARE_HVM_SAVE_TYPE(PCI_LINK, 9, struct hvm_hw_pci_link); | |
448 | + | |
449 | +/* | |
450 | + * PIT | |
451 | + */ | |
452 | + | |
453 | +struct hvm_hw_pit { | |
454 | + struct hvm_hw_pit_channel { | |
455 | + uint32_t count; /* can be 65536 */ | |
456 | + uint16_t latched_count; | |
457 | + uint8_t count_latched; | |
458 | + uint8_t status_latched; | |
459 | + uint8_t status; | |
460 | + uint8_t read_state; | |
461 | + uint8_t write_state; | |
462 | + uint8_t write_latch; | |
463 | + uint8_t rw_mode; | |
464 | + uint8_t mode; | |
465 | + uint8_t bcd; /* not supported */ | |
466 | + uint8_t gate; /* timer start */ | |
467 | + } channels[3]; /* 3 x 16 bytes */ | |
468 | + uint32_t speaker_data_on; | |
469 | + uint32_t pad0; | |
470 | +}; | |
471 | + | |
472 | +DECLARE_HVM_SAVE_TYPE(PIT, 10, struct hvm_hw_pit); | |
473 | + | |
474 | + | |
475 | +/* | |
476 | + * RTC | |
477 | + */ | |
478 | + | |
479 | +#define RTC_CMOS_SIZE 14 | |
480 | +struct hvm_hw_rtc { | |
481 | + /* CMOS bytes */ | |
482 | + uint8_t cmos_data[RTC_CMOS_SIZE]; | |
483 | + /* Index register for 2-part operations */ | |
484 | + uint8_t cmos_index; | |
485 | + uint8_t pad0; | |
486 | +}; | |
487 | + | |
488 | +DECLARE_HVM_SAVE_TYPE(RTC, 11, struct hvm_hw_rtc); | |
489 | + | |
490 | + | |
491 | +/* | |
492 | + * HPET | |
493 | + */ | |
494 | + | |
495 | +#define HPET_TIMER_NUM 3 /* 3 timers supported now */ | |
496 | +struct hvm_hw_hpet { | |
497 | + /* Memory-mapped, software visible registers */ | |
498 | + uint64_t capability; /* capabilities */ | |
499 | + uint64_t res0; /* reserved */ | |
500 | + uint64_t config; /* configuration */ | |
501 | + uint64_t res1; /* reserved */ | |
502 | + uint64_t isr; /* interrupt status reg */ | |
503 | + uint64_t res2[25]; /* reserved */ | |
504 | + uint64_t mc64; /* main counter */ | |
505 | + uint64_t res3; /* reserved */ | |
506 | + struct { /* timers */ | |
507 | + uint64_t config; /* configuration/cap */ | |
508 | + uint64_t cmp; /* comparator */ | |
509 | + uint64_t fsb; /* FSB route, not supported now */ | |
510 | + uint64_t res4; /* reserved */ | |
511 | + } timers[HPET_TIMER_NUM]; | |
512 | + uint64_t res5[4*(24-HPET_TIMER_NUM)]; /* reserved, up to 0x3ff */ | |
513 | + | |
514 | + /* Hidden register state */ | |
515 | + uint64_t period[HPET_TIMER_NUM]; /* Last value written to comparator */ | |
516 | +}; | |
517 | + | |
518 | +DECLARE_HVM_SAVE_TYPE(HPET, 12, struct hvm_hw_hpet); | |
519 | + | |
520 | + | |
521 | +/* | |
522 | + * PM timer | |
523 | + */ | |
524 | + | |
525 | +struct hvm_hw_pmtimer { | |
526 | + uint32_t tmr_val; /* PM_TMR_BLK.TMR_VAL: 32bit free-running counter */ | |
527 | + uint16_t pm1a_sts; /* PM1a_EVT_BLK.PM1a_STS: status register */ | |
528 | + uint16_t pm1a_en; /* PM1a_EVT_BLK.PM1a_EN: enable register */ | |
529 | +}; | |
530 | + | |
531 | +DECLARE_HVM_SAVE_TYPE(PMTIMER, 13, struct hvm_hw_pmtimer); | |
532 | + | |
533 | +/* | |
534 | + * MTRR MSRs | |
535 | + */ | |
536 | + | |
537 | +struct hvm_hw_mtrr { | |
538 | +#define MTRR_VCNT 8 | |
539 | +#define NUM_FIXED_MSR 11 | |
540 | + uint64_t msr_pat_cr; | |
541 | + /* mtrr physbase & physmask msr pair*/ | |
542 | + uint64_t msr_mtrr_var[MTRR_VCNT*2]; | |
543 | + uint64_t msr_mtrr_fixed[NUM_FIXED_MSR]; | |
544 | + uint64_t msr_mtrr_cap; | |
545 | + uint64_t msr_mtrr_def_type; | |
546 | +}; | |
547 | + | |
548 | +DECLARE_HVM_SAVE_TYPE(MTRR, 14, struct hvm_hw_mtrr); | |
549 | + | |
550 | +/* | |
551 | + * Viridian hypervisor context. | |
552 | + */ | |
553 | + | |
554 | +struct hvm_viridian_context { | |
555 | + uint64_t hypercall_gpa; | |
556 | + uint64_t guest_os_id; | |
557 | +}; | |
558 | + | |
559 | +DECLARE_HVM_SAVE_TYPE(VIRIDIAN, 15, struct hvm_viridian_context); | |
560 | + | |
561 | +/* | |
562 | + * Largest type-code in use | |
563 | + */ | |
564 | +#define HVM_SAVE_CODE_MAX 15 | |
565 | + | |
566 | +#endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */ | |
567 | Index: head-2008-11-25/include/xen/interface/arch-x86/xen-mca.h | |
568 | =================================================================== | |
569 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
570 | +++ head-2008-11-25/include/xen/interface/arch-x86/xen-mca.h 2008-09-01 12:07:31.000000000 +0200 | |
571 | @@ -0,0 +1,279 @@ | |
572 | +/****************************************************************************** | |
573 | + * arch-x86/mca.h | |
574 | + * | |
575 | + * Contributed by Advanced Micro Devices, Inc. | |
576 | + * Author: Christoph Egger <Christoph.Egger@amd.com> | |
577 | + * | |
578 | + * Guest OS machine check interface to x86 Xen. | |
579 | + * | |
580 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
581 | + * of this software and associated documentation files (the "Software"), to | |
582 | + * deal in the Software without restriction, including without limitation the | |
583 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
584 | + * sell copies of the Software, and to permit persons to whom the Software is | |
585 | + * furnished to do so, subject to the following conditions: | |
586 | + * | |
587 | + * The above copyright notice and this permission notice shall be included in | |
588 | + * all copies or substantial portions of the Software. | |
589 | + * | |
590 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
591 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
592 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
593 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
594 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
595 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
596 | + * DEALINGS IN THE SOFTWARE. | |
597 | + */ | |
598 | + | |
599 | +/* Full MCA functionality has the following Usecases from the guest side: | |
600 | + * | |
601 | + * Must have's: | |
602 | + * 1. Dom0 and DomU register machine check trap callback handlers | |
603 | + * (already done via "set_trap_table" hypercall) | |
604 | + * 2. Dom0 registers machine check event callback handler | |
605 | + * (doable via EVTCHNOP_bind_virq) | |
606 | + * 3. Dom0 and DomU fetches machine check data | |
607 | + * 4. Dom0 wants Xen to notify a DomU | |
608 | + * 5. Dom0 gets DomU ID from physical address | |
609 | + * 6. Dom0 wants Xen to kill DomU (already done for "xm destroy") | |
610 | + * | |
611 | + * Nice to have's: | |
612 | + * 7. Dom0 wants Xen to deactivate a physical CPU | |
613 | + * This is better done as separate task, physical CPU hotplugging, | |
614 | + * and hypercall(s) should be sysctl's | |
615 | + * 8. Page migration proposed from Xen NUMA work, where Dom0 can tell Xen to | |
616 | + * move a DomU (or Dom0 itself) away from a malicious page | |
617 | + * producing correctable errors. | |
618 | + * 9. offlining physical page: | |
619 | + * Xen free's and never re-uses a certain physical page. | |
620 | + * 10. Testfacility: Allow Dom0 to write values into machine check MSR's | |
621 | + * and tell Xen to trigger a machine check | |
622 | + */ | |
623 | + | |
624 | +#ifndef __XEN_PUBLIC_ARCH_X86_MCA_H__ | |
625 | +#define __XEN_PUBLIC_ARCH_X86_MCA_H__ | |
626 | + | |
627 | +/* Hypercall */ | |
628 | +#define __HYPERVISOR_mca __HYPERVISOR_arch_0 | |
629 | + | |
630 | +#define XEN_MCA_INTERFACE_VERSION 0x03000001 | |
631 | + | |
632 | +/* IN: Dom0 calls hypercall from MC event handler. */ | |
633 | +#define XEN_MC_CORRECTABLE 0x0 | |
634 | +/* IN: Dom0/DomU calls hypercall from MC trap handler. */ | |
635 | +#define XEN_MC_TRAP 0x1 | |
636 | +/* XEN_MC_CORRECTABLE and XEN_MC_TRAP are mutually exclusive. */ | |
637 | + | |
638 | +/* OUT: All is ok */ | |
639 | +#define XEN_MC_OK 0x0 | |
640 | +/* OUT: Domain could not fetch data. */ | |
641 | +#define XEN_MC_FETCHFAILED 0x1 | |
642 | +/* OUT: There was no machine check data to fetch. */ | |
643 | +#define XEN_MC_NODATA 0x2 | |
644 | +/* OUT: Between notification time and this hypercall an other | |
645 | + * (most likely) correctable error happened. The fetched data, | |
646 | + * does not match the original machine check data. */ | |
647 | +#define XEN_MC_NOMATCH 0x4 | |
648 | + | |
649 | +/* OUT: DomU did not register MC NMI handler. Try something else. */ | |
650 | +#define XEN_MC_CANNOTHANDLE 0x8 | |
651 | +/* OUT: Notifying DomU failed. Retry later or try something else. */ | |
652 | +#define XEN_MC_NOTDELIVERED 0x10 | |
653 | +/* Note, XEN_MC_CANNOTHANDLE and XEN_MC_NOTDELIVERED are mutually exclusive. */ | |
654 | + | |
655 | + | |
656 | +#ifndef __ASSEMBLY__ | |
657 | + | |
658 | +#define VIRQ_MCA VIRQ_ARCH_0 /* G. (DOM0) Machine Check Architecture */ | |
659 | + | |
660 | +/* | |
661 | + * Machine Check Architecure: | |
662 | + * structs are read-only and used to report all kinds of | |
663 | + * correctable and uncorrectable errors detected by the HW. | |
664 | + * Dom0 and DomU: register a handler to get notified. | |
665 | + * Dom0 only: Correctable errors are reported via VIRQ_MCA | |
666 | + * Dom0 and DomU: Uncorrectable errors are reported via nmi handlers | |
667 | + */ | |
668 | +#define MC_TYPE_GLOBAL 0 | |
669 | +#define MC_TYPE_BANK 1 | |
670 | +#define MC_TYPE_EXTENDED 2 | |
671 | + | |
672 | +struct mcinfo_common { | |
673 | + uint16_t type; /* structure type */ | |
674 | + uint16_t size; /* size of this struct in bytes */ | |
675 | +}; | |
676 | + | |
677 | + | |
678 | +#define MC_FLAG_CORRECTABLE (1 << 0) | |
679 | +#define MC_FLAG_UNCORRECTABLE (1 << 1) | |
680 | + | |
681 | +/* contains global x86 mc information */ | |
682 | +struct mcinfo_global { | |
683 | + struct mcinfo_common common; | |
684 | + | |
685 | + /* running domain at the time in error (most likely the impacted one) */ | |
686 | + uint16_t mc_domid; | |
687 | + uint32_t mc_socketid; /* physical socket of the physical core */ | |
688 | + uint16_t mc_coreid; /* physical impacted core */ | |
689 | + uint16_t mc_core_threadid; /* core thread of physical core */ | |
690 | + uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */ | |
691 | + uint64_t mc_gstatus; /* global status */ | |
692 | + uint32_t mc_flags; | |
693 | +}; | |
694 | + | |
695 | +/* contains bank local x86 mc information */ | |
696 | +struct mcinfo_bank { | |
697 | + struct mcinfo_common common; | |
698 | + | |
699 | + uint16_t mc_bank; /* bank nr */ | |
700 | + uint16_t mc_domid; /* Usecase 5: domain referenced by mc_addr on dom0 | |
701 | + * and if mc_addr is valid. Never valid on DomU. */ | |
702 | + uint64_t mc_status; /* bank status */ | |
703 | + uint64_t mc_addr; /* bank address, only valid | |
704 | + * if addr bit is set in mc_status */ | |
705 | + uint64_t mc_misc; | |
706 | +}; | |
707 | + | |
708 | + | |
709 | +struct mcinfo_msr { | |
710 | + uint64_t reg; /* MSR */ | |
711 | + uint64_t value; /* MSR value */ | |
712 | +}; | |
713 | + | |
714 | +/* contains mc information from other | |
715 | + * or additional mc MSRs */ | |
716 | +struct mcinfo_extended { | |
717 | + struct mcinfo_common common; | |
718 | + | |
719 | + /* You can fill up to five registers. | |
720 | + * If you need more, then use this structure | |
721 | + * multiple times. */ | |
722 | + | |
723 | + uint32_t mc_msrs; /* Number of msr with valid values. */ | |
724 | + struct mcinfo_msr mc_msr[5]; | |
725 | +}; | |
726 | + | |
727 | +#define MCINFO_HYPERCALLSIZE 1024 | |
728 | +#define MCINFO_MAXSIZE 768 | |
729 | + | |
730 | +struct mc_info { | |
731 | + /* Number of mcinfo_* entries in mi_data */ | |
732 | + uint32_t mi_nentries; | |
733 | + | |
734 | + uint8_t mi_data[MCINFO_MAXSIZE - sizeof(uint32_t)]; | |
735 | +}; | |
736 | +typedef struct mc_info mc_info_t; | |
737 | + | |
738 | + | |
739 | + | |
740 | +/* | |
741 | + * OS's should use these instead of writing their own lookup function | |
742 | + * each with its own bugs and drawbacks. | |
743 | + * We use macros instead of static inline functions to allow guests | |
744 | + * to include this header in assembly files (*.S). | |
745 | + */ | |
746 | +/* Prototype: | |
747 | + * uint32_t x86_mcinfo_nentries(struct mc_info *mi); | |
748 | + */ | |
749 | +#define x86_mcinfo_nentries(_mi) \ | |
750 | + (_mi)->mi_nentries | |
751 | +/* Prototype: | |
752 | + * struct mcinfo_common *x86_mcinfo_first(struct mc_info *mi); | |
753 | + */ | |
754 | +#define x86_mcinfo_first(_mi) \ | |
755 | + (struct mcinfo_common *)((_mi)->mi_data) | |
756 | +/* Prototype: | |
757 | + * struct mcinfo_common *x86_mcinfo_next(struct mcinfo_common *mic); | |
758 | + */ | |
759 | +#define x86_mcinfo_next(_mic) \ | |
760 | + (struct mcinfo_common *)((uint8_t *)(_mic) + (_mic)->size) | |
761 | + | |
762 | +/* Prototype: | |
763 | + * void x86_mcinfo_lookup(void *ret, struct mc_info *mi, uint16_t type); | |
764 | + */ | |
765 | +#define x86_mcinfo_lookup(_ret, _mi, _type) \ | |
766 | + do { \ | |
767 | + uint32_t found, i; \ | |
768 | + struct mcinfo_common *_mic; \ | |
769 | + \ | |
770 | + found = 0; \ | |
771 | + (_ret) = NULL; \ | |
772 | + if (_mi == NULL) break; \ | |
773 | + _mic = x86_mcinfo_first(_mi); \ | |
774 | + for (i = 0; i < x86_mcinfo_nentries(_mi); i++) { \ | |
775 | + if (_mic->type == (_type)) { \ | |
776 | + found = 1; \ | |
777 | + break; \ | |
778 | + } \ | |
779 | + _mic = x86_mcinfo_next(_mic); \ | |
780 | + } \ | |
781 | + (_ret) = found ? _mic : NULL; \ | |
782 | + } while (0) | |
783 | + | |
784 | + | |
785 | +/* Usecase 1 | |
786 | + * Register machine check trap callback handler | |
787 | + * (already done via "set_trap_table" hypercall) | |
788 | + */ | |
789 | + | |
790 | +/* Usecase 2 | |
791 | + * Dom0 registers machine check event callback handler | |
792 | + * done by EVTCHNOP_bind_virq | |
793 | + */ | |
794 | + | |
795 | +/* Usecase 3 | |
796 | + * Fetch machine check data from hypervisor. | |
797 | + * Note, this hypercall is special, because both Dom0 and DomU must use this. | |
798 | + */ | |
799 | +#define XEN_MC_fetch 1 | |
800 | +struct xen_mc_fetch { | |
801 | + /* IN/OUT variables. */ | |
802 | + uint32_t flags; | |
803 | + | |
804 | +/* IN: XEN_MC_CORRECTABLE, XEN_MC_TRAP */ | |
805 | +/* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED, XEN_MC_NODATA, XEN_MC_NOMATCH */ | |
806 | + | |
807 | + /* OUT variables. */ | |
808 | + uint32_t fetch_idx; /* only useful for Dom0 for the notify hypercall */ | |
809 | + struct mc_info mc_info; | |
810 | +}; | |
811 | +typedef struct xen_mc_fetch xen_mc_fetch_t; | |
812 | +DEFINE_XEN_GUEST_HANDLE(xen_mc_fetch_t); | |
813 | + | |
814 | + | |
815 | +/* Usecase 4 | |
816 | + * This tells the hypervisor to notify a DomU about the machine check error | |
817 | + */ | |
818 | +#define XEN_MC_notifydomain 2 | |
819 | +struct xen_mc_notifydomain { | |
820 | + /* IN variables. */ | |
821 | + uint16_t mc_domid; /* The unprivileged domain to notify. */ | |
822 | + uint16_t mc_vcpuid; /* The vcpu in mc_domid to notify. | |
823 | + * Usually echo'd value from the fetch hypercall. */ | |
824 | + uint32_t fetch_idx; /* echo'd value from the fetch hypercall. */ | |
825 | + | |
826 | + /* IN/OUT variables. */ | |
827 | + uint32_t flags; | |
828 | + | |
829 | +/* IN: XEN_MC_CORRECTABLE, XEN_MC_TRAP */ | |
830 | +/* OUT: XEN_MC_OK, XEN_MC_CANNOTHANDLE, XEN_MC_NOTDELIVERED, XEN_MC_NOMATCH */ | |
831 | +}; | |
832 | +typedef struct xen_mc_notifydomain xen_mc_notifydomain_t; | |
833 | +DEFINE_XEN_GUEST_HANDLE(xen_mc_notifydomain_t); | |
834 | + | |
835 | + | |
836 | +struct xen_mc { | |
837 | + uint32_t cmd; | |
838 | + uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */ | |
839 | + union { | |
840 | + struct xen_mc_fetch mc_fetch; | |
841 | + struct xen_mc_notifydomain mc_notifydomain; | |
842 | + uint8_t pad[MCINFO_HYPERCALLSIZE]; | |
843 | + } u; | |
844 | +}; | |
845 | +typedef struct xen_mc xen_mc_t; | |
846 | +DEFINE_XEN_GUEST_HANDLE(xen_mc_t); | |
847 | + | |
848 | +#endif /* __ASSEMBLY__ */ | |
849 | + | |
850 | +#endif /* __XEN_PUBLIC_ARCH_X86_MCA_H__ */ | |
851 | Index: head-2008-11-25/include/xen/interface/arch-x86/xen-x86_32.h | |
852 | =================================================================== | |
853 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
854 | +++ head-2008-11-25/include/xen/interface/arch-x86/xen-x86_32.h 2008-07-21 11:00:33.000000000 +0200 | |
855 | @@ -0,0 +1,180 @@ | |
856 | +/****************************************************************************** | |
857 | + * xen-x86_32.h | |
858 | + * | |
859 | + * Guest OS interface to x86 32-bit Xen. | |
860 | + * | |
861 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
862 | + * of this software and associated documentation files (the "Software"), to | |
863 | + * deal in the Software without restriction, including without limitation the | |
864 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
865 | + * sell copies of the Software, and to permit persons to whom the Software is | |
866 | + * furnished to do so, subject to the following conditions: | |
867 | + * | |
868 | + * The above copyright notice and this permission notice shall be included in | |
869 | + * all copies or substantial portions of the Software. | |
870 | + * | |
871 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
872 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
873 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
874 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
875 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
876 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
877 | + * DEALINGS IN THE SOFTWARE. | |
878 | + * | |
879 | + * Copyright (c) 2004-2007, K A Fraser | |
880 | + */ | |
881 | + | |
882 | +#ifndef __XEN_PUBLIC_ARCH_X86_XEN_X86_32_H__ | |
883 | +#define __XEN_PUBLIC_ARCH_X86_XEN_X86_32_H__ | |
884 | + | |
885 | +/* | |
886 | + * Hypercall interface: | |
887 | + * Input: %ebx, %ecx, %edx, %esi, %edi (arguments 1-5) | |
888 | + * Output: %eax | |
889 | + * Access is via hypercall page (set up by guest loader or via a Xen MSR): | |
890 | + * call hypercall_page + hypercall-number * 32 | |
891 | + * Clobbered: Argument registers (e.g., 2-arg hypercall clobbers %ebx,%ecx) | |
892 | + */ | |
893 | + | |
894 | +#if __XEN_INTERFACE_VERSION__ < 0x00030203 | |
895 | +/* | |
896 | + * Legacy hypercall interface: | |
897 | + * As above, except the entry sequence to the hypervisor is: | |
898 | + * mov $hypercall-number*32,%eax ; int $0x82 | |
899 | + */ | |
900 | +#define TRAP_INSTR "int $0x82" | |
901 | +#endif | |
902 | + | |
903 | +/* | |
904 | + * These flat segments are in the Xen-private section of every GDT. Since these | |
905 | + * are also present in the initial GDT, many OSes will be able to avoid | |
906 | + * installing their own GDT. | |
907 | + */ | |
908 | +#define FLAT_RING1_CS 0xe019 /* GDT index 259 */ | |
909 | +#define FLAT_RING1_DS 0xe021 /* GDT index 260 */ | |
910 | +#define FLAT_RING1_SS 0xe021 /* GDT index 260 */ | |
911 | +#define FLAT_RING3_CS 0xe02b /* GDT index 261 */ | |
912 | +#define FLAT_RING3_DS 0xe033 /* GDT index 262 */ | |
913 | +#define FLAT_RING3_SS 0xe033 /* GDT index 262 */ | |
914 | + | |
915 | +#define FLAT_KERNEL_CS FLAT_RING1_CS | |
916 | +#define FLAT_KERNEL_DS FLAT_RING1_DS | |
917 | +#define FLAT_KERNEL_SS FLAT_RING1_SS | |
918 | +#define FLAT_USER_CS FLAT_RING3_CS | |
919 | +#define FLAT_USER_DS FLAT_RING3_DS | |
920 | +#define FLAT_USER_SS FLAT_RING3_SS | |
921 | + | |
922 | +#define __HYPERVISOR_VIRT_START_PAE 0xF5800000 | |
923 | +#define __MACH2PHYS_VIRT_START_PAE 0xF5800000 | |
924 | +#define __MACH2PHYS_VIRT_END_PAE 0xF6800000 | |
925 | +#define HYPERVISOR_VIRT_START_PAE \ | |
926 | + mk_unsigned_long(__HYPERVISOR_VIRT_START_PAE) | |
927 | +#define MACH2PHYS_VIRT_START_PAE \ | |
928 | + mk_unsigned_long(__MACH2PHYS_VIRT_START_PAE) | |
929 | +#define MACH2PHYS_VIRT_END_PAE \ | |
930 | + mk_unsigned_long(__MACH2PHYS_VIRT_END_PAE) | |
931 | + | |
932 | +/* Non-PAE bounds are obsolete. */ | |
933 | +#define __HYPERVISOR_VIRT_START_NONPAE 0xFC000000 | |
934 | +#define __MACH2PHYS_VIRT_START_NONPAE 0xFC000000 | |
935 | +#define __MACH2PHYS_VIRT_END_NONPAE 0xFC400000 | |
936 | +#define HYPERVISOR_VIRT_START_NONPAE \ | |
937 | + mk_unsigned_long(__HYPERVISOR_VIRT_START_NONPAE) | |
938 | +#define MACH2PHYS_VIRT_START_NONPAE \ | |
939 | + mk_unsigned_long(__MACH2PHYS_VIRT_START_NONPAE) | |
940 | +#define MACH2PHYS_VIRT_END_NONPAE \ | |
941 | + mk_unsigned_long(__MACH2PHYS_VIRT_END_NONPAE) | |
942 | + | |
943 | +#define __HYPERVISOR_VIRT_START __HYPERVISOR_VIRT_START_PAE | |
944 | +#define __MACH2PHYS_VIRT_START __MACH2PHYS_VIRT_START_PAE | |
945 | +#define __MACH2PHYS_VIRT_END __MACH2PHYS_VIRT_END_PAE | |
946 | + | |
947 | +#ifndef HYPERVISOR_VIRT_START | |
948 | +#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) | |
949 | +#endif | |
950 | + | |
951 | +#define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START) | |
952 | +#define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END) | |
953 | +#define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>2) | |
954 | +#ifndef machine_to_phys_mapping | |
955 | +#define machine_to_phys_mapping ((unsigned long *)MACH2PHYS_VIRT_START) | |
956 | +#endif | |
957 | + | |
958 | +/* 32-/64-bit invariability for control interfaces (domctl/sysctl). */ | |
959 | +#if defined(__XEN__) || defined(__XEN_TOOLS__) | |
960 | +#undef ___DEFINE_XEN_GUEST_HANDLE | |
961 | +#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \ | |
962 | + typedef struct { type *p; } \ | |
963 | + __guest_handle_ ## name; \ | |
964 | + typedef struct { union { type *p; uint64_aligned_t q; }; } \ | |
965 | + __guest_handle_64_ ## name | |
966 | +#undef set_xen_guest_handle | |
967 | +#define set_xen_guest_handle(hnd, val) \ | |
968 | + do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0; \ | |
969 | + (hnd).p = val; \ | |
970 | + } while ( 0 ) | |
971 | +#define uint64_aligned_t uint64_t __attribute__((aligned(8))) | |
972 | +#define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name | |
973 | +#define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name) | |
974 | +#endif | |
975 | + | |
976 | +#ifndef __ASSEMBLY__ | |
977 | + | |
978 | +struct cpu_user_regs { | |
979 | + uint32_t ebx; | |
980 | + uint32_t ecx; | |
981 | + uint32_t edx; | |
982 | + uint32_t esi; | |
983 | + uint32_t edi; | |
984 | + uint32_t ebp; | |
985 | + uint32_t eax; | |
986 | + uint16_t error_code; /* private */ | |
987 | + uint16_t entry_vector; /* private */ | |
988 | + uint32_t eip; | |
989 | + uint16_t cs; | |
990 | + uint8_t saved_upcall_mask; | |
991 | + uint8_t _pad0; | |
992 | + uint32_t eflags; /* eflags.IF == !saved_upcall_mask */ | |
993 | + uint32_t esp; | |
994 | + uint16_t ss, _pad1; | |
995 | + uint16_t es, _pad2; | |
996 | + uint16_t ds, _pad3; | |
997 | + uint16_t fs, _pad4; | |
998 | + uint16_t gs, _pad5; | |
999 | +}; | |
1000 | +typedef struct cpu_user_regs cpu_user_regs_t; | |
1001 | +DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t); | |
1002 | + | |
1003 | +/* | |
1004 | + * Page-directory addresses above 4GB do not fit into architectural %cr3. | |
1005 | + * When accessing %cr3, or equivalent field in vcpu_guest_context, guests | |
1006 | + * must use the following accessor macros to pack/unpack valid MFNs. | |
1007 | + */ | |
1008 | +#define xen_pfn_to_cr3(pfn) (((unsigned)(pfn) << 12) | ((unsigned)(pfn) >> 20)) | |
1009 | +#define xen_cr3_to_pfn(cr3) (((unsigned)(cr3) >> 12) | ((unsigned)(cr3) << 20)) | |
1010 | + | |
1011 | +struct arch_vcpu_info { | |
1012 | + unsigned long cr2; | |
1013 | + unsigned long pad[5]; /* sizeof(vcpu_info_t) == 64 */ | |
1014 | +}; | |
1015 | +typedef struct arch_vcpu_info arch_vcpu_info_t; | |
1016 | + | |
1017 | +struct xen_callback { | |
1018 | + unsigned long cs; | |
1019 | + unsigned long eip; | |
1020 | +}; | |
1021 | +typedef struct xen_callback xen_callback_t; | |
1022 | + | |
1023 | +#endif /* !__ASSEMBLY__ */ | |
1024 | + | |
1025 | +#endif /* __XEN_PUBLIC_ARCH_X86_XEN_X86_32_H__ */ | |
1026 | + | |
1027 | +/* | |
1028 | + * Local variables: | |
1029 | + * mode: C | |
1030 | + * c-set-style: "BSD" | |
1031 | + * c-basic-offset: 4 | |
1032 | + * tab-width: 4 | |
1033 | + * indent-tabs-mode: nil | |
1034 | + * End: | |
1035 | + */ | |
1036 | Index: head-2008-11-25/include/xen/interface/arch-x86/xen-x86_64.h | |
1037 | =================================================================== | |
1038 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
1039 | +++ head-2008-11-25/include/xen/interface/arch-x86/xen-x86_64.h 2008-04-02 12:34:02.000000000 +0200 | |
1040 | @@ -0,0 +1,212 @@ | |
1041 | +/****************************************************************************** | |
1042 | + * xen-x86_64.h | |
1043 | + * | |
1044 | + * Guest OS interface to x86 64-bit Xen. | |
1045 | + * | |
1046 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
1047 | + * of this software and associated documentation files (the "Software"), to | |
1048 | + * deal in the Software without restriction, including without limitation the | |
1049 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
1050 | + * sell copies of the Software, and to permit persons to whom the Software is | |
1051 | + * furnished to do so, subject to the following conditions: | |
1052 | + * | |
1053 | + * The above copyright notice and this permission notice shall be included in | |
1054 | + * all copies or substantial portions of the Software. | |
1055 | + * | |
1056 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
1057 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
1058 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
1059 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
1060 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
1061 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
1062 | + * DEALINGS IN THE SOFTWARE. | |
1063 | + * | |
1064 | + * Copyright (c) 2004-2006, K A Fraser | |
1065 | + */ | |
1066 | + | |
1067 | +#ifndef __XEN_PUBLIC_ARCH_X86_XEN_X86_64_H__ | |
1068 | +#define __XEN_PUBLIC_ARCH_X86_XEN_X86_64_H__ | |
1069 | + | |
1070 | +/* | |
1071 | + * Hypercall interface: | |
1072 | + * Input: %rdi, %rsi, %rdx, %r10, %r8 (arguments 1-5) | |
1073 | + * Output: %rax | |
1074 | + * Access is via hypercall page (set up by guest loader or via a Xen MSR): | |
1075 | + * call hypercall_page + hypercall-number * 32 | |
1076 | + * Clobbered: argument registers (e.g., 2-arg hypercall clobbers %rdi,%rsi) | |
1077 | + */ | |
1078 | + | |
1079 | +#if __XEN_INTERFACE_VERSION__ < 0x00030203 | |
1080 | +/* | |
1081 | + * Legacy hypercall interface: | |
1082 | + * As above, except the entry sequence to the hypervisor is: | |
1083 | + * mov $hypercall-number*32,%eax ; syscall | |
1084 | + * Clobbered: %rcx, %r11, argument registers (as above) | |
1085 | + */ | |
1086 | +#define TRAP_INSTR "syscall" | |
1087 | +#endif | |
1088 | + | |
1089 | +/* | |
1090 | + * 64-bit segment selectors | |
1091 | + * These flat segments are in the Xen-private section of every GDT. Since these | |
1092 | + * are also present in the initial GDT, many OSes will be able to avoid | |
1093 | + * installing their own GDT. | |
1094 | + */ | |
1095 | + | |
1096 | +#define FLAT_RING3_CS32 0xe023 /* GDT index 260 */ | |
1097 | +#define FLAT_RING3_CS64 0xe033 /* GDT index 261 */ | |
1098 | +#define FLAT_RING3_DS32 0xe02b /* GDT index 262 */ | |
1099 | +#define FLAT_RING3_DS64 0x0000 /* NULL selector */ | |
1100 | +#define FLAT_RING3_SS32 0xe02b /* GDT index 262 */ | |
1101 | +#define FLAT_RING3_SS64 0xe02b /* GDT index 262 */ | |
1102 | + | |
1103 | +#define FLAT_KERNEL_DS64 FLAT_RING3_DS64 | |
1104 | +#define FLAT_KERNEL_DS32 FLAT_RING3_DS32 | |
1105 | +#define FLAT_KERNEL_DS FLAT_KERNEL_DS64 | |
1106 | +#define FLAT_KERNEL_CS64 FLAT_RING3_CS64 | |
1107 | +#define FLAT_KERNEL_CS32 FLAT_RING3_CS32 | |
1108 | +#define FLAT_KERNEL_CS FLAT_KERNEL_CS64 | |
1109 | +#define FLAT_KERNEL_SS64 FLAT_RING3_SS64 | |
1110 | +#define FLAT_KERNEL_SS32 FLAT_RING3_SS32 | |
1111 | +#define FLAT_KERNEL_SS FLAT_KERNEL_SS64 | |
1112 | + | |
1113 | +#define FLAT_USER_DS64 FLAT_RING3_DS64 | |
1114 | +#define FLAT_USER_DS32 FLAT_RING3_DS32 | |
1115 | +#define FLAT_USER_DS FLAT_USER_DS64 | |
1116 | +#define FLAT_USER_CS64 FLAT_RING3_CS64 | |
1117 | +#define FLAT_USER_CS32 FLAT_RING3_CS32 | |
1118 | +#define FLAT_USER_CS FLAT_USER_CS64 | |
1119 | +#define FLAT_USER_SS64 FLAT_RING3_SS64 | |
1120 | +#define FLAT_USER_SS32 FLAT_RING3_SS32 | |
1121 | +#define FLAT_USER_SS FLAT_USER_SS64 | |
1122 | + | |
1123 | +#define __HYPERVISOR_VIRT_START 0xFFFF800000000000 | |
1124 | +#define __HYPERVISOR_VIRT_END 0xFFFF880000000000 | |
1125 | +#define __MACH2PHYS_VIRT_START 0xFFFF800000000000 | |
1126 | +#define __MACH2PHYS_VIRT_END 0xFFFF804000000000 | |
1127 | + | |
1128 | +#ifndef HYPERVISOR_VIRT_START | |
1129 | +#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) | |
1130 | +#define HYPERVISOR_VIRT_END mk_unsigned_long(__HYPERVISOR_VIRT_END) | |
1131 | +#endif | |
1132 | + | |
1133 | +#define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START) | |
1134 | +#define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END) | |
1135 | +#define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>3) | |
1136 | +#ifndef machine_to_phys_mapping | |
1137 | +#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START) | |
1138 | +#endif | |
1139 | + | |
1140 | +/* | |
1141 | + * int HYPERVISOR_set_segment_base(unsigned int which, unsigned long base) | |
1142 | + * @which == SEGBASE_* ; @base == 64-bit base address | |
1143 | + * Returns 0 on success. | |
1144 | + */ | |
1145 | +#define SEGBASE_FS 0 | |
1146 | +#define SEGBASE_GS_USER 1 | |
1147 | +#define SEGBASE_GS_KERNEL 2 | |
1148 | +#define SEGBASE_GS_USER_SEL 3 /* Set user %gs specified in base[15:0] */ | |
1149 | + | |
1150 | +/* | |
1151 | + * int HYPERVISOR_iret(void) | |
1152 | + * All arguments are on the kernel stack, in the following format. | |
1153 | + * Never returns if successful. Current kernel context is lost. | |
1154 | + * The saved CS is mapped as follows: | |
1155 | + * RING0 -> RING3 kernel mode. | |
1156 | + * RING1 -> RING3 kernel mode. | |
1157 | + * RING2 -> RING3 kernel mode. | |
1158 | + * RING3 -> RING3 user mode. | |
1159 | + * However RING0 indicates that the guest kernel should return to iteself | |
1160 | + * directly with | |
1161 | + * orb $3,1*8(%rsp) | |
1162 | + * iretq | |
1163 | + * If flags contains VGCF_in_syscall: | |
1164 | + * Restore RAX, RIP, RFLAGS, RSP. | |
1165 | + * Discard R11, RCX, CS, SS. | |
1166 | + * Otherwise: | |
1167 | + * Restore RAX, R11, RCX, CS:RIP, RFLAGS, SS:RSP. | |
1168 | + * All other registers are saved on hypercall entry and restored to user. | |
1169 | + */ | |
1170 | +/* Guest exited in SYSCALL context? Return to guest with SYSRET? */ | |
1171 | +#define _VGCF_in_syscall 8 | |
1172 | +#define VGCF_in_syscall (1<<_VGCF_in_syscall) | |
1173 | +#define VGCF_IN_SYSCALL VGCF_in_syscall | |
1174 | + | |
1175 | +#ifndef __ASSEMBLY__ | |
1176 | + | |
1177 | +struct iret_context { | |
1178 | + /* Top of stack (%rsp at point of hypercall). */ | |
1179 | + uint64_t rax, r11, rcx, flags, rip, cs, rflags, rsp, ss; | |
1180 | + /* Bottom of iret stack frame. */ | |
1181 | +}; | |
1182 | + | |
1183 | +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) | |
1184 | +/* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */ | |
1185 | +#define __DECL_REG(name) union { \ | |
1186 | + uint64_t r ## name, e ## name; \ | |
1187 | + uint32_t _e ## name; \ | |
1188 | +} | |
1189 | +#else | |
1190 | +/* Non-gcc sources must always use the proper 64-bit name (e.g., rax). */ | |
1191 | +#define __DECL_REG(name) uint64_t r ## name | |
1192 | +#endif | |
1193 | + | |
1194 | +struct cpu_user_regs { | |
1195 | + uint64_t r15; | |
1196 | + uint64_t r14; | |
1197 | + uint64_t r13; | |
1198 | + uint64_t r12; | |
1199 | + __DECL_REG(bp); | |
1200 | + __DECL_REG(bx); | |
1201 | + uint64_t r11; | |
1202 | + uint64_t r10; | |
1203 | + uint64_t r9; | |
1204 | + uint64_t r8; | |
1205 | + __DECL_REG(ax); | |
1206 | + __DECL_REG(cx); | |
1207 | + __DECL_REG(dx); | |
1208 | + __DECL_REG(si); | |
1209 | + __DECL_REG(di); | |
1210 | + uint32_t error_code; /* private */ | |
1211 | + uint32_t entry_vector; /* private */ | |
1212 | + __DECL_REG(ip); | |
1213 | + uint16_t cs, _pad0[1]; | |
1214 | + uint8_t saved_upcall_mask; | |
1215 | + uint8_t _pad1[3]; | |
1216 | + __DECL_REG(flags); /* rflags.IF == !saved_upcall_mask */ | |
1217 | + __DECL_REG(sp); | |
1218 | + uint16_t ss, _pad2[3]; | |
1219 | + uint16_t es, _pad3[3]; | |
1220 | + uint16_t ds, _pad4[3]; | |
1221 | + uint16_t fs, _pad5[3]; /* Non-zero => takes precedence over fs_base. */ | |
1222 | + uint16_t gs, _pad6[3]; /* Non-zero => takes precedence over gs_base_usr. */ | |
1223 | +}; | |
1224 | +typedef struct cpu_user_regs cpu_user_regs_t; | |
1225 | +DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t); | |
1226 | + | |
1227 | +#undef __DECL_REG | |
1228 | + | |
1229 | +#define xen_pfn_to_cr3(pfn) ((unsigned long)(pfn) << 12) | |
1230 | +#define xen_cr3_to_pfn(cr3) ((unsigned long)(cr3) >> 12) | |
1231 | + | |
1232 | +struct arch_vcpu_info { | |
1233 | + unsigned long cr2; | |
1234 | + unsigned long pad; /* sizeof(vcpu_info_t) == 64 */ | |
1235 | +}; | |
1236 | +typedef struct arch_vcpu_info arch_vcpu_info_t; | |
1237 | + | |
1238 | +typedef unsigned long xen_callback_t; | |
1239 | + | |
1240 | +#endif /* !__ASSEMBLY__ */ | |
1241 | + | |
1242 | +#endif /* __XEN_PUBLIC_ARCH_X86_XEN_X86_64_H__ */ | |
1243 | + | |
1244 | +/* | |
1245 | + * Local variables: | |
1246 | + * mode: C | |
1247 | + * c-set-style: "BSD" | |
1248 | + * c-basic-offset: 4 | |
1249 | + * tab-width: 4 | |
1250 | + * indent-tabs-mode: nil | |
1251 | + * End: | |
1252 | + */ | |
1253 | Index: head-2008-11-25/include/xen/interface/arch-x86/xen.h | |
1254 | =================================================================== | |
1255 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
1256 | +++ head-2008-11-25/include/xen/interface/arch-x86/xen.h 2008-09-01 12:07:31.000000000 +0200 | |
1257 | @@ -0,0 +1,204 @@ | |
1258 | +/****************************************************************************** | |
1259 | + * arch-x86/xen.h | |
1260 | + * | |
1261 | + * Guest OS interface to x86 Xen. | |
1262 | + * | |
1263 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
1264 | + * of this software and associated documentation files (the "Software"), to | |
1265 | + * deal in the Software without restriction, including without limitation the | |
1266 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
1267 | + * sell copies of the Software, and to permit persons to whom the Software is | |
1268 | + * furnished to do so, subject to the following conditions: | |
1269 | + * | |
1270 | + * The above copyright notice and this permission notice shall be included in | |
1271 | + * all copies or substantial portions of the Software. | |
1272 | + * | |
1273 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
1274 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
1275 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
1276 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
1277 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
1278 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
1279 | + * DEALINGS IN THE SOFTWARE. | |
1280 | + * | |
1281 | + * Copyright (c) 2004-2006, K A Fraser | |
1282 | + */ | |
1283 | + | |
1284 | +#include "../xen.h" | |
1285 | + | |
1286 | +#ifndef __XEN_PUBLIC_ARCH_X86_XEN_H__ | |
1287 | +#define __XEN_PUBLIC_ARCH_X86_XEN_H__ | |
1288 | + | |
1289 | +/* Structural guest handles introduced in 0x00030201. */ | |
1290 | +#if __XEN_INTERFACE_VERSION__ >= 0x00030201 | |
1291 | +#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \ | |
1292 | + typedef struct { type *p; } __guest_handle_ ## name | |
1293 | +#else | |
1294 | +#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \ | |
1295 | + typedef type * __guest_handle_ ## name | |
1296 | +#endif | |
1297 | + | |
1298 | +#define __DEFINE_XEN_GUEST_HANDLE(name, type) \ | |
1299 | + ___DEFINE_XEN_GUEST_HANDLE(name, type); \ | |
1300 | + ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type) | |
1301 | +#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name) | |
1302 | +#define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name | |
1303 | +#define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) | |
1304 | +#define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) | |
1305 | +#ifdef __XEN_TOOLS__ | |
1306 | +#define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0) | |
1307 | +#endif | |
1308 | + | |
1309 | +#if defined(__i386__) | |
1310 | +#include "xen-x86_32.h" | |
1311 | +#elif defined(__x86_64__) | |
1312 | +#include "xen-x86_64.h" | |
1313 | +#endif | |
1314 | + | |
1315 | +#ifndef __ASSEMBLY__ | |
1316 | +typedef unsigned long xen_pfn_t; | |
1317 | +#define PRI_xen_pfn "lx" | |
1318 | +#endif | |
1319 | + | |
1320 | +/* | |
1321 | + * SEGMENT DESCRIPTOR TABLES | |
1322 | + */ | |
1323 | +/* | |
1324 | + * A number of GDT entries are reserved by Xen. These are not situated at the | |
1325 | + * start of the GDT because some stupid OSes export hard-coded selector values | |
1326 | + * in their ABI. These hard-coded values are always near the start of the GDT, | |
1327 | + * so Xen places itself out of the way, at the far end of the GDT. | |
1328 | + */ | |
1329 | +#define FIRST_RESERVED_GDT_PAGE 14 | |
1330 | +#define FIRST_RESERVED_GDT_BYTE (FIRST_RESERVED_GDT_PAGE * 4096) | |
1331 | +#define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8) | |
1332 | + | |
1333 | +/* Maximum number of virtual CPUs in multi-processor guests. */ | |
1334 | +#define MAX_VIRT_CPUS 32 | |
1335 | + | |
1336 | + | |
1337 | +/* Machine check support */ | |
1338 | +#include "xen-mca.h" | |
1339 | + | |
1340 | +#ifndef __ASSEMBLY__ | |
1341 | + | |
1342 | +typedef unsigned long xen_ulong_t; | |
1343 | + | |
1344 | +/* | |
1345 | + * Send an array of these to HYPERVISOR_set_trap_table(). | |
1346 | + * The privilege level specifies which modes may enter a trap via a software | |
1347 | + * interrupt. On x86/64, since rings 1 and 2 are unavailable, we allocate | |
1348 | + * privilege levels as follows: | |
1349 | + * Level == 0: Noone may enter | |
1350 | + * Level == 1: Kernel may enter | |
1351 | + * Level == 2: Kernel may enter | |
1352 | + * Level == 3: Everyone may enter | |
1353 | + */ | |
1354 | +#define TI_GET_DPL(_ti) ((_ti)->flags & 3) | |
1355 | +#define TI_GET_IF(_ti) ((_ti)->flags & 4) | |
1356 | +#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl)) | |
1357 | +#define TI_SET_IF(_ti,_if) ((_ti)->flags |= ((!!(_if))<<2)) | |
1358 | +struct trap_info { | |
1359 | + uint8_t vector; /* exception vector */ | |
1360 | + uint8_t flags; /* 0-3: privilege level; 4: clear event enable? */ | |
1361 | + uint16_t cs; /* code selector */ | |
1362 | + unsigned long address; /* code offset */ | |
1363 | +}; | |
1364 | +typedef struct trap_info trap_info_t; | |
1365 | +DEFINE_XEN_GUEST_HANDLE(trap_info_t); | |
1366 | + | |
1367 | +typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */ | |
1368 | + | |
1369 | +/* | |
1370 | + * The following is all CPU context. Note that the fpu_ctxt block is filled | |
1371 | + * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used. | |
1372 | + */ | |
1373 | +struct vcpu_guest_context { | |
1374 | + /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */ | |
1375 | + struct { char x[512]; } fpu_ctxt; /* User-level FPU registers */ | |
1376 | +#define VGCF_I387_VALID (1<<0) | |
1377 | +#define VGCF_IN_KERNEL (1<<2) | |
1378 | +#define _VGCF_i387_valid 0 | |
1379 | +#define VGCF_i387_valid (1<<_VGCF_i387_valid) | |
1380 | +#define _VGCF_in_kernel 2 | |
1381 | +#define VGCF_in_kernel (1<<_VGCF_in_kernel) | |
1382 | +#define _VGCF_failsafe_disables_events 3 | |
1383 | +#define VGCF_failsafe_disables_events (1<<_VGCF_failsafe_disables_events) | |
1384 | +#define _VGCF_syscall_disables_events 4 | |
1385 | +#define VGCF_syscall_disables_events (1<<_VGCF_syscall_disables_events) | |
1386 | +#define _VGCF_online 5 | |
1387 | +#define VGCF_online (1<<_VGCF_online) | |
1388 | + unsigned long flags; /* VGCF_* flags */ | |
1389 | + struct cpu_user_regs user_regs; /* User-level CPU registers */ | |
1390 | + struct trap_info trap_ctxt[256]; /* Virtual IDT */ | |
1391 | + unsigned long ldt_base, ldt_ents; /* LDT (linear address, # ents) */ | |
1392 | + unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */ | |
1393 | + unsigned long kernel_ss, kernel_sp; /* Virtual TSS (only SS1/SP1) */ | |
1394 | + /* NB. User pagetable on x86/64 is placed in ctrlreg[1]. */ | |
1395 | + unsigned long ctrlreg[8]; /* CR0-CR7 (control registers) */ | |
1396 | + unsigned long debugreg[8]; /* DB0-DB7 (debug registers) */ | |
1397 | +#ifdef __i386__ | |
1398 | + unsigned long event_callback_cs; /* CS:EIP of event callback */ | |
1399 | + unsigned long event_callback_eip; | |
1400 | + unsigned long failsafe_callback_cs; /* CS:EIP of failsafe callback */ | |
1401 | + unsigned long failsafe_callback_eip; | |
1402 | +#else | |
1403 | + unsigned long event_callback_eip; | |
1404 | + unsigned long failsafe_callback_eip; | |
1405 | +#ifdef __XEN__ | |
1406 | + union { | |
1407 | + unsigned long syscall_callback_eip; | |
1408 | + struct { | |
1409 | + unsigned int event_callback_cs; /* compat CS of event cb */ | |
1410 | + unsigned int failsafe_callback_cs; /* compat CS of failsafe cb */ | |
1411 | + }; | |
1412 | + }; | |
1413 | +#else | |
1414 | + unsigned long syscall_callback_eip; | |
1415 | +#endif | |
1416 | +#endif | |
1417 | + unsigned long vm_assist; /* VMASST_TYPE_* bitmap */ | |
1418 | +#ifdef __x86_64__ | |
1419 | + /* Segment base addresses. */ | |
1420 | + uint64_t fs_base; | |
1421 | + uint64_t gs_base_kernel; | |
1422 | + uint64_t gs_base_user; | |
1423 | +#endif | |
1424 | +}; | |
1425 | +typedef struct vcpu_guest_context vcpu_guest_context_t; | |
1426 | +DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t); | |
1427 | + | |
1428 | +struct arch_shared_info { | |
1429 | + unsigned long max_pfn; /* max pfn that appears in table */ | |
1430 | + /* Frame containing list of mfns containing list of mfns containing p2m. */ | |
1431 | + xen_pfn_t pfn_to_mfn_frame_list_list; | |
1432 | + unsigned long nmi_reason; | |
1433 | + uint64_t pad[32]; | |
1434 | +}; | |
1435 | +typedef struct arch_shared_info arch_shared_info_t; | |
1436 | + | |
1437 | +#endif /* !__ASSEMBLY__ */ | |
1438 | + | |
1439 | +/* | |
1440 | + * Prefix forces emulation of some non-trapping instructions. | |
1441 | + * Currently only CPUID. | |
1442 | + */ | |
1443 | +#ifdef __ASSEMBLY__ | |
1444 | +#define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ; | |
1445 | +#define XEN_CPUID XEN_EMULATE_PREFIX cpuid | |
1446 | +#else | |
1447 | +#define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; " | |
1448 | +#define XEN_CPUID XEN_EMULATE_PREFIX "cpuid" | |
1449 | +#endif | |
1450 | + | |
1451 | +#endif /* __XEN_PUBLIC_ARCH_X86_XEN_H__ */ | |
1452 | + | |
1453 | +/* | |
1454 | + * Local variables: | |
1455 | + * mode: C | |
1456 | + * c-set-style: "BSD" | |
1457 | + * c-basic-offset: 4 | |
1458 | + * tab-width: 4 | |
1459 | + * indent-tabs-mode: nil | |
1460 | + * End: | |
1461 | + */ | |
1462 | Index: head-2008-11-25/include/xen/interface/arch-x86_32.h | |
1463 | =================================================================== | |
1464 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
1465 | +++ head-2008-11-25/include/xen/interface/arch-x86_32.h 2007-06-12 13:14:19.000000000 +0200 | |
1466 | @@ -0,0 +1,27 @@ | |
1467 | +/****************************************************************************** | |
1468 | + * arch-x86_32.h | |
1469 | + * | |
1470 | + * Guest OS interface to x86 32-bit Xen. | |
1471 | + * | |
1472 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
1473 | + * of this software and associated documentation files (the "Software"), to | |
1474 | + * deal in the Software without restriction, including without limitation the | |
1475 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
1476 | + * sell copies of the Software, and to permit persons to whom the Software is | |
1477 | + * furnished to do so, subject to the following conditions: | |
1478 | + * | |
1479 | + * The above copyright notice and this permission notice shall be included in | |
1480 | + * all copies or substantial portions of the Software. | |
1481 | + * | |
1482 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
1483 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
1484 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
1485 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
1486 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
1487 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
1488 | + * DEALINGS IN THE SOFTWARE. | |
1489 | + * | |
1490 | + * Copyright (c) 2004-2006, K A Fraser | |
1491 | + */ | |
1492 | + | |
1493 | +#include "arch-x86/xen.h" | |
1494 | Index: head-2008-11-25/include/xen/interface/arch-x86_64.h | |
1495 | =================================================================== | |
1496 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
1497 | +++ head-2008-11-25/include/xen/interface/arch-x86_64.h 2007-06-12 13:14:19.000000000 +0200 | |
1498 | @@ -0,0 +1,27 @@ | |
1499 | +/****************************************************************************** | |
1500 | + * arch-x86_64.h | |
1501 | + * | |
1502 | + * Guest OS interface to x86 64-bit Xen. | |
1503 | + * | |
1504 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
1505 | + * of this software and associated documentation files (the "Software"), to | |
1506 | + * deal in the Software without restriction, including without limitation the | |
1507 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
1508 | + * sell copies of the Software, and to permit persons to whom the Software is | |
1509 | + * furnished to do so, subject to the following conditions: | |
1510 | + * | |
1511 | + * The above copyright notice and this permission notice shall be included in | |
1512 | + * all copies or substantial portions of the Software. | |
1513 | + * | |
1514 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
1515 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
1516 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
1517 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
1518 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
1519 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
1520 | + * DEALINGS IN THE SOFTWARE. | |
1521 | + * | |
1522 | + * Copyright (c) 2004-2006, K A Fraser | |
1523 | + */ | |
1524 | + | |
1525 | +#include "arch-x86/xen.h" | |
1526 | Index: head-2008-11-25/include/xen/interface/dom0_ops.h | |
1527 | =================================================================== | |
1528 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
1529 | +++ head-2008-11-25/include/xen/interface/dom0_ops.h 2007-06-12 13:14:19.000000000 +0200 | |
1530 | @@ -0,0 +1,120 @@ | |
1531 | +/****************************************************************************** | |
1532 | + * dom0_ops.h | |
1533 | + * | |
1534 | + * Process command requests from domain-0 guest OS. | |
1535 | + * | |
1536 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
1537 | + * of this software and associated documentation files (the "Software"), to | |
1538 | + * deal in the Software without restriction, including without limitation the | |
1539 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
1540 | + * sell copies of the Software, and to permit persons to whom the Software is | |
1541 | + * furnished to do so, subject to the following conditions: | |
1542 | + * | |
1543 | + * The above copyright notice and this permission notice shall be included in | |
1544 | + * all copies or substantial portions of the Software. | |
1545 | + * | |
1546 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
1547 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
1548 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
1549 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
1550 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
1551 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
1552 | + * DEALINGS IN THE SOFTWARE. | |
1553 | + * | |
1554 | + * Copyright (c) 2002-2003, B Dragovic | |
1555 | + * Copyright (c) 2002-2006, K Fraser | |
1556 | + */ | |
1557 | + | |
1558 | +#ifndef __XEN_PUBLIC_DOM0_OPS_H__ | |
1559 | +#define __XEN_PUBLIC_DOM0_OPS_H__ | |
1560 | + | |
1561 | +#include "xen.h" | |
1562 | +#include "platform.h" | |
1563 | + | |
1564 | +#if __XEN_INTERFACE_VERSION__ >= 0x00030204 | |
1565 | +#error "dom0_ops.h is a compatibility interface only" | |
1566 | +#endif | |
1567 | + | |
1568 | +#define DOM0_INTERFACE_VERSION XENPF_INTERFACE_VERSION | |
1569 | + | |
1570 | +#define DOM0_SETTIME XENPF_settime | |
1571 | +#define dom0_settime xenpf_settime | |
1572 | +#define dom0_settime_t xenpf_settime_t | |
1573 | + | |
1574 | +#define DOM0_ADD_MEMTYPE XENPF_add_memtype | |
1575 | +#define dom0_add_memtype xenpf_add_memtype | |
1576 | +#define dom0_add_memtype_t xenpf_add_memtype_t | |
1577 | + | |
1578 | +#define DOM0_DEL_MEMTYPE XENPF_del_memtype | |
1579 | +#define dom0_del_memtype xenpf_del_memtype | |
1580 | +#define dom0_del_memtype_t xenpf_del_memtype_t | |
1581 | + | |
1582 | +#define DOM0_READ_MEMTYPE XENPF_read_memtype | |
1583 | +#define dom0_read_memtype xenpf_read_memtype | |
1584 | +#define dom0_read_memtype_t xenpf_read_memtype_t | |
1585 | + | |
1586 | +#define DOM0_MICROCODE XENPF_microcode_update | |
1587 | +#define dom0_microcode xenpf_microcode_update | |
1588 | +#define dom0_microcode_t xenpf_microcode_update_t | |
1589 | + | |
1590 | +#define DOM0_PLATFORM_QUIRK XENPF_platform_quirk | |
1591 | +#define dom0_platform_quirk xenpf_platform_quirk | |
1592 | +#define dom0_platform_quirk_t xenpf_platform_quirk_t | |
1593 | + | |
1594 | +typedef uint64_t cpumap_t; | |
1595 | + | |
1596 | +/* Unsupported legacy operation -- defined for API compatibility. */ | |
1597 | +#define DOM0_MSR 15 | |
1598 | +struct dom0_msr { | |
1599 | + /* IN variables. */ | |
1600 | + uint32_t write; | |
1601 | + cpumap_t cpu_mask; | |
1602 | + uint32_t msr; | |
1603 | + uint32_t in1; | |
1604 | + uint32_t in2; | |
1605 | + /* OUT variables. */ | |
1606 | + uint32_t out1; | |
1607 | + uint32_t out2; | |
1608 | +}; | |
1609 | +typedef struct dom0_msr dom0_msr_t; | |
1610 | +DEFINE_XEN_GUEST_HANDLE(dom0_msr_t); | |
1611 | + | |
1612 | +/* Unsupported legacy operation -- defined for API compatibility. */ | |
1613 | +#define DOM0_PHYSICAL_MEMORY_MAP 40 | |
1614 | +struct dom0_memory_map_entry { | |
1615 | + uint64_t start, end; | |
1616 | + uint32_t flags; /* reserved */ | |
1617 | + uint8_t is_ram; | |
1618 | +}; | |
1619 | +typedef struct dom0_memory_map_entry dom0_memory_map_entry_t; | |
1620 | +DEFINE_XEN_GUEST_HANDLE(dom0_memory_map_entry_t); | |
1621 | + | |
1622 | +struct dom0_op { | |
1623 | + uint32_t cmd; | |
1624 | + uint32_t interface_version; /* DOM0_INTERFACE_VERSION */ | |
1625 | + union { | |
1626 | + struct dom0_msr msr; | |
1627 | + struct dom0_settime settime; | |
1628 | + struct dom0_add_memtype add_memtype; | |
1629 | + struct dom0_del_memtype del_memtype; | |
1630 | + struct dom0_read_memtype read_memtype; | |
1631 | + struct dom0_microcode microcode; | |
1632 | + struct dom0_platform_quirk platform_quirk; | |
1633 | + struct dom0_memory_map_entry physical_memory_map; | |
1634 | + uint8_t pad[128]; | |
1635 | + } u; | |
1636 | +}; | |
1637 | +typedef struct dom0_op dom0_op_t; | |
1638 | +DEFINE_XEN_GUEST_HANDLE(dom0_op_t); | |
1639 | + | |
1640 | +#endif /* __XEN_PUBLIC_DOM0_OPS_H__ */ | |
1641 | + | |
1642 | +/* | |
1643 | + * Local variables: | |
1644 | + * mode: C | |
1645 | + * c-set-style: "BSD" | |
1646 | + * c-basic-offset: 4 | |
1647 | + * tab-width: 4 | |
1648 | + * indent-tabs-mode: nil | |
1649 | + * End: | |
1650 | + */ | |
1651 | Index: head-2008-11-25/include/xen/interface/domctl.h | |
1652 | =================================================================== | |
1653 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
1654 | +++ head-2008-11-25/include/xen/interface/domctl.h 2008-10-29 09:55:56.000000000 +0100 | |
1655 | @@ -0,0 +1,680 @@ | |
1656 | +/****************************************************************************** | |
1657 | + * domctl.h | |
1658 | + * | |
1659 | + * Domain management operations. For use by node control stack. | |
1660 | + * | |
1661 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
1662 | + * of this software and associated documentation files (the "Software"), to | |
1663 | + * deal in the Software without restriction, including without limitation the | |
1664 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
1665 | + * sell copies of the Software, and to permit persons to whom the Software is | |
1666 | + * furnished to do so, subject to the following conditions: | |
1667 | + * | |
1668 | + * The above copyright notice and this permission notice shall be included in | |
1669 | + * all copies or substantial portions of the Software. | |
1670 | + * | |
1671 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
1672 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
1673 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
1674 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
1675 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
1676 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
1677 | + * DEALINGS IN THE SOFTWARE. | |
1678 | + * | |
1679 | + * Copyright (c) 2002-2003, B Dragovic | |
1680 | + * Copyright (c) 2002-2006, K Fraser | |
1681 | + */ | |
1682 | + | |
1683 | +#ifndef __XEN_PUBLIC_DOMCTL_H__ | |
1684 | +#define __XEN_PUBLIC_DOMCTL_H__ | |
1685 | + | |
1686 | +#if !defined(__XEN__) && !defined(__XEN_TOOLS__) | |
1687 | +#error "domctl operations are intended for use by node control tools only" | |
1688 | +#endif | |
1689 | + | |
1690 | +#include "xen.h" | |
1691 | + | |
1692 | +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000005 | |
1693 | + | |
1694 | +struct xenctl_cpumap { | |
1695 | + XEN_GUEST_HANDLE_64(uint8) bitmap; | |
1696 | + uint32_t nr_cpus; | |
1697 | +}; | |
1698 | + | |
1699 | +/* | |
1700 | + * NB. xen_domctl.domain is an IN/OUT parameter for this operation. | |
1701 | + * If it is specified as zero, an id is auto-allocated and returned. | |
1702 | + */ | |
1703 | +#define XEN_DOMCTL_createdomain 1 | |
1704 | +struct xen_domctl_createdomain { | |
1705 | + /* IN parameters */ | |
1706 | + uint32_t ssidref; | |
1707 | + xen_domain_handle_t handle; | |
1708 | + /* Is this an HVM guest (as opposed to a PV guest)? */ | |
1709 | +#define _XEN_DOMCTL_CDF_hvm_guest 0 | |
1710 | +#define XEN_DOMCTL_CDF_hvm_guest (1U<<_XEN_DOMCTL_CDF_hvm_guest) | |
1711 | + /* Use hardware-assisted paging if available? */ | |
1712 | +#define _XEN_DOMCTL_CDF_hap 1 | |
1713 | +#define XEN_DOMCTL_CDF_hap (1U<<_XEN_DOMCTL_CDF_hap) | |
1714 | + uint32_t flags; | |
1715 | +}; | |
1716 | +typedef struct xen_domctl_createdomain xen_domctl_createdomain_t; | |
1717 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t); | |
1718 | + | |
1719 | +#define XEN_DOMCTL_destroydomain 2 | |
1720 | +#define XEN_DOMCTL_pausedomain 3 | |
1721 | +#define XEN_DOMCTL_unpausedomain 4 | |
1722 | +#define XEN_DOMCTL_resumedomain 27 | |
1723 | + | |
1724 | +#define XEN_DOMCTL_getdomaininfo 5 | |
1725 | +struct xen_domctl_getdomaininfo { | |
1726 | + /* OUT variables. */ | |
1727 | + domid_t domain; /* Also echoed in domctl.domain */ | |
1728 | + /* Domain is scheduled to die. */ | |
1729 | +#define _XEN_DOMINF_dying 0 | |
1730 | +#define XEN_DOMINF_dying (1U<<_XEN_DOMINF_dying) | |
1731 | + /* Domain is an HVM guest (as opposed to a PV guest). */ | |
1732 | +#define _XEN_DOMINF_hvm_guest 1 | |
1733 | +#define XEN_DOMINF_hvm_guest (1U<<_XEN_DOMINF_hvm_guest) | |
1734 | + /* The guest OS has shut down. */ | |
1735 | +#define _XEN_DOMINF_shutdown 2 | |
1736 | +#define XEN_DOMINF_shutdown (1U<<_XEN_DOMINF_shutdown) | |
1737 | + /* Currently paused by control software. */ | |
1738 | +#define _XEN_DOMINF_paused 3 | |
1739 | +#define XEN_DOMINF_paused (1U<<_XEN_DOMINF_paused) | |
1740 | + /* Currently blocked pending an event. */ | |
1741 | +#define _XEN_DOMINF_blocked 4 | |
1742 | +#define XEN_DOMINF_blocked (1U<<_XEN_DOMINF_blocked) | |
1743 | + /* Domain is currently running. */ | |
1744 | +#define _XEN_DOMINF_running 5 | |
1745 | +#define XEN_DOMINF_running (1U<<_XEN_DOMINF_running) | |
1746 | + /* Being debugged. */ | |
1747 | +#define _XEN_DOMINF_debugged 6 | |
1748 | +#define XEN_DOMINF_debugged (1U<<_XEN_DOMINF_debugged) | |
1749 | + /* CPU to which this domain is bound. */ | |
1750 | +#define XEN_DOMINF_cpumask 255 | |
1751 | +#define XEN_DOMINF_cpushift 8 | |
1752 | + /* XEN_DOMINF_shutdown guest-supplied code. */ | |
1753 | +#define XEN_DOMINF_shutdownmask 255 | |
1754 | +#define XEN_DOMINF_shutdownshift 16 | |
1755 | + uint32_t flags; /* XEN_DOMINF_* */ | |
1756 | + uint64_aligned_t tot_pages; | |
1757 | + uint64_aligned_t max_pages; | |
1758 | + uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */ | |
1759 | + uint64_aligned_t cpu_time; | |
1760 | + uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */ | |
1761 | + uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */ | |
1762 | + uint32_t ssidref; | |
1763 | + xen_domain_handle_t handle; | |
1764 | +}; | |
1765 | +typedef struct xen_domctl_getdomaininfo xen_domctl_getdomaininfo_t; | |
1766 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t); | |
1767 | + | |
1768 | + | |
1769 | +#define XEN_DOMCTL_getmemlist 6 | |
1770 | +struct xen_domctl_getmemlist { | |
1771 | + /* IN variables. */ | |
1772 | + /* Max entries to write to output buffer. */ | |
1773 | + uint64_aligned_t max_pfns; | |
1774 | + /* Start index in guest's page list. */ | |
1775 | + uint64_aligned_t start_pfn; | |
1776 | + XEN_GUEST_HANDLE_64(uint64) buffer; | |
1777 | + /* OUT variables. */ | |
1778 | + uint64_aligned_t num_pfns; | |
1779 | +}; | |
1780 | +typedef struct xen_domctl_getmemlist xen_domctl_getmemlist_t; | |
1781 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_getmemlist_t); | |
1782 | + | |
1783 | + | |
1784 | +#define XEN_DOMCTL_getpageframeinfo 7 | |
1785 | + | |
1786 | +#define XEN_DOMCTL_PFINFO_LTAB_SHIFT 28 | |
1787 | +#define XEN_DOMCTL_PFINFO_NOTAB (0x0U<<28) | |
1788 | +#define XEN_DOMCTL_PFINFO_L1TAB (0x1U<<28) | |
1789 | +#define XEN_DOMCTL_PFINFO_L2TAB (0x2U<<28) | |
1790 | +#define XEN_DOMCTL_PFINFO_L3TAB (0x3U<<28) | |
1791 | +#define XEN_DOMCTL_PFINFO_L4TAB (0x4U<<28) | |
1792 | +#define XEN_DOMCTL_PFINFO_LTABTYPE_MASK (0x7U<<28) | |
1793 | +#define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31) | |
1794 | +#define XEN_DOMCTL_PFINFO_XTAB (0xfU<<28) /* invalid page */ | |
1795 | +#define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28) | |
1796 | + | |
1797 | +struct xen_domctl_getpageframeinfo { | |
1798 | + /* IN variables. */ | |
1799 | + uint64_aligned_t gmfn; /* GMFN to query */ | |
1800 | + /* OUT variables. */ | |
1801 | + /* Is the page PINNED to a type? */ | |
1802 | + uint32_t type; /* see above type defs */ | |
1803 | +}; | |
1804 | +typedef struct xen_domctl_getpageframeinfo xen_domctl_getpageframeinfo_t; | |
1805 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo_t); | |
1806 | + | |
1807 | + | |
1808 | +#define XEN_DOMCTL_getpageframeinfo2 8 | |
1809 | +struct xen_domctl_getpageframeinfo2 { | |
1810 | + /* IN variables. */ | |
1811 | + uint64_aligned_t num; | |
1812 | + /* IN/OUT variables. */ | |
1813 | + XEN_GUEST_HANDLE_64(uint32) array; | |
1814 | +}; | |
1815 | +typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t; | |
1816 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t); | |
1817 | + | |
1818 | + | |
1819 | +/* | |
1820 | + * Control shadow pagetables operation | |
1821 | + */ | |
1822 | +#define XEN_DOMCTL_shadow_op 10 | |
1823 | + | |
1824 | +/* Disable shadow mode. */ | |
1825 | +#define XEN_DOMCTL_SHADOW_OP_OFF 0 | |
1826 | + | |
1827 | +/* Enable shadow mode (mode contains ORed XEN_DOMCTL_SHADOW_ENABLE_* flags). */ | |
1828 | +#define XEN_DOMCTL_SHADOW_OP_ENABLE 32 | |
1829 | + | |
1830 | +/* Log-dirty bitmap operations. */ | |
1831 | + /* Return the bitmap and clean internal copy for next round. */ | |
1832 | +#define XEN_DOMCTL_SHADOW_OP_CLEAN 11 | |
1833 | + /* Return the bitmap but do not modify internal copy. */ | |
1834 | +#define XEN_DOMCTL_SHADOW_OP_PEEK 12 | |
1835 | + | |
1836 | +/* Memory allocation accessors. */ | |
1837 | +#define XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION 30 | |
1838 | +#define XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION 31 | |
1839 | + | |
1840 | +/* Legacy enable operations. */ | |
1841 | + /* Equiv. to ENABLE with no mode flags. */ | |
1842 | +#define XEN_DOMCTL_SHADOW_OP_ENABLE_TEST 1 | |
1843 | + /* Equiv. to ENABLE with mode flag ENABLE_LOG_DIRTY. */ | |
1844 | +#define XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY 2 | |
1845 | + /* Equiv. to ENABLE with mode flags ENABLE_REFCOUNT and ENABLE_TRANSLATE. */ | |
1846 | +#define XEN_DOMCTL_SHADOW_OP_ENABLE_TRANSLATE 3 | |
1847 | + | |
1848 | +/* Mode flags for XEN_DOMCTL_SHADOW_OP_ENABLE. */ | |
1849 | + /* | |
1850 | + * Shadow pagetables are refcounted: guest does not use explicit mmu | |
1851 | + * operations nor write-protect its pagetables. | |
1852 | + */ | |
1853 | +#define XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT (1 << 1) | |
1854 | + /* | |
1855 | + * Log pages in a bitmap as they are dirtied. | |
1856 | + * Used for live relocation to determine which pages must be re-sent. | |
1857 | + */ | |
1858 | +#define XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY (1 << 2) | |
1859 | + /* | |
1860 | + * Automatically translate GPFNs into MFNs. | |
1861 | + */ | |
1862 | +#define XEN_DOMCTL_SHADOW_ENABLE_TRANSLATE (1 << 3) | |
1863 | + /* | |
1864 | + * Xen does not steal virtual address space from the guest. | |
1865 | + * Requires HVM support. | |
1866 | + */ | |
1867 | +#define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL (1 << 4) | |
1868 | + | |
1869 | +struct xen_domctl_shadow_op_stats { | |
1870 | + uint32_t fault_count; | |
1871 | + uint32_t dirty_count; | |
1872 | +}; | |
1873 | +typedef struct xen_domctl_shadow_op_stats xen_domctl_shadow_op_stats_t; | |
1874 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_stats_t); | |
1875 | + | |
1876 | +struct xen_domctl_shadow_op { | |
1877 | + /* IN variables. */ | |
1878 | + uint32_t op; /* XEN_DOMCTL_SHADOW_OP_* */ | |
1879 | + | |
1880 | + /* OP_ENABLE */ | |
1881 | + uint32_t mode; /* XEN_DOMCTL_SHADOW_ENABLE_* */ | |
1882 | + | |
1883 | + /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */ | |
1884 | + uint32_t mb; /* Shadow memory allocation in MB */ | |
1885 | + | |
1886 | + /* OP_PEEK / OP_CLEAN */ | |
1887 | + XEN_GUEST_HANDLE_64(uint8) dirty_bitmap; | |
1888 | + uint64_aligned_t pages; /* Size of buffer. Updated with actual size. */ | |
1889 | + struct xen_domctl_shadow_op_stats stats; | |
1890 | +}; | |
1891 | +typedef struct xen_domctl_shadow_op xen_domctl_shadow_op_t; | |
1892 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_t); | |
1893 | + | |
1894 | + | |
1895 | +#define XEN_DOMCTL_max_mem 11 | |
1896 | +struct xen_domctl_max_mem { | |
1897 | + /* IN variables. */ | |
1898 | + uint64_aligned_t max_memkb; | |
1899 | +}; | |
1900 | +typedef struct xen_domctl_max_mem xen_domctl_max_mem_t; | |
1901 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_mem_t); | |
1902 | + | |
1903 | + | |
1904 | +#define XEN_DOMCTL_setvcpucontext 12 | |
1905 | +#define XEN_DOMCTL_getvcpucontext 13 | |
1906 | +struct xen_domctl_vcpucontext { | |
1907 | + uint32_t vcpu; /* IN */ | |
1908 | + XEN_GUEST_HANDLE_64(vcpu_guest_context_t) ctxt; /* IN/OUT */ | |
1909 | +}; | |
1910 | +typedef struct xen_domctl_vcpucontext xen_domctl_vcpucontext_t; | |
1911 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpucontext_t); | |
1912 | + | |
1913 | + | |
1914 | +#define XEN_DOMCTL_getvcpuinfo 14 | |
1915 | +struct xen_domctl_getvcpuinfo { | |
1916 | + /* IN variables. */ | |
1917 | + uint32_t vcpu; | |
1918 | + /* OUT variables. */ | |
1919 | + uint8_t online; /* currently online (not hotplugged)? */ | |
1920 | + uint8_t blocked; /* blocked waiting for an event? */ | |
1921 | + uint8_t running; /* currently scheduled on its CPU? */ | |
1922 | + uint64_aligned_t cpu_time; /* total cpu time consumed (ns) */ | |
1923 | + uint32_t cpu; /* current mapping */ | |
1924 | +}; | |
1925 | +typedef struct xen_domctl_getvcpuinfo xen_domctl_getvcpuinfo_t; | |
1926 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t); | |
1927 | + | |
1928 | + | |
1929 | +/* Get/set which physical cpus a vcpu can execute on. */ | |
1930 | +#define XEN_DOMCTL_setvcpuaffinity 9 | |
1931 | +#define XEN_DOMCTL_getvcpuaffinity 25 | |
1932 | +struct xen_domctl_vcpuaffinity { | |
1933 | + uint32_t vcpu; /* IN */ | |
1934 | + struct xenctl_cpumap cpumap; /* IN/OUT */ | |
1935 | +}; | |
1936 | +typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t; | |
1937 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t); | |
1938 | + | |
1939 | + | |
1940 | +#define XEN_DOMCTL_max_vcpus 15 | |
1941 | +struct xen_domctl_max_vcpus { | |
1942 | + uint32_t max; /* maximum number of vcpus */ | |
1943 | +}; | |
1944 | +typedef struct xen_domctl_max_vcpus xen_domctl_max_vcpus_t; | |
1945 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t); | |
1946 | + | |
1947 | + | |
1948 | +#define XEN_DOMCTL_scheduler_op 16 | |
1949 | +/* Scheduler types. */ | |
1950 | +#define XEN_SCHEDULER_SEDF 4 | |
1951 | +#define XEN_SCHEDULER_CREDIT 5 | |
1952 | +/* Set or get info? */ | |
1953 | +#define XEN_DOMCTL_SCHEDOP_putinfo 0 | |
1954 | +#define XEN_DOMCTL_SCHEDOP_getinfo 1 | |
1955 | +struct xen_domctl_scheduler_op { | |
1956 | + uint32_t sched_id; /* XEN_SCHEDULER_* */ | |
1957 | + uint32_t cmd; /* XEN_DOMCTL_SCHEDOP_* */ | |
1958 | + union { | |
1959 | + struct xen_domctl_sched_sedf { | |
1960 | + uint64_aligned_t period; | |
1961 | + uint64_aligned_t slice; | |
1962 | + uint64_aligned_t latency; | |
1963 | + uint32_t extratime; | |
1964 | + uint32_t weight; | |
1965 | + } sedf; | |
1966 | + struct xen_domctl_sched_credit { | |
1967 | + uint16_t weight; | |
1968 | + uint16_t cap; | |
1969 | + } credit; | |
1970 | + } u; | |
1971 | +}; | |
1972 | +typedef struct xen_domctl_scheduler_op xen_domctl_scheduler_op_t; | |
1973 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_scheduler_op_t); | |
1974 | + | |
1975 | + | |
1976 | +#define XEN_DOMCTL_setdomainhandle 17 | |
1977 | +struct xen_domctl_setdomainhandle { | |
1978 | + xen_domain_handle_t handle; | |
1979 | +}; | |
1980 | +typedef struct xen_domctl_setdomainhandle xen_domctl_setdomainhandle_t; | |
1981 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdomainhandle_t); | |
1982 | + | |
1983 | + | |
1984 | +#define XEN_DOMCTL_setdebugging 18 | |
1985 | +struct xen_domctl_setdebugging { | |
1986 | + uint8_t enable; | |
1987 | +}; | |
1988 | +typedef struct xen_domctl_setdebugging xen_domctl_setdebugging_t; | |
1989 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdebugging_t); | |
1990 | + | |
1991 | + | |
1992 | +#define XEN_DOMCTL_irq_permission 19 | |
1993 | +struct xen_domctl_irq_permission { | |
1994 | + uint8_t pirq; | |
1995 | + uint8_t allow_access; /* flag to specify enable/disable of IRQ access */ | |
1996 | +}; | |
1997 | +typedef struct xen_domctl_irq_permission xen_domctl_irq_permission_t; | |
1998 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_irq_permission_t); | |
1999 | + | |
2000 | + | |
2001 | +#define XEN_DOMCTL_iomem_permission 20 | |
2002 | +struct xen_domctl_iomem_permission { | |
2003 | + uint64_aligned_t first_mfn;/* first page (physical page number) in range */ | |
2004 | + uint64_aligned_t nr_mfns; /* number of pages in range (>0) */ | |
2005 | + uint8_t allow_access; /* allow (!0) or deny (0) access to range? */ | |
2006 | +}; | |
2007 | +typedef struct xen_domctl_iomem_permission xen_domctl_iomem_permission_t; | |
2008 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_iomem_permission_t); | |
2009 | + | |
2010 | + | |
2011 | +#define XEN_DOMCTL_ioport_permission 21 | |
2012 | +struct xen_domctl_ioport_permission { | |
2013 | + uint32_t first_port; /* first port int range */ | |
2014 | + uint32_t nr_ports; /* size of port range */ | |
2015 | + uint8_t allow_access; /* allow or deny access to range? */ | |
2016 | +}; | |
2017 | +typedef struct xen_domctl_ioport_permission xen_domctl_ioport_permission_t; | |
2018 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_permission_t); | |
2019 | + | |
2020 | + | |
2021 | +#define XEN_DOMCTL_hypercall_init 22 | |
2022 | +struct xen_domctl_hypercall_init { | |
2023 | + uint64_aligned_t gmfn; /* GMFN to be initialised */ | |
2024 | +}; | |
2025 | +typedef struct xen_domctl_hypercall_init xen_domctl_hypercall_init_t; | |
2026 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t); | |
2027 | + | |
2028 | + | |
2029 | +#define XEN_DOMCTL_arch_setup 23 | |
2030 | +#define _XEN_DOMAINSETUP_hvm_guest 0 | |
2031 | +#define XEN_DOMAINSETUP_hvm_guest (1UL<<_XEN_DOMAINSETUP_hvm_guest) | |
2032 | +#define _XEN_DOMAINSETUP_query 1 /* Get parameters (for save) */ | |
2033 | +#define XEN_DOMAINSETUP_query (1UL<<_XEN_DOMAINSETUP_query) | |
2034 | +#define _XEN_DOMAINSETUP_sioemu_guest 2 | |
2035 | +#define XEN_DOMAINSETUP_sioemu_guest (1UL<<_XEN_DOMAINSETUP_sioemu_guest) | |
2036 | +typedef struct xen_domctl_arch_setup { | |
2037 | + uint64_aligned_t flags; /* XEN_DOMAINSETUP_* */ | |
2038 | +#ifdef __ia64__ | |
2039 | + uint64_aligned_t bp; /* mpaddr of boot param area */ | |
2040 | + uint64_aligned_t maxmem; /* Highest memory address for MDT. */ | |
2041 | + uint64_aligned_t xsi_va; /* Xen shared_info area virtual address. */ | |
2042 | + uint32_t hypercall_imm; /* Break imm for Xen hypercalls. */ | |
2043 | + int8_t vhpt_size_log2; /* Log2 of VHPT size. */ | |
2044 | +#endif | |
2045 | +} xen_domctl_arch_setup_t; | |
2046 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t); | |
2047 | + | |
2048 | + | |
2049 | +#define XEN_DOMCTL_settimeoffset 24 | |
2050 | +struct xen_domctl_settimeoffset { | |
2051 | + int32_t time_offset_seconds; /* applied to domain wallclock time */ | |
2052 | +}; | |
2053 | +typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t; | |
2054 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t); | |
2055 | + | |
2056 | + | |
2057 | +#define XEN_DOMCTL_gethvmcontext 33 | |
2058 | +#define XEN_DOMCTL_sethvmcontext 34 | |
2059 | +typedef struct xen_domctl_hvmcontext { | |
2060 | + uint32_t size; /* IN/OUT: size of buffer / bytes filled */ | |
2061 | + XEN_GUEST_HANDLE_64(uint8) buffer; /* IN/OUT: data, or call | |
2062 | + * gethvmcontext with NULL | |
2063 | + * buffer to get size req'd */ | |
2064 | +} xen_domctl_hvmcontext_t; | |
2065 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_t); | |
2066 | + | |
2067 | + | |
2068 | +#define XEN_DOMCTL_set_address_size 35 | |
2069 | +#define XEN_DOMCTL_get_address_size 36 | |
2070 | +typedef struct xen_domctl_address_size { | |
2071 | + uint32_t size; | |
2072 | +} xen_domctl_address_size_t; | |
2073 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_address_size_t); | |
2074 | + | |
2075 | + | |
2076 | +#define XEN_DOMCTL_real_mode_area 26 | |
2077 | +struct xen_domctl_real_mode_area { | |
2078 | + uint32_t log; /* log2 of Real Mode Area size */ | |
2079 | +}; | |
2080 | +typedef struct xen_domctl_real_mode_area xen_domctl_real_mode_area_t; | |
2081 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_real_mode_area_t); | |
2082 | + | |
2083 | + | |
2084 | +#define XEN_DOMCTL_sendtrigger 28 | |
2085 | +#define XEN_DOMCTL_SENDTRIGGER_NMI 0 | |
2086 | +#define XEN_DOMCTL_SENDTRIGGER_RESET 1 | |
2087 | +#define XEN_DOMCTL_SENDTRIGGER_INIT 2 | |
2088 | +struct xen_domctl_sendtrigger { | |
2089 | + uint32_t trigger; /* IN */ | |
2090 | + uint32_t vcpu; /* IN */ | |
2091 | +}; | |
2092 | +typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t; | |
2093 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t); | |
2094 | + | |
2095 | + | |
2096 | +/* Assign PCI device to HVM guest. Sets up IOMMU structures. */ | |
2097 | +#define XEN_DOMCTL_assign_device 37 | |
2098 | +#define XEN_DOMCTL_test_assign_device 45 | |
2099 | +#define XEN_DOMCTL_deassign_device 47 | |
2100 | +struct xen_domctl_assign_device { | |
2101 | + uint32_t machine_bdf; /* machine PCI ID of assigned device */ | |
2102 | +}; | |
2103 | +typedef struct xen_domctl_assign_device xen_domctl_assign_device_t; | |
2104 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t); | |
2105 | + | |
2106 | +/* Retrieve sibling devices infomation of machine_bdf */ | |
2107 | +#define XEN_DOMCTL_get_device_group 50 | |
2108 | +struct xen_domctl_get_device_group { | |
2109 | + uint32_t machine_bdf; /* IN */ | |
2110 | + uint32_t max_sdevs; /* IN */ | |
2111 | + uint32_t num_sdevs; /* OUT */ | |
2112 | + XEN_GUEST_HANDLE_64(uint32) sdev_array; /* OUT */ | |
2113 | +}; | |
2114 | +typedef struct xen_domctl_get_device_group xen_domctl_get_device_group_t; | |
2115 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_get_device_group_t); | |
2116 | + | |
2117 | +/* Pass-through interrupts: bind real irq -> hvm devfn. */ | |
2118 | +#define XEN_DOMCTL_bind_pt_irq 38 | |
2119 | +#define XEN_DOMCTL_unbind_pt_irq 48 | |
2120 | +typedef enum pt_irq_type_e { | |
2121 | + PT_IRQ_TYPE_PCI, | |
2122 | + PT_IRQ_TYPE_ISA, | |
2123 | + PT_IRQ_TYPE_MSI, | |
2124 | +} pt_irq_type_t; | |
2125 | +struct xen_domctl_bind_pt_irq { | |
2126 | + uint32_t machine_irq; | |
2127 | + pt_irq_type_t irq_type; | |
2128 | + uint32_t hvm_domid; | |
2129 | + | |
2130 | + union { | |
2131 | + struct { | |
2132 | + uint8_t isa_irq; | |
2133 | + } isa; | |
2134 | + struct { | |
2135 | + uint8_t bus; | |
2136 | + uint8_t device; | |
2137 | + uint8_t intx; | |
2138 | + } pci; | |
2139 | + struct { | |
2140 | + uint8_t gvec; | |
2141 | + uint32_t gflags; | |
2142 | + } msi; | |
2143 | + } u; | |
2144 | +}; | |
2145 | +typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t; | |
2146 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_pt_irq_t); | |
2147 | + | |
2148 | + | |
2149 | +/* Bind machine I/O address range -> HVM address range. */ | |
2150 | +#define XEN_DOMCTL_memory_mapping 39 | |
2151 | +#define DPCI_ADD_MAPPING 1 | |
2152 | +#define DPCI_REMOVE_MAPPING 0 | |
2153 | +struct xen_domctl_memory_mapping { | |
2154 | + uint64_aligned_t first_gfn; /* first page (hvm guest phys page) in range */ | |
2155 | + uint64_aligned_t first_mfn; /* first page (machine page) in range */ | |
2156 | + uint64_aligned_t nr_mfns; /* number of pages in range (>0) */ | |
2157 | + uint32_t add_mapping; /* add or remove mapping */ | |
2158 | + uint32_t padding; /* padding for 64-bit aligned structure */ | |
2159 | +}; | |
2160 | +typedef struct xen_domctl_memory_mapping xen_domctl_memory_mapping_t; | |
2161 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_memory_mapping_t); | |
2162 | + | |
2163 | + | |
2164 | +/* Bind machine I/O port range -> HVM I/O port range. */ | |
2165 | +#define XEN_DOMCTL_ioport_mapping 40 | |
2166 | +struct xen_domctl_ioport_mapping { | |
2167 | + uint32_t first_gport; /* first guest IO port*/ | |
2168 | + uint32_t first_mport; /* first machine IO port */ | |
2169 | + uint32_t nr_ports; /* size of port range */ | |
2170 | + uint32_t add_mapping; /* add or remove mapping */ | |
2171 | +}; | |
2172 | +typedef struct xen_domctl_ioport_mapping xen_domctl_ioport_mapping_t; | |
2173 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_mapping_t); | |
2174 | + | |
2175 | + | |
2176 | +/* | |
2177 | + * Pin caching type of RAM space for x86 HVM domU. | |
2178 | + */ | |
2179 | +#define XEN_DOMCTL_pin_mem_cacheattr 41 | |
2180 | +/* Caching types: these happen to be the same as x86 MTRR/PAT type codes. */ | |
2181 | +#define XEN_DOMCTL_MEM_CACHEATTR_UC 0 | |
2182 | +#define XEN_DOMCTL_MEM_CACHEATTR_WC 1 | |
2183 | +#define XEN_DOMCTL_MEM_CACHEATTR_WT 4 | |
2184 | +#define XEN_DOMCTL_MEM_CACHEATTR_WP 5 | |
2185 | +#define XEN_DOMCTL_MEM_CACHEATTR_WB 6 | |
2186 | +#define XEN_DOMCTL_MEM_CACHEATTR_UCM 7 | |
2187 | +struct xen_domctl_pin_mem_cacheattr { | |
2188 | + uint64_aligned_t start, end; | |
2189 | + unsigned int type; /* XEN_DOMCTL_MEM_CACHEATTR_* */ | |
2190 | +}; | |
2191 | +typedef struct xen_domctl_pin_mem_cacheattr xen_domctl_pin_mem_cacheattr_t; | |
2192 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_pin_mem_cacheattr_t); | |
2193 | + | |
2194 | + | |
2195 | +#define XEN_DOMCTL_set_ext_vcpucontext 42 | |
2196 | +#define XEN_DOMCTL_get_ext_vcpucontext 43 | |
2197 | +struct xen_domctl_ext_vcpucontext { | |
2198 | + /* IN: VCPU that this call applies to. */ | |
2199 | + uint32_t vcpu; | |
2200 | + /* | |
2201 | + * SET: Size of struct (IN) | |
2202 | + * GET: Size of struct (OUT) | |
2203 | + */ | |
2204 | + uint32_t size; | |
2205 | +#if defined(__i386__) || defined(__x86_64__) | |
2206 | + /* SYSCALL from 32-bit mode and SYSENTER callback information. */ | |
2207 | + /* NB. SYSCALL from 64-bit mode is contained in vcpu_guest_context_t */ | |
2208 | + uint64_aligned_t syscall32_callback_eip; | |
2209 | + uint64_aligned_t sysenter_callback_eip; | |
2210 | + uint16_t syscall32_callback_cs; | |
2211 | + uint16_t sysenter_callback_cs; | |
2212 | + uint8_t syscall32_disables_events; | |
2213 | + uint8_t sysenter_disables_events; | |
2214 | +#endif | |
2215 | +}; | |
2216 | +typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t; | |
2217 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_ext_vcpucontext_t); | |
2218 | + | |
2219 | +/* | |
2220 | + * Set optimizaton features for a domain | |
2221 | + */ | |
2222 | +#define XEN_DOMCTL_set_opt_feature 44 | |
2223 | +struct xen_domctl_set_opt_feature { | |
2224 | +#if defined(__ia64__) | |
2225 | + struct xen_ia64_opt_feature optf; | |
2226 | +#else | |
2227 | + /* Make struct non-empty: do not depend on this field name! */ | |
2228 | + uint64_t dummy; | |
2229 | +#endif | |
2230 | +}; | |
2231 | +typedef struct xen_domctl_set_opt_feature xen_domctl_set_opt_feature_t; | |
2232 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_opt_feature_t); | |
2233 | + | |
2234 | +/* | |
2235 | + * Set the target domain for a domain | |
2236 | + */ | |
2237 | +#define XEN_DOMCTL_set_target 46 | |
2238 | +struct xen_domctl_set_target { | |
2239 | + domid_t target; | |
2240 | +}; | |
2241 | +typedef struct xen_domctl_set_target xen_domctl_set_target_t; | |
2242 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_target_t); | |
2243 | + | |
2244 | +#if defined(__i386__) || defined(__x86_64__) | |
2245 | +# define XEN_CPUID_INPUT_UNUSED 0xFFFFFFFF | |
2246 | +# define XEN_DOMCTL_set_cpuid 49 | |
2247 | +struct xen_domctl_cpuid { | |
2248 | + unsigned int input[2]; | |
2249 | + unsigned int eax; | |
2250 | + unsigned int ebx; | |
2251 | + unsigned int ecx; | |
2252 | + unsigned int edx; | |
2253 | +}; | |
2254 | +typedef struct xen_domctl_cpuid xen_domctl_cpuid_t; | |
2255 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_cpuid_t); | |
2256 | +#endif | |
2257 | + | |
2258 | +#define XEN_DOMCTL_subscribe 29 | |
2259 | +struct xen_domctl_subscribe { | |
2260 | + uint32_t port; /* IN */ | |
2261 | +}; | |
2262 | +typedef struct xen_domctl_subscribe xen_domctl_subscribe_t; | |
2263 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_subscribe_t); | |
2264 | + | |
2265 | +/* | |
2266 | + * Define the maximum machine address size which should be allocated | |
2267 | + * to a guest. | |
2268 | + */ | |
2269 | +#define XEN_DOMCTL_set_machine_address_size 51 | |
2270 | +#define XEN_DOMCTL_get_machine_address_size 52 | |
2271 | + | |
2272 | +/* | |
2273 | + * Do not inject spurious page faults into this domain. | |
2274 | + */ | |
2275 | +#define XEN_DOMCTL_suppress_spurious_page_faults 53 | |
2276 | + | |
2277 | +struct xen_domctl { | |
2278 | + uint32_t cmd; | |
2279 | + uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */ | |
2280 | + domid_t domain; | |
2281 | + union { | |
2282 | + struct xen_domctl_createdomain createdomain; | |
2283 | + struct xen_domctl_getdomaininfo getdomaininfo; | |
2284 | + struct xen_domctl_getmemlist getmemlist; | |
2285 | + struct xen_domctl_getpageframeinfo getpageframeinfo; | |
2286 | + struct xen_domctl_getpageframeinfo2 getpageframeinfo2; | |
2287 | + struct xen_domctl_vcpuaffinity vcpuaffinity; | |
2288 | + struct xen_domctl_shadow_op shadow_op; | |
2289 | + struct xen_domctl_max_mem max_mem; | |
2290 | + struct xen_domctl_vcpucontext vcpucontext; | |
2291 | + struct xen_domctl_getvcpuinfo getvcpuinfo; | |
2292 | + struct xen_domctl_max_vcpus max_vcpus; | |
2293 | + struct xen_domctl_scheduler_op scheduler_op; | |
2294 | + struct xen_domctl_setdomainhandle setdomainhandle; | |
2295 | + struct xen_domctl_setdebugging setdebugging; | |
2296 | + struct xen_domctl_irq_permission irq_permission; | |
2297 | + struct xen_domctl_iomem_permission iomem_permission; | |
2298 | + struct xen_domctl_ioport_permission ioport_permission; | |
2299 | + struct xen_domctl_hypercall_init hypercall_init; | |
2300 | + struct xen_domctl_arch_setup arch_setup; | |
2301 | + struct xen_domctl_settimeoffset settimeoffset; | |
2302 | + struct xen_domctl_real_mode_area real_mode_area; | |
2303 | + struct xen_domctl_hvmcontext hvmcontext; | |
2304 | + struct xen_domctl_address_size address_size; | |
2305 | + struct xen_domctl_sendtrigger sendtrigger; | |
2306 | + struct xen_domctl_get_device_group get_device_group; | |
2307 | + struct xen_domctl_assign_device assign_device; | |
2308 | + struct xen_domctl_bind_pt_irq bind_pt_irq; | |
2309 | + struct xen_domctl_memory_mapping memory_mapping; | |
2310 | + struct xen_domctl_ioport_mapping ioport_mapping; | |
2311 | + struct xen_domctl_pin_mem_cacheattr pin_mem_cacheattr; | |
2312 | + struct xen_domctl_ext_vcpucontext ext_vcpucontext; | |
2313 | + struct xen_domctl_set_opt_feature set_opt_feature; | |
2314 | + struct xen_domctl_set_target set_target; | |
2315 | + struct xen_domctl_subscribe subscribe; | |
2316 | +#if defined(__i386__) || defined(__x86_64__) | |
2317 | + struct xen_domctl_cpuid cpuid; | |
2318 | +#endif | |
2319 | + uint8_t pad[128]; | |
2320 | + } u; | |
2321 | +}; | |
2322 | +typedef struct xen_domctl xen_domctl_t; | |
2323 | +DEFINE_XEN_GUEST_HANDLE(xen_domctl_t); | |
2324 | + | |
2325 | +#endif /* __XEN_PUBLIC_DOMCTL_H__ */ | |
2326 | + | |
2327 | +/* | |
2328 | + * Local variables: | |
2329 | + * mode: C | |
2330 | + * c-set-style: "BSD" | |
2331 | + * c-basic-offset: 4 | |
2332 | + * tab-width: 4 | |
2333 | + * indent-tabs-mode: nil | |
2334 | + * End: | |
2335 | + */ | |
2336 | Index: head-2008-11-25/include/xen/interface/hvm/e820.h | |
2337 | =================================================================== | |
2338 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
2339 | +++ head-2008-11-25/include/xen/interface/hvm/e820.h 2007-06-12 13:14:19.000000000 +0200 | |
2340 | @@ -0,0 +1,34 @@ | |
2341 | + | |
2342 | +/* | |
2343 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
2344 | + * of this software and associated documentation files (the "Software"), to | |
2345 | + * deal in the Software without restriction, including without limitation the | |
2346 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
2347 | + * sell copies of the Software, and to permit persons to whom the Software is | |
2348 | + * furnished to do so, subject to the following conditions: | |
2349 | + * | |
2350 | + * The above copyright notice and this permission notice shall be included in | |
2351 | + * all copies or substantial portions of the Software. | |
2352 | + * | |
2353 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
2354 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
2355 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
2356 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
2357 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
2358 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
2359 | + * DEALINGS IN THE SOFTWARE. | |
2360 | + */ | |
2361 | + | |
2362 | +#ifndef __XEN_PUBLIC_HVM_E820_H__ | |
2363 | +#define __XEN_PUBLIC_HVM_E820_H__ | |
2364 | + | |
2365 | +/* E820 location in HVM virtual address space. */ | |
2366 | +#define HVM_E820_PAGE 0x00090000 | |
2367 | +#define HVM_E820_NR_OFFSET 0x000001E8 | |
2368 | +#define HVM_E820_OFFSET 0x000002D0 | |
2369 | + | |
2370 | +#define HVM_BELOW_4G_RAM_END 0xF0000000 | |
2371 | +#define HVM_BELOW_4G_MMIO_START HVM_BELOW_4G_RAM_END | |
2372 | +#define HVM_BELOW_4G_MMIO_LENGTH ((1ULL << 32) - HVM_BELOW_4G_MMIO_START) | |
2373 | + | |
2374 | +#endif /* __XEN_PUBLIC_HVM_E820_H__ */ | |
2375 | Index: head-2008-11-25/include/xen/interface/hvm/hvm_info_table.h | |
2376 | =================================================================== | |
2377 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
2378 | +++ head-2008-11-25/include/xen/interface/hvm/hvm_info_table.h 2007-06-12 13:14:19.000000000 +0200 | |
2379 | @@ -0,0 +1,41 @@ | |
2380 | +/****************************************************************************** | |
2381 | + * hvm/hvm_info_table.h | |
2382 | + * | |
2383 | + * HVM parameter and information table, written into guest memory map. | |
2384 | + * | |
2385 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
2386 | + * of this software and associated documentation files (the "Software"), to | |
2387 | + * deal in the Software without restriction, including without limitation the | |
2388 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
2389 | + * sell copies of the Software, and to permit persons to whom the Software is | |
2390 | + * furnished to do so, subject to the following conditions: | |
2391 | + * | |
2392 | + * The above copyright notice and this permission notice shall be included in | |
2393 | + * all copies or substantial portions of the Software. | |
2394 | + * | |
2395 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
2396 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
2397 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
2398 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
2399 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
2400 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
2401 | + * DEALINGS IN THE SOFTWARE. | |
2402 | + */ | |
2403 | + | |
2404 | +#ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ | |
2405 | +#define __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ | |
2406 | + | |
2407 | +#define HVM_INFO_PFN 0x09F | |
2408 | +#define HVM_INFO_OFFSET 0x800 | |
2409 | +#define HVM_INFO_PADDR ((HVM_INFO_PFN << 12) + HVM_INFO_OFFSET) | |
2410 | + | |
2411 | +struct hvm_info_table { | |
2412 | + char signature[8]; /* "HVM INFO" */ | |
2413 | + uint32_t length; | |
2414 | + uint8_t checksum; | |
2415 | + uint8_t acpi_enabled; | |
2416 | + uint8_t apic_mode; | |
2417 | + uint32_t nr_vcpus; | |
2418 | +}; | |
2419 | + | |
2420 | +#endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */ | |
2421 | Index: head-2008-11-25/include/xen/interface/hvm/hvm_op.h | |
2422 | =================================================================== | |
2423 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
2424 | +++ head-2008-11-25/include/xen/interface/hvm/hvm_op.h 2008-09-01 12:07:31.000000000 +0200 | |
2425 | @@ -0,0 +1,131 @@ | |
2426 | +/* | |
2427 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
2428 | + * of this software and associated documentation files (the "Software"), to | |
2429 | + * deal in the Software without restriction, including without limitation the | |
2430 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
2431 | + * sell copies of the Software, and to permit persons to whom the Software is | |
2432 | + * furnished to do so, subject to the following conditions: | |
2433 | + * | |
2434 | + * The above copyright notice and this permission notice shall be included in | |
2435 | + * all copies or substantial portions of the Software. | |
2436 | + * | |
2437 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
2438 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
2439 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
2440 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
2441 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
2442 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
2443 | + * DEALINGS IN THE SOFTWARE. | |
2444 | + */ | |
2445 | + | |
2446 | +#ifndef __XEN_PUBLIC_HVM_HVM_OP_H__ | |
2447 | +#define __XEN_PUBLIC_HVM_HVM_OP_H__ | |
2448 | + | |
2449 | +/* Get/set subcommands: extra argument == pointer to xen_hvm_param struct. */ | |
2450 | +#define HVMOP_set_param 0 | |
2451 | +#define HVMOP_get_param 1 | |
2452 | +struct xen_hvm_param { | |
2453 | + domid_t domid; /* IN */ | |
2454 | + uint32_t index; /* IN */ | |
2455 | + uint64_t value; /* IN/OUT */ | |
2456 | +}; | |
2457 | +typedef struct xen_hvm_param xen_hvm_param_t; | |
2458 | +DEFINE_XEN_GUEST_HANDLE(xen_hvm_param_t); | |
2459 | + | |
2460 | +/* Set the logical level of one of a domain's PCI INTx wires. */ | |
2461 | +#define HVMOP_set_pci_intx_level 2 | |
2462 | +struct xen_hvm_set_pci_intx_level { | |
2463 | + /* Domain to be updated. */ | |
2464 | + domid_t domid; | |
2465 | + /* PCI INTx identification in PCI topology (domain:bus:device:intx). */ | |
2466 | + uint8_t domain, bus, device, intx; | |
2467 | + /* Assertion level (0 = unasserted, 1 = asserted). */ | |
2468 | + uint8_t level; | |
2469 | +}; | |
2470 | +typedef struct xen_hvm_set_pci_intx_level xen_hvm_set_pci_intx_level_t; | |
2471 | +DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_intx_level_t); | |
2472 | + | |
2473 | +/* Set the logical level of one of a domain's ISA IRQ wires. */ | |
2474 | +#define HVMOP_set_isa_irq_level 3 | |
2475 | +struct xen_hvm_set_isa_irq_level { | |
2476 | + /* Domain to be updated. */ | |
2477 | + domid_t domid; | |
2478 | + /* ISA device identification, by ISA IRQ (0-15). */ | |
2479 | + uint8_t isa_irq; | |
2480 | + /* Assertion level (0 = unasserted, 1 = asserted). */ | |
2481 | + uint8_t level; | |
2482 | +}; | |
2483 | +typedef struct xen_hvm_set_isa_irq_level xen_hvm_set_isa_irq_level_t; | |
2484 | +DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_isa_irq_level_t); | |
2485 | + | |
2486 | +#define HVMOP_set_pci_link_route 4 | |
2487 | +struct xen_hvm_set_pci_link_route { | |
2488 | + /* Domain to be updated. */ | |
2489 | + domid_t domid; | |
2490 | + /* PCI link identifier (0-3). */ | |
2491 | + uint8_t link; | |
2492 | + /* ISA IRQ (1-15), or 0 (disable link). */ | |
2493 | + uint8_t isa_irq; | |
2494 | +}; | |
2495 | +typedef struct xen_hvm_set_pci_link_route xen_hvm_set_pci_link_route_t; | |
2496 | +DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_link_route_t); | |
2497 | + | |
2498 | +/* Flushes all VCPU TLBs: @arg must be NULL. */ | |
2499 | +#define HVMOP_flush_tlbs 5 | |
2500 | + | |
2501 | +/* Following tools-only interfaces may change in future. */ | |
2502 | +#if defined(__XEN__) || defined(__XEN_TOOLS__) | |
2503 | + | |
2504 | +/* Track dirty VRAM. */ | |
2505 | +#define HVMOP_track_dirty_vram 6 | |
2506 | +struct xen_hvm_track_dirty_vram { | |
2507 | + /* Domain to be tracked. */ | |
2508 | + domid_t domid; | |
2509 | + /* First pfn to track. */ | |
2510 | + uint64_aligned_t first_pfn; | |
2511 | + /* Number of pages to track. */ | |
2512 | + uint64_aligned_t nr; | |
2513 | + /* OUT variable. */ | |
2514 | + /* Dirty bitmap buffer. */ | |
2515 | + XEN_GUEST_HANDLE_64(uint8) dirty_bitmap; | |
2516 | +}; | |
2517 | +typedef struct xen_hvm_track_dirty_vram xen_hvm_track_dirty_vram_t; | |
2518 | +DEFINE_XEN_GUEST_HANDLE(xen_hvm_track_dirty_vram_t); | |
2519 | + | |
2520 | +/* Notify that some pages got modified by the Device Model. */ | |
2521 | +#define HVMOP_modified_memory 7 | |
2522 | +struct xen_hvm_modified_memory { | |
2523 | + /* Domain to be updated. */ | |
2524 | + domid_t domid; | |
2525 | + /* First pfn. */ | |
2526 | + uint64_aligned_t first_pfn; | |
2527 | + /* Number of pages. */ | |
2528 | + uint64_aligned_t nr; | |
2529 | +}; | |
2530 | +typedef struct xen_hvm_modified_memory xen_hvm_modified_memory_t; | |
2531 | +DEFINE_XEN_GUEST_HANDLE(xen_hvm_modified_memory_t); | |
2532 | + | |
2533 | +#define HVMOP_set_mem_type 8 | |
2534 | +typedef enum { | |
2535 | + HVMMEM_ram_rw, /* Normal read/write guest RAM */ | |
2536 | + HVMMEM_ram_ro, /* Read-only; writes are discarded */ | |
2537 | + HVMMEM_mmio_dm, /* Reads and write go to the device model */ | |
2538 | +} hvmmem_type_t; | |
2539 | +/* Notify that a region of memory is to be treated in a specific way. */ | |
2540 | +struct xen_hvm_set_mem_type { | |
2541 | + /* Domain to be updated. */ | |
2542 | + domid_t domid; | |
2543 | + /* Memory type */ | |
2544 | + hvmmem_type_t hvmmem_type; | |
2545 | + /* First pfn. */ | |
2546 | + uint64_aligned_t first_pfn; | |
2547 | + /* Number of pages. */ | |
2548 | + uint64_aligned_t nr; | |
2549 | +}; | |
2550 | +typedef struct xen_hvm_set_mem_type xen_hvm_set_mem_type_t; | |
2551 | +DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_mem_type_t); | |
2552 | + | |
2553 | + | |
2554 | +#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ | |
2555 | + | |
2556 | +#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */ | |
2557 | Index: head-2008-11-25/include/xen/interface/hvm/ioreq.h | |
2558 | =================================================================== | |
2559 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
2560 | +++ head-2008-11-25/include/xen/interface/hvm/ioreq.h 2008-04-02 12:34:02.000000000 +0200 | |
2561 | @@ -0,0 +1,127 @@ | |
2562 | +/* | |
2563 | + * ioreq.h: I/O request definitions for device models | |
2564 | + * Copyright (c) 2004, Intel Corporation. | |
2565 | + * | |
2566 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
2567 | + * of this software and associated documentation files (the "Software"), to | |
2568 | + * deal in the Software without restriction, including without limitation the | |
2569 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
2570 | + * sell copies of the Software, and to permit persons to whom the Software is | |
2571 | + * furnished to do so, subject to the following conditions: | |
2572 | + * | |
2573 | + * The above copyright notice and this permission notice shall be included in | |
2574 | + * all copies or substantial portions of the Software. | |
2575 | + * | |
2576 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
2577 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
2578 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
2579 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
2580 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
2581 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
2582 | + * DEALINGS IN THE SOFTWARE. | |
2583 | + */ | |
2584 | + | |
2585 | +#ifndef _IOREQ_H_ | |
2586 | +#define _IOREQ_H_ | |
2587 | + | |
2588 | +#define IOREQ_READ 1 | |
2589 | +#define IOREQ_WRITE 0 | |
2590 | + | |
2591 | +#define STATE_IOREQ_NONE 0 | |
2592 | +#define STATE_IOREQ_READY 1 | |
2593 | +#define STATE_IOREQ_INPROCESS 2 | |
2594 | +#define STATE_IORESP_READY 3 | |
2595 | + | |
2596 | +#define IOREQ_TYPE_PIO 0 /* pio */ | |
2597 | +#define IOREQ_TYPE_COPY 1 /* mmio ops */ | |
2598 | +#define IOREQ_TYPE_TIMEOFFSET 7 | |
2599 | +#define IOREQ_TYPE_INVALIDATE 8 /* mapcache */ | |
2600 | + | |
2601 | +/* | |
2602 | + * VMExit dispatcher should cooperate with instruction decoder to | |
2603 | + * prepare this structure and notify service OS and DM by sending | |
2604 | + * virq | |
2605 | + */ | |
2606 | +struct ioreq { | |
2607 | + uint64_t addr; /* physical address */ | |
2608 | + uint64_t size; /* size in bytes */ | |
2609 | + uint64_t count; /* for rep prefixes */ | |
2610 | + uint64_t data; /* data (or paddr of data) */ | |
2611 | + uint8_t state:4; | |
2612 | + uint8_t data_is_ptr:1; /* if 1, data above is the guest paddr | |
2613 | + * of the real data to use. */ | |
2614 | + uint8_t dir:1; /* 1=read, 0=write */ | |
2615 | + uint8_t df:1; | |
2616 | + uint8_t pad:1; | |
2617 | + uint8_t type; /* I/O type */ | |
2618 | + uint8_t _pad0[6]; | |
2619 | + uint64_t io_count; /* How many IO done on a vcpu */ | |
2620 | +}; | |
2621 | +typedef struct ioreq ioreq_t; | |
2622 | + | |
2623 | +struct vcpu_iodata { | |
2624 | + struct ioreq vp_ioreq; | |
2625 | + /* Event channel port, used for notifications to/from the device model. */ | |
2626 | + uint32_t vp_eport; | |
2627 | + uint32_t _pad0; | |
2628 | +}; | |
2629 | +typedef struct vcpu_iodata vcpu_iodata_t; | |
2630 | + | |
2631 | +struct shared_iopage { | |
2632 | + struct vcpu_iodata vcpu_iodata[1]; | |
2633 | +}; | |
2634 | +typedef struct shared_iopage shared_iopage_t; | |
2635 | + | |
2636 | +struct buf_ioreq { | |
2637 | + uint8_t type; /* I/O type */ | |
2638 | + uint8_t pad:1; | |
2639 | + uint8_t dir:1; /* 1=read, 0=write */ | |
2640 | + uint8_t size:2; /* 0=>1, 1=>2, 2=>4, 3=>8. If 8, use two buf_ioreqs */ | |
2641 | + uint32_t addr:20;/* physical address */ | |
2642 | + uint32_t data; /* data */ | |
2643 | +}; | |
2644 | +typedef struct buf_ioreq buf_ioreq_t; | |
2645 | + | |
2646 | +#define IOREQ_BUFFER_SLOT_NUM 511 /* 8 bytes each, plus 2 4-byte indexes */ | |
2647 | +struct buffered_iopage { | |
2648 | + unsigned int read_pointer; | |
2649 | + unsigned int write_pointer; | |
2650 | + buf_ioreq_t buf_ioreq[IOREQ_BUFFER_SLOT_NUM]; | |
2651 | +}; /* NB. Size of this structure must be no greater than one page. */ | |
2652 | +typedef struct buffered_iopage buffered_iopage_t; | |
2653 | + | |
2654 | +#if defined(__ia64__) | |
2655 | +struct pio_buffer { | |
2656 | + uint32_t page_offset; | |
2657 | + uint32_t pointer; | |
2658 | + uint32_t data_end; | |
2659 | + uint32_t buf_size; | |
2660 | + void *opaque; | |
2661 | +}; | |
2662 | + | |
2663 | +#define PIO_BUFFER_IDE_PRIMARY 0 /* I/O port = 0x1F0 */ | |
2664 | +#define PIO_BUFFER_IDE_SECONDARY 1 /* I/O port = 0x170 */ | |
2665 | +#define PIO_BUFFER_ENTRY_NUM 2 | |
2666 | +struct buffered_piopage { | |
2667 | + struct pio_buffer pio[PIO_BUFFER_ENTRY_NUM]; | |
2668 | + uint8_t buffer[1]; | |
2669 | +}; | |
2670 | +#endif /* defined(__ia64__) */ | |
2671 | + | |
2672 | +#define ACPI_PM1A_EVT_BLK_ADDRESS 0x0000000000001f40 | |
2673 | +#define ACPI_PM1A_CNT_BLK_ADDRESS (ACPI_PM1A_EVT_BLK_ADDRESS + 0x04) | |
2674 | +#define ACPI_PM_TMR_BLK_ADDRESS (ACPI_PM1A_EVT_BLK_ADDRESS + 0x08) | |
2675 | +#define ACPI_GPE0_BLK_ADDRESS (ACPI_PM_TMR_BLK_ADDRESS + 0x20) | |
2676 | +#define ACPI_GPE0_BLK_LEN 0x08 | |
2677 | + | |
2678 | +#endif /* _IOREQ_H_ */ | |
2679 | + | |
2680 | +/* | |
2681 | + * Local variables: | |
2682 | + * mode: C | |
2683 | + * c-set-style: "BSD" | |
2684 | + * c-basic-offset: 4 | |
2685 | + * tab-width: 4 | |
2686 | + * indent-tabs-mode: nil | |
2687 | + * End: | |
2688 | + */ | |
2689 | Index: head-2008-11-25/include/xen/interface/hvm/params.h | |
2690 | =================================================================== | |
2691 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
2692 | +++ head-2008-11-25/include/xen/interface/hvm/params.h 2008-10-29 09:55:56.000000000 +0100 | |
2693 | @@ -0,0 +1,105 @@ | |
2694 | +/* | |
2695 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
2696 | + * of this software and associated documentation files (the "Software"), to | |
2697 | + * deal in the Software without restriction, including without limitation the | |
2698 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
2699 | + * sell copies of the Software, and to permit persons to whom the Software is | |
2700 | + * furnished to do so, subject to the following conditions: | |
2701 | + * | |
2702 | + * The above copyright notice and this permission notice shall be included in | |
2703 | + * all copies or substantial portions of the Software. | |
2704 | + * | |
2705 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
2706 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
2707 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
2708 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
2709 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
2710 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
2711 | + * DEALINGS IN THE SOFTWARE. | |
2712 | + */ | |
2713 | + | |
2714 | +#ifndef __XEN_PUBLIC_HVM_PARAMS_H__ | |
2715 | +#define __XEN_PUBLIC_HVM_PARAMS_H__ | |
2716 | + | |
2717 | +#include "hvm_op.h" | |
2718 | + | |
2719 | +/* | |
2720 | + * Parameter space for HVMOP_{set,get}_param. | |
2721 | + */ | |
2722 | + | |
2723 | +/* | |
2724 | + * How should CPU0 event-channel notifications be delivered? | |
2725 | + * val[63:56] == 0: val[55:0] is a delivery GSI (Global System Interrupt). | |
2726 | + * val[63:56] == 1: val[55:0] is a delivery PCI INTx line, as follows: | |
2727 | + * Domain = val[47:32], Bus = val[31:16], | |
2728 | + * DevFn = val[15: 8], IntX = val[ 1: 0] | |
2729 | + * If val == 0 then CPU0 event-channel notifications are not delivered. | |
2730 | + */ | |
2731 | +#define HVM_PARAM_CALLBACK_IRQ 0 | |
2732 | + | |
2733 | +/* | |
2734 | + * These are not used by Xen. They are here for convenience of HVM-guest | |
2735 | + * xenbus implementations. | |
2736 | + */ | |
2737 | +#define HVM_PARAM_STORE_PFN 1 | |
2738 | +#define HVM_PARAM_STORE_EVTCHN 2 | |
2739 | + | |
2740 | +#define HVM_PARAM_PAE_ENABLED 4 | |
2741 | + | |
2742 | +#define HVM_PARAM_IOREQ_PFN 5 | |
2743 | + | |
2744 | +#define HVM_PARAM_BUFIOREQ_PFN 6 | |
2745 | + | |
2746 | +#ifdef __ia64__ | |
2747 | + | |
2748 | +#define HVM_PARAM_NVRAM_FD 7 | |
2749 | +#define HVM_PARAM_VHPT_SIZE 8 | |
2750 | +#define HVM_PARAM_BUFPIOREQ_PFN 9 | |
2751 | + | |
2752 | +#elif defined(__i386__) || defined(__x86_64__) | |
2753 | + | |
2754 | +/* Expose Viridian interfaces to this HVM guest? */ | |
2755 | +#define HVM_PARAM_VIRIDIAN 9 | |
2756 | + | |
2757 | +#endif | |
2758 | + | |
2759 | +/* | |
2760 | + * Set mode for virtual timers (currently x86 only): | |
2761 | + * delay_for_missed_ticks (default): | |
2762 | + * Do not advance a vcpu's time beyond the correct delivery time for | |
2763 | + * interrupts that have been missed due to preemption. Deliver missed | |
2764 | + * interrupts when the vcpu is rescheduled and advance the vcpu's virtual | |
2765 | + * time stepwise for each one. | |
2766 | + * no_delay_for_missed_ticks: | |
2767 | + * As above, missed interrupts are delivered, but guest time always tracks | |
2768 | + * wallclock (i.e., real) time while doing so. | |
2769 | + * no_missed_ticks_pending: | |
2770 | + * No missed interrupts are held pending. Instead, to ensure ticks are | |
2771 | + * delivered at some non-zero rate, if we detect missed ticks then the | |
2772 | + * internal tick alarm is not disabled if the VCPU is preempted during the | |
2773 | + * next tick period. | |
2774 | + * one_missed_tick_pending: | |
2775 | + * Missed interrupts are collapsed together and delivered as one 'late tick'. | |
2776 | + * Guest time always tracks wallclock (i.e., real) time. | |
2777 | + */ | |
2778 | +#define HVM_PARAM_TIMER_MODE 10 | |
2779 | +#define HVMPTM_delay_for_missed_ticks 0 | |
2780 | +#define HVMPTM_no_delay_for_missed_ticks 1 | |
2781 | +#define HVMPTM_no_missed_ticks_pending 2 | |
2782 | +#define HVMPTM_one_missed_tick_pending 3 | |
2783 | + | |
2784 | +/* Boolean: Enable virtual HPET (high-precision event timer)? (x86-only) */ | |
2785 | +#define HVM_PARAM_HPET_ENABLED 11 | |
2786 | + | |
2787 | +/* Identity-map page directory used by Intel EPT when CR0.PG=0. */ | |
2788 | +#define HVM_PARAM_IDENT_PT 12 | |
2789 | + | |
2790 | +/* Device Model domain, defaults to 0. */ | |
2791 | +#define HVM_PARAM_DM_DOMAIN 13 | |
2792 | + | |
2793 | +/* ACPI S state: currently support S0 and S3 on x86. */ | |
2794 | +#define HVM_PARAM_ACPI_S_STATE 14 | |
2795 | + | |
2796 | +#define HVM_NR_PARAMS 15 | |
2797 | + | |
2798 | +#endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */ | |
2799 | Index: head-2008-11-25/include/xen/interface/hvm/save.h | |
2800 | =================================================================== | |
2801 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
2802 | +++ head-2008-11-25/include/xen/interface/hvm/save.h 2008-04-02 12:34:02.000000000 +0200 | |
2803 | @@ -0,0 +1,88 @@ | |
2804 | +/* | |
2805 | + * hvm/save.h | |
2806 | + * | |
2807 | + * Structure definitions for HVM state that is held by Xen and must | |
2808 | + * be saved along with the domain's memory and device-model state. | |
2809 | + * | |
2810 | + * Copyright (c) 2007 XenSource Ltd. | |
2811 | + * | |
2812 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
2813 | + * of this software and associated documentation files (the "Software"), to | |
2814 | + * deal in the Software without restriction, including without limitation the | |
2815 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
2816 | + * sell copies of the Software, and to permit persons to whom the Software is | |
2817 | + * furnished to do so, subject to the following conditions: | |
2818 | + * | |
2819 | + * The above copyright notice and this permission notice shall be included in | |
2820 | + * all copies or substantial portions of the Software. | |
2821 | + * | |
2822 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
2823 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
2824 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
2825 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
2826 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
2827 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
2828 | + * DEALINGS IN THE SOFTWARE. | |
2829 | + */ | |
2830 | + | |
2831 | +#ifndef __XEN_PUBLIC_HVM_SAVE_H__ | |
2832 | +#define __XEN_PUBLIC_HVM_SAVE_H__ | |
2833 | + | |
2834 | +/* | |
2835 | + * Structures in this header *must* have the same layout in 32bit | |
2836 | + * and 64bit environments: this means that all fields must be explicitly | |
2837 | + * sized types and aligned to their sizes, and the structs must be | |
2838 | + * a multiple of eight bytes long. | |
2839 | + * | |
2840 | + * Only the state necessary for saving and restoring (i.e. fields | |
2841 | + * that are analogous to actual hardware state) should go in this file. | |
2842 | + * Internal mechanisms should be kept in Xen-private headers. | |
2843 | + */ | |
2844 | + | |
2845 | +#if !defined(__GNUC__) || defined(__STRICT_ANSI__) | |
2846 | +#error "Anonymous structs/unions are a GNU extension." | |
2847 | +#endif | |
2848 | + | |
2849 | +/* | |
2850 | + * Each entry is preceded by a descriptor giving its type and length | |
2851 | + */ | |
2852 | +struct hvm_save_descriptor { | |
2853 | + uint16_t typecode; /* Used to demux the various types below */ | |
2854 | + uint16_t instance; /* Further demux within a type */ | |
2855 | + uint32_t length; /* In bytes, *not* including this descriptor */ | |
2856 | +}; | |
2857 | + | |
2858 | + | |
2859 | +/* | |
2860 | + * Each entry has a datatype associated with it: for example, the CPU state | |
2861 | + * is saved as a HVM_SAVE_TYPE(CPU), which has HVM_SAVE_LENGTH(CPU), | |
2862 | + * and is identified by a descriptor with typecode HVM_SAVE_CODE(CPU). | |
2863 | + * DECLARE_HVM_SAVE_TYPE binds these things together with some type-system | |
2864 | + * ugliness. | |
2865 | + */ | |
2866 | + | |
2867 | +#define DECLARE_HVM_SAVE_TYPE(_x, _code, _type) \ | |
2868 | + struct __HVM_SAVE_TYPE_##_x { _type t; char c[_code]; } | |
2869 | + | |
2870 | +#define HVM_SAVE_TYPE(_x) typeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->t) | |
2871 | +#define HVM_SAVE_LENGTH(_x) (sizeof (HVM_SAVE_TYPE(_x))) | |
2872 | +#define HVM_SAVE_CODE(_x) (sizeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->c)) | |
2873 | + | |
2874 | + | |
2875 | +/* | |
2876 | + * The series of save records is teminated by a zero-type, zero-length | |
2877 | + * descriptor. | |
2878 | + */ | |
2879 | + | |
2880 | +struct hvm_save_end {}; | |
2881 | +DECLARE_HVM_SAVE_TYPE(END, 0, struct hvm_save_end); | |
2882 | + | |
2883 | +#if defined(__i386__) || defined(__x86_64__) | |
2884 | +#include "../arch-x86/hvm/save.h" | |
2885 | +#elif defined(__ia64__) | |
2886 | +#include "../arch-ia64/hvm/save.h" | |
2887 | +#else | |
2888 | +#error "unsupported architecture" | |
2889 | +#endif | |
2890 | + | |
2891 | +#endif /* __XEN_PUBLIC_HVM_SAVE_H__ */ | |
2892 | Index: head-2008-11-25/include/xen/interface/io/fsif.h | |
2893 | =================================================================== | |
2894 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
2895 | +++ head-2008-11-25/include/xen/interface/io/fsif.h 2008-09-01 12:07:31.000000000 +0200 | |
2896 | @@ -0,0 +1,191 @@ | |
2897 | +/****************************************************************************** | |
2898 | + * fsif.h | |
2899 | + * | |
2900 | + * Interface to FS level split device drivers. | |
2901 | + * | |
2902 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
2903 | + * of this software and associated documentation files (the "Software"), to | |
2904 | + * deal in the Software without restriction, including without limitation the | |
2905 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
2906 | + * sell copies of the Software, and to permit persons to whom the Software is | |
2907 | + * furnished to do so, subject to the following conditions: | |
2908 | + * | |
2909 | + * The above copyright notice and this permission notice shall be included in | |
2910 | + * all copies or substantial portions of the Software. | |
2911 | + * | |
2912 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
2913 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
2914 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
2915 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
2916 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
2917 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
2918 | + * DEALINGS IN THE SOFTWARE. | |
2919 | + * | |
2920 | + * Copyright (c) 2007, Grzegorz Milos, <gm281@cam.ac.uk>. | |
2921 | + */ | |
2922 | + | |
2923 | +#ifndef __XEN_PUBLIC_IO_FSIF_H__ | |
2924 | +#define __XEN_PUBLIC_IO_FSIF_H__ | |
2925 | + | |
2926 | +#include "ring.h" | |
2927 | +#include "../grant_table.h" | |
2928 | + | |
2929 | +#define REQ_FILE_OPEN 1 | |
2930 | +#define REQ_FILE_CLOSE 2 | |
2931 | +#define REQ_FILE_READ 3 | |
2932 | +#define REQ_FILE_WRITE 4 | |
2933 | +#define REQ_STAT 5 | |
2934 | +#define REQ_FILE_TRUNCATE 6 | |
2935 | +#define REQ_REMOVE 7 | |
2936 | +#define REQ_RENAME 8 | |
2937 | +#define REQ_CREATE 9 | |
2938 | +#define REQ_DIR_LIST 10 | |
2939 | +#define REQ_CHMOD 11 | |
2940 | +#define REQ_FS_SPACE 12 | |
2941 | +#define REQ_FILE_SYNC 13 | |
2942 | + | |
2943 | +struct fsif_open_request { | |
2944 | + grant_ref_t gref; | |
2945 | +}; | |
2946 | + | |
2947 | +struct fsif_close_request { | |
2948 | + uint32_t fd; | |
2949 | +}; | |
2950 | + | |
2951 | +struct fsif_read_request { | |
2952 | + uint32_t fd; | |
2953 | + int32_t pad; | |
2954 | + uint64_t len; | |
2955 | + uint64_t offset; | |
2956 | + grant_ref_t grefs[1]; /* Variable length */ | |
2957 | +}; | |
2958 | + | |
2959 | +struct fsif_write_request { | |
2960 | + uint32_t fd; | |
2961 | + int32_t pad; | |
2962 | + uint64_t len; | |
2963 | + uint64_t offset; | |
2964 | + grant_ref_t grefs[1]; /* Variable length */ | |
2965 | +}; | |
2966 | + | |
2967 | +struct fsif_stat_request { | |
2968 | + uint32_t fd; | |
2969 | +}; | |
2970 | + | |
2971 | +/* This structure is a copy of some fields from stat structure, returned | |
2972 | + * via the ring. */ | |
2973 | +struct fsif_stat_response { | |
2974 | + int32_t stat_mode; | |
2975 | + uint32_t stat_uid; | |
2976 | + uint32_t stat_gid; | |
2977 | + int32_t stat_ret; | |
2978 | + int64_t stat_size; | |
2979 | + int64_t stat_atime; | |
2980 | + int64_t stat_mtime; | |
2981 | + int64_t stat_ctime; | |
2982 | +}; | |
2983 | + | |
2984 | +struct fsif_truncate_request { | |
2985 | + uint32_t fd; | |
2986 | + int32_t pad; | |
2987 | + int64_t length; | |
2988 | +}; | |
2989 | + | |
2990 | +struct fsif_remove_request { | |
2991 | + grant_ref_t gref; | |
2992 | +}; | |
2993 | + | |
2994 | +struct fsif_rename_request { | |
2995 | + uint16_t old_name_offset; | |
2996 | + uint16_t new_name_offset; | |
2997 | + grant_ref_t gref; | |
2998 | +}; | |
2999 | + | |
3000 | +struct fsif_create_request { | |
3001 | + int8_t directory; | |
3002 | + int8_t pad; | |
3003 | + int16_t pad2; | |
3004 | + int32_t mode; | |
3005 | + grant_ref_t gref; | |
3006 | +}; | |
3007 | + | |
3008 | +struct fsif_list_request { | |
3009 | + uint32_t offset; | |
3010 | + grant_ref_t gref; | |
3011 | +}; | |
3012 | + | |
3013 | +#define NR_FILES_SHIFT 0 | |
3014 | +#define NR_FILES_SIZE 16 /* 16 bits for the number of files mask */ | |
3015 | +#define NR_FILES_MASK (((1ULL << NR_FILES_SIZE) - 1) << NR_FILES_SHIFT) | |
3016 | +#define ERROR_SIZE 32 /* 32 bits for the error mask */ | |
3017 | +#define ERROR_SHIFT (NR_FILES_SIZE + NR_FILES_SHIFT) | |
3018 | +#define ERROR_MASK (((1ULL << ERROR_SIZE) - 1) << ERROR_SHIFT) | |
3019 | +#define HAS_MORE_SHIFT (ERROR_SHIFT + ERROR_SIZE) | |
3020 | +#define HAS_MORE_FLAG (1ULL << HAS_MORE_SHIFT) | |
3021 | + | |
3022 | +struct fsif_chmod_request { | |
3023 | + uint32_t fd; | |
3024 | + int32_t mode; | |
3025 | +}; | |
3026 | + | |
3027 | +struct fsif_space_request { | |
3028 | + grant_ref_t gref; | |
3029 | +}; | |
3030 | + | |
3031 | +struct fsif_sync_request { | |
3032 | + uint32_t fd; | |
3033 | +}; | |
3034 | + | |
3035 | + | |
3036 | +/* FS operation request */ | |
3037 | +struct fsif_request { | |
3038 | + uint8_t type; /* Type of the request */ | |
3039 | + uint8_t pad; | |
3040 | + uint16_t id; /* Request ID, copied to the response */ | |
3041 | + uint32_t pad2; | |
3042 | + union { | |
3043 | + struct fsif_open_request fopen; | |
3044 | + struct fsif_close_request fclose; | |
3045 | + struct fsif_read_request fread; | |
3046 | + struct fsif_write_request fwrite; | |
3047 | + struct fsif_stat_request fstat; | |
3048 | + struct fsif_truncate_request ftruncate; | |
3049 | + struct fsif_remove_request fremove; | |
3050 | + struct fsif_rename_request frename; | |
3051 | + struct fsif_create_request fcreate; | |
3052 | + struct fsif_list_request flist; | |
3053 | + struct fsif_chmod_request fchmod; | |
3054 | + struct fsif_space_request fspace; | |
3055 | + struct fsif_sync_request fsync; | |
3056 | + } u; | |
3057 | +}; | |
3058 | +typedef struct fsif_request fsif_request_t; | |
3059 | + | |
3060 | +/* FS operation response */ | |
3061 | +struct fsif_response { | |
3062 | + uint16_t id; | |
3063 | + uint16_t pad1; | |
3064 | + uint32_t pad2; | |
3065 | + union { | |
3066 | + uint64_t ret_val; | |
3067 | + struct fsif_stat_response fstat; | |
3068 | + }; | |
3069 | +}; | |
3070 | + | |
3071 | +typedef struct fsif_response fsif_response_t; | |
3072 | + | |
3073 | +#define FSIF_RING_ENTRY_SIZE 64 | |
3074 | + | |
3075 | +#define FSIF_NR_READ_GNTS ((FSIF_RING_ENTRY_SIZE - sizeof(struct fsif_read_request)) / \ | |
3076 | + sizeof(grant_ref_t) + 1) | |
3077 | +#define FSIF_NR_WRITE_GNTS ((FSIF_RING_ENTRY_SIZE - sizeof(struct fsif_write_request)) / \ | |
3078 | + sizeof(grant_ref_t) + 1) | |
3079 | + | |
3080 | +DEFINE_RING_TYPES(fsif, struct fsif_request, struct fsif_response); | |
3081 | + | |
3082 | +#define STATE_INITIALISED "init" | |
3083 | +#define STATE_READY "ready" | |
3084 | + | |
3085 | + | |
3086 | + | |
3087 | +#endif | |
3088 | Index: head-2008-11-25/include/xen/interface/io/pciif.h | |
3089 | =================================================================== | |
3090 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
3091 | +++ head-2008-11-25/include/xen/interface/io/pciif.h 2008-07-21 11:00:33.000000000 +0200 | |
3092 | @@ -0,0 +1,101 @@ | |
3093 | +/* | |
3094 | + * PCI Backend/Frontend Common Data Structures & Macros | |
3095 | + * | |
3096 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
3097 | + * of this software and associated documentation files (the "Software"), to | |
3098 | + * deal in the Software without restriction, including without limitation the | |
3099 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
3100 | + * sell copies of the Software, and to permit persons to whom the Software is | |
3101 | + * furnished to do so, subject to the following conditions: | |
3102 | + * | |
3103 | + * The above copyright notice and this permission notice shall be included in | |
3104 | + * all copies or substantial portions of the Software. | |
3105 | + * | |
3106 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
3107 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
3108 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
3109 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
3110 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
3111 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
3112 | + * DEALINGS IN THE SOFTWARE. | |
3113 | + * | |
3114 | + * Author: Ryan Wilson <hap9@epoch.ncsc.mil> | |
3115 | + */ | |
3116 | +#ifndef __XEN_PCI_COMMON_H__ | |
3117 | +#define __XEN_PCI_COMMON_H__ | |
3118 | + | |
3119 | +/* Be sure to bump this number if you change this file */ | |
3120 | +#define XEN_PCI_MAGIC "7" | |
3121 | + | |
3122 | +/* xen_pci_sharedinfo flags */ | |
3123 | +#define _XEN_PCIF_active (0) | |
3124 | +#define XEN_PCIF_active (1<<_XEN_PCI_active) | |
3125 | + | |
3126 | +/* xen_pci_op commands */ | |
3127 | +#define XEN_PCI_OP_conf_read (0) | |
3128 | +#define XEN_PCI_OP_conf_write (1) | |
3129 | +#define XEN_PCI_OP_enable_msi (2) | |
3130 | +#define XEN_PCI_OP_disable_msi (3) | |
3131 | +#define XEN_PCI_OP_enable_msix (4) | |
3132 | +#define XEN_PCI_OP_disable_msix (5) | |
3133 | + | |
3134 | +/* xen_pci_op error numbers */ | |
3135 | +#define XEN_PCI_ERR_success (0) | |
3136 | +#define XEN_PCI_ERR_dev_not_found (-1) | |
3137 | +#define XEN_PCI_ERR_invalid_offset (-2) | |
3138 | +#define XEN_PCI_ERR_access_denied (-3) | |
3139 | +#define XEN_PCI_ERR_not_implemented (-4) | |
3140 | +/* XEN_PCI_ERR_op_failed - backend failed to complete the operation */ | |
3141 | +#define XEN_PCI_ERR_op_failed (-5) | |
3142 | + | |
3143 | +/* | |
3144 | + * it should be PAGE_SIZE-sizeof(struct xen_pci_op))/sizeof(struct msix_entry)) | |
3145 | + * Should not exceed 128 | |
3146 | + */ | |
3147 | +#define SH_INFO_MAX_VEC 128 | |
3148 | + | |
3149 | +struct xen_msix_entry { | |
3150 | + uint16_t vector; | |
3151 | + uint16_t entry; | |
3152 | +}; | |
3153 | +struct xen_pci_op { | |
3154 | + /* IN: what action to perform: XEN_PCI_OP_* */ | |
3155 | + uint32_t cmd; | |
3156 | + | |
3157 | + /* OUT: will contain an error number (if any) from errno.h */ | |
3158 | + int32_t err; | |
3159 | + | |
3160 | + /* IN: which device to touch */ | |
3161 | + uint32_t domain; /* PCI Domain/Segment */ | |
3162 | + uint32_t bus; | |
3163 | + uint32_t devfn; | |
3164 | + | |
3165 | + /* IN: which configuration registers to touch */ | |
3166 | + int32_t offset; | |
3167 | + int32_t size; | |
3168 | + | |
3169 | + /* IN/OUT: Contains the result after a READ or the value to WRITE */ | |
3170 | + uint32_t value; | |
3171 | + /* IN: Contains extra infor for this operation */ | |
3172 | + uint32_t info; | |
3173 | + /*IN: param for msi-x */ | |
3174 | + struct xen_msix_entry msix_entries[SH_INFO_MAX_VEC]; | |
3175 | +}; | |
3176 | + | |
3177 | +struct xen_pci_sharedinfo { | |
3178 | + /* flags - XEN_PCIF_* */ | |
3179 | + uint32_t flags; | |
3180 | + struct xen_pci_op op; | |
3181 | +}; | |
3182 | + | |
3183 | +#endif /* __XEN_PCI_COMMON_H__ */ | |
3184 | + | |
3185 | +/* | |
3186 | + * Local variables: | |
3187 | + * mode: C | |
3188 | + * c-set-style: "BSD" | |
3189 | + * c-basic-offset: 4 | |
3190 | + * tab-width: 4 | |
3191 | + * indent-tabs-mode: nil | |
3192 | + * End: | |
3193 | + */ | |
3194 | Index: head-2008-11-25/include/xen/interface/io/tpmif.h | |
3195 | =================================================================== | |
3196 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
3197 | +++ head-2008-11-25/include/xen/interface/io/tpmif.h 2007-06-12 13:14:19.000000000 +0200 | |
3198 | @@ -0,0 +1,77 @@ | |
3199 | +/****************************************************************************** | |
3200 | + * tpmif.h | |
3201 | + * | |
3202 | + * TPM I/O interface for Xen guest OSes. | |
3203 | + * | |
3204 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
3205 | + * of this software and associated documentation files (the "Software"), to | |
3206 | + * deal in the Software without restriction, including without limitation the | |
3207 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
3208 | + * sell copies of the Software, and to permit persons to whom the Software is | |
3209 | + * furnished to do so, subject to the following conditions: | |
3210 | + * | |
3211 | + * The above copyright notice and this permission notice shall be included in | |
3212 | + * all copies or substantial portions of the Software. | |
3213 | + * | |
3214 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
3215 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
3216 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
3217 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
3218 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
3219 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
3220 | + * DEALINGS IN THE SOFTWARE. | |
3221 | + * | |
3222 | + * Copyright (c) 2005, IBM Corporation | |
3223 | + * | |
3224 | + * Author: Stefan Berger, stefanb@us.ibm.com | |
3225 | + * Grant table support: Mahadevan Gomathisankaran | |
3226 | + * | |
3227 | + * This code has been derived from tools/libxc/xen/io/netif.h | |
3228 | + * | |
3229 | + * Copyright (c) 2003-2004, Keir Fraser | |
3230 | + */ | |
3231 | + | |
3232 | +#ifndef __XEN_PUBLIC_IO_TPMIF_H__ | |
3233 | +#define __XEN_PUBLIC_IO_TPMIF_H__ | |
3234 | + | |
3235 | +#include "../grant_table.h" | |
3236 | + | |
3237 | +struct tpmif_tx_request { | |
3238 | + unsigned long addr; /* Machine address of packet. */ | |
3239 | + grant_ref_t ref; /* grant table access reference */ | |
3240 | + uint16_t unused; | |
3241 | + uint16_t size; /* Packet size in bytes. */ | |
3242 | +}; | |
3243 | +typedef struct tpmif_tx_request tpmif_tx_request_t; | |
3244 | + | |
3245 | +/* | |
3246 | + * The TPMIF_TX_RING_SIZE defines the number of pages the | |
3247 | + * front-end and backend can exchange (= size of array). | |
3248 | + */ | |
3249 | +typedef uint32_t TPMIF_RING_IDX; | |
3250 | + | |
3251 | +#define TPMIF_TX_RING_SIZE 1 | |
3252 | + | |
3253 | +/* This structure must fit in a memory page. */ | |
3254 | + | |
3255 | +struct tpmif_ring { | |
3256 | + struct tpmif_tx_request req; | |
3257 | +}; | |
3258 | +typedef struct tpmif_ring tpmif_ring_t; | |
3259 | + | |
3260 | +struct tpmif_tx_interface { | |
3261 | + struct tpmif_ring ring[TPMIF_TX_RING_SIZE]; | |
3262 | +}; | |
3263 | +typedef struct tpmif_tx_interface tpmif_tx_interface_t; | |
3264 | + | |
3265 | +#endif | |
3266 | + | |
3267 | +/* | |
3268 | + * Local variables: | |
3269 | + * mode: C | |
3270 | + * c-set-style: "BSD" | |
3271 | + * c-basic-offset: 4 | |
3272 | + * tab-width: 4 | |
3273 | + * indent-tabs-mode: nil | |
3274 | + * End: | |
3275 | + */ | |
3276 | Index: head-2008-11-25/include/xen/interface/io/vscsiif.h | |
3277 | =================================================================== | |
3278 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
3279 | +++ head-2008-11-25/include/xen/interface/io/vscsiif.h 2008-07-21 11:00:33.000000000 +0200 | |
3280 | @@ -0,0 +1,105 @@ | |
3281 | +/****************************************************************************** | |
3282 | + * vscsiif.h | |
3283 | + * | |
3284 | + * Based on the blkif.h code. | |
3285 | + * | |
3286 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
3287 | + * of this software and associated documentation files (the "Software"), to | |
3288 | + * deal in the Software without restriction, including without limitation the | |
3289 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
3290 | + * sell copies of the Software, and to permit persons to whom the Software is | |
3291 | + * furnished to do so, subject to the following conditions: | |
3292 | + * | |
3293 | + * The above copyright notice and this permission notice shall be included in | |
3294 | + * all copies or substantial portions of the Software. | |
3295 | + * | |
3296 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
3297 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
3298 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
3299 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
3300 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
3301 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
3302 | + * DEALINGS IN THE SOFTWARE. | |
3303 | + * | |
3304 | + * Copyright(c) FUJITSU Limited 2008. | |
3305 | + */ | |
3306 | + | |
3307 | +#ifndef __XEN__PUBLIC_IO_SCSI_H__ | |
3308 | +#define __XEN__PUBLIC_IO_SCSI_H__ | |
3309 | + | |
3310 | +#include "ring.h" | |
3311 | +#include "../grant_table.h" | |
3312 | + | |
3313 | +/* command between backend and frontend */ | |
3314 | +#define VSCSIIF_ACT_SCSI_CDB 1 /* SCSI CDB command */ | |
3315 | +#define VSCSIIF_ACT_SCSI_ABORT 2 /* SCSI Device(Lun) Abort*/ | |
3316 | +#define VSCSIIF_ACT_SCSI_RESET 3 /* SCSI Device(Lun) Reset*/ | |
3317 | + | |
3318 | + | |
3319 | +#define VSCSIIF_BACK_MAX_PENDING_REQS 128 | |
3320 | + | |
3321 | +/* | |
3322 | + * Maximum scatter/gather segments per request. | |
3323 | + * | |
3324 | + * Considering balance between allocating al least 16 "vscsiif_request" | |
3325 | + * structures on one page (4096bytes) and number of scatter gather | |
3326 | + * needed, we decided to use 26 as a magic number. | |
3327 | + */ | |
3328 | +#define VSCSIIF_SG_TABLESIZE 26 | |
3329 | + | |
3330 | +/* | |
3331 | + * base on linux kernel 2.6.18 | |
3332 | + */ | |
3333 | +#define VSCSIIF_MAX_COMMAND_SIZE 16 | |
3334 | +#define VSCSIIF_SENSE_BUFFERSIZE 96 | |
3335 | + | |
3336 | + | |
3337 | +struct vscsiif_request { | |
3338 | + uint16_t rqid; /* private guest value, echoed in resp */ | |
3339 | + uint8_t act; /* command between backend and frontend */ | |
3340 | + uint8_t cmd_len; | |
3341 | + | |
3342 | + uint8_t cmnd[VSCSIIF_MAX_COMMAND_SIZE]; | |
3343 | + uint16_t timeout_per_command; /* The command is issued by twice | |
3344 | + the value in Backend. */ | |
3345 | + uint16_t channel, id, lun; | |
3346 | + uint16_t padding; | |
3347 | + uint8_t sc_data_direction; /* for DMA_TO_DEVICE(1) | |
3348 | + DMA_FROM_DEVICE(2) | |
3349 | + DMA_NONE(3) requests */ | |
3350 | + uint8_t nr_segments; /* Number of pieces of scatter-gather */ | |
3351 | + | |
3352 | + struct scsiif_request_segment { | |
3353 | + grant_ref_t gref; | |
3354 | + uint16_t offset; | |
3355 | + uint16_t length; | |
3356 | + } seg[VSCSIIF_SG_TABLESIZE]; | |
3357 | + uint32_t reserved[3]; | |
3358 | +}; | |
3359 | +typedef struct vscsiif_request vscsiif_request_t; | |
3360 | + | |
3361 | +struct vscsiif_response { | |
3362 | + uint16_t rqid; | |
3363 | + uint8_t padding; | |
3364 | + uint8_t sense_len; | |
3365 | + uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE]; | |
3366 | + int32_t rslt; | |
3367 | + uint32_t residual_len; /* request bufflen - | |
3368 | + return the value from physical device */ | |
3369 | + uint32_t reserved[36]; | |
3370 | +}; | |
3371 | +typedef struct vscsiif_response vscsiif_response_t; | |
3372 | + | |
3373 | +DEFINE_RING_TYPES(vscsiif, struct vscsiif_request, struct vscsiif_response); | |
3374 | + | |
3375 | + | |
3376 | +#endif /*__XEN__PUBLIC_IO_SCSI_H__*/ | |
3377 | +/* | |
3378 | + * Local variables: | |
3379 | + * mode: C | |
3380 | + * c-set-style: "BSD" | |
3381 | + * c-basic-offset: 4 | |
3382 | + * tab-width: 4 | |
3383 | + * indent-tabs-mode: nil | |
3384 | + * End: | |
3385 | + */ | |
3386 | Index: head-2008-11-25/include/xen/interface/kexec.h | |
3387 | =================================================================== | |
3388 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
3389 | +++ head-2008-11-25/include/xen/interface/kexec.h 2008-11-25 12:22:34.000000000 +0100 | |
3390 | @@ -0,0 +1,168 @@ | |
3391 | +/****************************************************************************** | |
3392 | + * kexec.h - Public portion | |
3393 | + * | |
3394 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
3395 | + * of this software and associated documentation files (the "Software"), to | |
3396 | + * deal in the Software without restriction, including without limitation the | |
3397 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
3398 | + * sell copies of the Software, and to permit persons to whom the Software is | |
3399 | + * furnished to do so, subject to the following conditions: | |
3400 | + * | |
3401 | + * The above copyright notice and this permission notice shall be included in | |
3402 | + * all copies or substantial portions of the Software. | |
3403 | + * | |
3404 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
3405 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
3406 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
3407 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
3408 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
3409 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
3410 | + * DEALINGS IN THE SOFTWARE. | |
3411 | + * | |
3412 | + * Xen port written by: | |
3413 | + * - Simon 'Horms' Horman <horms@verge.net.au> | |
3414 | + * - Magnus Damm <magnus@valinux.co.jp> | |
3415 | + */ | |
3416 | + | |
3417 | +#ifndef _XEN_PUBLIC_KEXEC_H | |
3418 | +#define _XEN_PUBLIC_KEXEC_H | |
3419 | + | |
3420 | + | |
3421 | +/* This file describes the Kexec / Kdump hypercall interface for Xen. | |
3422 | + * | |
3423 | + * Kexec under vanilla Linux allows a user to reboot the physical machine | |
3424 | + * into a new user-specified kernel. The Xen port extends this idea | |
3425 | + * to allow rebooting of the machine from dom0. When kexec for dom0 | |
3426 | + * is used to reboot, both the hypervisor and the domains get replaced | |
3427 | + * with some other kernel. It is possible to kexec between vanilla | |
3428 | + * Linux and Xen and back again. Xen to Xen works well too. | |
3429 | + * | |
3430 | + * The hypercall interface for kexec can be divided into three main | |
3431 | + * types of hypercall operations: | |
3432 | + * | |
3433 | + * 1) Range information: | |
3434 | + * This is used by the dom0 kernel to ask the hypervisor about various | |
3435 | + * address information. This information is needed to allow kexec-tools | |
3436 | + * to fill in the ELF headers for /proc/vmcore properly. | |
3437 | + * | |
3438 | + * 2) Load and unload of images: | |
3439 | + * There are no big surprises here, the kexec binary from kexec-tools | |
3440 | + * runs in userspace in dom0. The tool loads/unloads data into the | |
3441 | + * dom0 kernel such as new kernel, initramfs and hypervisor. When | |
3442 | + * loaded the dom0 kernel performs a load hypercall operation, and | |
3443 | + * before releasing all page references the dom0 kernel calls unload. | |
3444 | + * | |
3445 | + * 3) Kexec operation: | |
3446 | + * This is used to start a previously loaded kernel. | |
3447 | + */ | |
3448 | + | |
3449 | +#include "xen.h" | |
3450 | + | |
3451 | +#if defined(__i386__) || defined(__x86_64__) | |
3452 | +#define KEXEC_XEN_NO_PAGES 17 | |
3453 | +#endif | |
3454 | + | |
3455 | +/* | |
3456 | + * Prototype for this hypercall is: | |
3457 | + * int kexec_op(int cmd, void *args) | |
3458 | + * @cmd == KEXEC_CMD_... | |
3459 | + * KEXEC operation to perform | |
3460 | + * @args == Operation-specific extra arguments (NULL if none). | |
3461 | + */ | |
3462 | + | |
3463 | +/* | |
3464 | + * Kexec supports two types of operation: | |
3465 | + * - kexec into a regular kernel, very similar to a standard reboot | |
3466 | + * - KEXEC_TYPE_DEFAULT is used to specify this type | |
3467 | + * - kexec into a special "crash kernel", aka kexec-on-panic | |
3468 | + * - KEXEC_TYPE_CRASH is used to specify this type | |
3469 | + * - parts of our system may be broken at kexec-on-panic time | |
3470 | + * - the code should be kept as simple and self-contained as possible | |
3471 | + */ | |
3472 | + | |
3473 | +#define KEXEC_TYPE_DEFAULT 0 | |
3474 | +#define KEXEC_TYPE_CRASH 1 | |
3475 | + | |
3476 | + | |
3477 | +/* The kexec implementation for Xen allows the user to load two | |
3478 | + * types of kernels, KEXEC_TYPE_DEFAULT and KEXEC_TYPE_CRASH. | |
3479 | + * All data needed for a kexec reboot is kept in one xen_kexec_image_t | |
3480 | + * per "instance". The data mainly consists of machine address lists to pages | |
3481 | + * together with destination addresses. The data in xen_kexec_image_t | |
3482 | + * is passed to the "code page" which is one page of code that performs | |
3483 | + * the final relocations before jumping to the new kernel. | |
3484 | + */ | |
3485 | + | |
3486 | +typedef struct xen_kexec_image { | |
3487 | +#if defined(__i386__) || defined(__x86_64__) | |
3488 | + unsigned long page_list[KEXEC_XEN_NO_PAGES]; | |
3489 | +#endif | |
3490 | +#if defined(__ia64__) | |
3491 | + unsigned long reboot_code_buffer; | |
3492 | +#endif | |
3493 | + unsigned long indirection_page; | |
3494 | + unsigned long start_address; | |
3495 | +} xen_kexec_image_t; | |
3496 | + | |
3497 | +/* | |
3498 | + * Perform kexec having previously loaded a kexec or kdump kernel | |
3499 | + * as appropriate. | |
3500 | + * type == KEXEC_TYPE_DEFAULT or KEXEC_TYPE_CRASH [in] | |
3501 | + */ | |
3502 | +#define KEXEC_CMD_kexec 0 | |
3503 | +typedef struct xen_kexec_exec { | |
3504 | + int type; | |
3505 | +} xen_kexec_exec_t; | |
3506 | + | |
3507 | +/* | |
3508 | + * Load/Unload kernel image for kexec or kdump. | |
3509 | + * type == KEXEC_TYPE_DEFAULT or KEXEC_TYPE_CRASH [in] | |
3510 | + * image == relocation information for kexec (ignored for unload) [in] | |
3511 | + */ | |
3512 | +#define KEXEC_CMD_kexec_load 1 | |
3513 | +#define KEXEC_CMD_kexec_unload 2 | |
3514 | +typedef struct xen_kexec_load { | |
3515 | + int type; | |
3516 | + xen_kexec_image_t image; | |
3517 | +} xen_kexec_load_t; | |
3518 | + | |
3519 | +#define KEXEC_RANGE_MA_CRASH 0 /* machine address and size of crash area */ | |
3520 | +#define KEXEC_RANGE_MA_XEN 1 /* machine address and size of Xen itself */ | |
3521 | +#define KEXEC_RANGE_MA_CPU 2 /* machine address and size of a CPU note */ | |
3522 | +#define KEXEC_RANGE_MA_XENHEAP 3 /* machine address and size of xenheap | |
3523 | + * Note that although this is adjacent | |
3524 | + * to Xen it exists in a separate EFI | |
3525 | + * region on ia64, and thus needs to be | |
3526 | + * inserted into iomem_machine separately */ | |
3527 | +#define KEXEC_RANGE_MA_BOOT_PARAM 4 /* machine address and size of | |
3528 | + * the ia64_boot_param */ | |
3529 | +#define KEXEC_RANGE_MA_EFI_MEMMAP 5 /* machine address and size of | |
3530 | + * of the EFI Memory Map */ | |
3531 | +#define KEXEC_RANGE_MA_VMCOREINFO 6 /* machine address and size of vmcoreinfo */ | |
3532 | + | |
3533 | +/* | |
3534 | + * Find the address and size of certain memory areas | |
3535 | + * range == KEXEC_RANGE_... [in] | |
3536 | + * nr == physical CPU number (starting from 0) if KEXEC_RANGE_MA_CPU [in] | |
3537 | + * size == number of bytes reserved in window [out] | |
3538 | + * start == address of the first byte in the window [out] | |
3539 | + */ | |
3540 | +#define KEXEC_CMD_kexec_get_range 3 | |
3541 | +typedef struct xen_kexec_range { | |
3542 | + int range; | |
3543 | + int nr; | |
3544 | + unsigned long size; | |
3545 | + unsigned long start; | |
3546 | +} xen_kexec_range_t; | |
3547 | + | |
3548 | +#endif /* _XEN_PUBLIC_KEXEC_H */ | |
3549 | + | |
3550 | +/* | |
3551 | + * Local variables: | |
3552 | + * mode: C | |
3553 | + * c-set-style: "BSD" | |
3554 | + * c-basic-offset: 4 | |
3555 | + * tab-width: 4 | |
3556 | + * indent-tabs-mode: nil | |
3557 | + * End: | |
3558 | + */ | |
3559 | Index: head-2008-11-25/include/xen/interface/nmi.h | |
3560 | =================================================================== | |
3561 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
3562 | +++ head-2008-11-25/include/xen/interface/nmi.h 2007-06-12 13:14:19.000000000 +0200 | |
3563 | @@ -0,0 +1,78 @@ | |
3564 | +/****************************************************************************** | |
3565 | + * nmi.h | |
3566 | + * | |
3567 | + * NMI callback registration and reason codes. | |
3568 | + * | |
3569 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
3570 | + * of this software and associated documentation files (the "Software"), to | |
3571 | + * deal in the Software without restriction, including without limitation the | |
3572 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
3573 | + * sell copies of the Software, and to permit persons to whom the Software is | |
3574 | + * furnished to do so, subject to the following conditions: | |
3575 | + * | |
3576 | + * The above copyright notice and this permission notice shall be included in | |
3577 | + * all copies or substantial portions of the Software. | |
3578 | + * | |
3579 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
3580 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
3581 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
3582 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
3583 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
3584 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
3585 | + * DEALINGS IN THE SOFTWARE. | |
3586 | + * | |
3587 | + * Copyright (c) 2005, Keir Fraser <keir@xensource.com> | |
3588 | + */ | |
3589 | + | |
3590 | +#ifndef __XEN_PUBLIC_NMI_H__ | |
3591 | +#define __XEN_PUBLIC_NMI_H__ | |
3592 | + | |
3593 | +/* | |
3594 | + * NMI reason codes: | |
3595 | + * Currently these are x86-specific, stored in arch_shared_info.nmi_reason. | |
3596 | + */ | |
3597 | + /* I/O-check error reported via ISA port 0x61, bit 6. */ | |
3598 | +#define _XEN_NMIREASON_io_error 0 | |
3599 | +#define XEN_NMIREASON_io_error (1UL << _XEN_NMIREASON_io_error) | |
3600 | + /* Parity error reported via ISA port 0x61, bit 7. */ | |
3601 | +#define _XEN_NMIREASON_parity_error 1 | |
3602 | +#define XEN_NMIREASON_parity_error (1UL << _XEN_NMIREASON_parity_error) | |
3603 | + /* Unknown hardware-generated NMI. */ | |
3604 | +#define _XEN_NMIREASON_unknown 2 | |
3605 | +#define XEN_NMIREASON_unknown (1UL << _XEN_NMIREASON_unknown) | |
3606 | + | |
3607 | +/* | |
3608 | + * long nmi_op(unsigned int cmd, void *arg) | |
3609 | + * NB. All ops return zero on success, else a negative error code. | |
3610 | + */ | |
3611 | + | |
3612 | +/* | |
3613 | + * Register NMI callback for this (calling) VCPU. Currently this only makes | |
3614 | + * sense for domain 0, vcpu 0. All other callers will be returned EINVAL. | |
3615 | + * arg == pointer to xennmi_callback structure. | |
3616 | + */ | |
3617 | +#define XENNMI_register_callback 0 | |
3618 | +struct xennmi_callback { | |
3619 | + unsigned long handler_address; | |
3620 | + unsigned long pad; | |
3621 | +}; | |
3622 | +typedef struct xennmi_callback xennmi_callback_t; | |
3623 | +DEFINE_XEN_GUEST_HANDLE(xennmi_callback_t); | |
3624 | + | |
3625 | +/* | |
3626 | + * Deregister NMI callback for this (calling) VCPU. | |
3627 | + * arg == NULL. | |
3628 | + */ | |
3629 | +#define XENNMI_unregister_callback 1 | |
3630 | + | |
3631 | +#endif /* __XEN_PUBLIC_NMI_H__ */ | |
3632 | + | |
3633 | +/* | |
3634 | + * Local variables: | |
3635 | + * mode: C | |
3636 | + * c-set-style: "BSD" | |
3637 | + * c-basic-offset: 4 | |
3638 | + * tab-width: 4 | |
3639 | + * indent-tabs-mode: nil | |
3640 | + * End: | |
3641 | + */ | |
3642 | Index: head-2008-11-25/include/xen/interface/platform.h | |
3643 | =================================================================== | |
3644 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
3645 | +++ head-2008-11-25/include/xen/interface/platform.h 2008-09-25 13:55:33.000000000 +0200 | |
3646 | @@ -0,0 +1,346 @@ | |
3647 | +/****************************************************************************** | |
3648 | + * platform.h | |
3649 | + * | |
3650 | + * Hardware platform operations. Intended for use by domain-0 kernel. | |
3651 | + * | |
3652 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
3653 | + * of this software and associated documentation files (the "Software"), to | |
3654 | + * deal in the Software without restriction, including without limitation the | |
3655 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
3656 | + * sell copies of the Software, and to permit persons to whom the Software is | |
3657 | + * furnished to do so, subject to the following conditions: | |
3658 | + * | |
3659 | + * The above copyright notice and this permission notice shall be included in | |
3660 | + * all copies or substantial portions of the Software. | |
3661 | + * | |
3662 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
3663 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
3664 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
3665 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
3666 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
3667 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
3668 | + * DEALINGS IN THE SOFTWARE. | |
3669 | + * | |
3670 | + * Copyright (c) 2002-2006, K Fraser | |
3671 | + */ | |
3672 | + | |
3673 | +#ifndef __XEN_PUBLIC_PLATFORM_H__ | |
3674 | +#define __XEN_PUBLIC_PLATFORM_H__ | |
3675 | + | |
3676 | +#include "xen.h" | |
3677 | + | |
3678 | +#define XENPF_INTERFACE_VERSION 0x03000001 | |
3679 | + | |
3680 | +/* | |
3681 | + * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC, | |
3682 | + * 1 January, 1970 if the current system time was <system_time>. | |
3683 | + */ | |
3684 | +#define XENPF_settime 17 | |
3685 | +struct xenpf_settime { | |
3686 | + /* IN variables. */ | |
3687 | + uint32_t secs; | |
3688 | + uint32_t nsecs; | |
3689 | + uint64_t system_time; | |
3690 | +}; | |
3691 | +typedef struct xenpf_settime xenpf_settime_t; | |
3692 | +DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t); | |
3693 | + | |
3694 | +/* | |
3695 | + * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type. | |
3696 | + * On x86, @type is an architecture-defined MTRR memory type. | |
3697 | + * On success, returns the MTRR that was used (@reg) and a handle that can | |
3698 | + * be passed to XENPF_DEL_MEMTYPE to accurately tear down the new setting. | |
3699 | + * (x86-specific). | |
3700 | + */ | |
3701 | +#define XENPF_add_memtype 31 | |
3702 | +struct xenpf_add_memtype { | |
3703 | + /* IN variables. */ | |
3704 | + xen_pfn_t mfn; | |
3705 | + uint64_t nr_mfns; | |
3706 | + uint32_t type; | |
3707 | + /* OUT variables. */ | |
3708 | + uint32_t handle; | |
3709 | + uint32_t reg; | |
3710 | +}; | |
3711 | +typedef struct xenpf_add_memtype xenpf_add_memtype_t; | |
3712 | +DEFINE_XEN_GUEST_HANDLE(xenpf_add_memtype_t); | |
3713 | + | |
3714 | +/* | |
3715 | + * Tear down an existing memory-range type. If @handle is remembered then it | |
3716 | + * should be passed in to accurately tear down the correct setting (in case | |
3717 | + * of overlapping memory regions with differing types). If it is not known | |
3718 | + * then @handle should be set to zero. In all cases @reg must be set. | |
3719 | + * (x86-specific). | |
3720 | + */ | |
3721 | +#define XENPF_del_memtype 32 | |
3722 | +struct xenpf_del_memtype { | |
3723 | + /* IN variables. */ | |
3724 | + uint32_t handle; | |
3725 | + uint32_t reg; | |
3726 | +}; | |
3727 | +typedef struct xenpf_del_memtype xenpf_del_memtype_t; | |
3728 | +DEFINE_XEN_GUEST_HANDLE(xenpf_del_memtype_t); | |
3729 | + | |
3730 | +/* Read current type of an MTRR (x86-specific). */ | |
3731 | +#define XENPF_read_memtype 33 | |
3732 | +struct xenpf_read_memtype { | |
3733 | + /* IN variables. */ | |
3734 | + uint32_t reg; | |
3735 | + /* OUT variables. */ | |
3736 | + xen_pfn_t mfn; | |
3737 | + uint64_t nr_mfns; | |
3738 | + uint32_t type; | |
3739 | +}; | |
3740 | +typedef struct xenpf_read_memtype xenpf_read_memtype_t; | |
3741 | +DEFINE_XEN_GUEST_HANDLE(xenpf_read_memtype_t); | |
3742 | + | |
3743 | +#define XENPF_microcode_update 35 | |
3744 | +struct xenpf_microcode_update { | |
3745 | + /* IN variables. */ | |
3746 | + XEN_GUEST_HANDLE(const_void) data;/* Pointer to microcode data */ | |
3747 | + uint32_t length; /* Length of microcode data. */ | |
3748 | +}; | |
3749 | +typedef struct xenpf_microcode_update xenpf_microcode_update_t; | |
3750 | +DEFINE_XEN_GUEST_HANDLE(xenpf_microcode_update_t); | |
3751 | + | |
3752 | +#define XENPF_platform_quirk 39 | |
3753 | +#define QUIRK_NOIRQBALANCING 1 /* Do not restrict IO-APIC RTE targets */ | |
3754 | +#define QUIRK_IOAPIC_BAD_REGSEL 2 /* IO-APIC REGSEL forgets its value */ | |
3755 | +#define QUIRK_IOAPIC_GOOD_REGSEL 3 /* IO-APIC REGSEL behaves properly */ | |
3756 | +struct xenpf_platform_quirk { | |
3757 | + /* IN variables. */ | |
3758 | + uint32_t quirk_id; | |
3759 | +}; | |
3760 | +typedef struct xenpf_platform_quirk xenpf_platform_quirk_t; | |
3761 | +DEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t); | |
3762 | + | |
3763 | +#define XENPF_firmware_info 50 | |
3764 | +#define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */ | |
3765 | +#define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */ | |
3766 | +#define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */ | |
3767 | +struct xenpf_firmware_info { | |
3768 | + /* IN variables. */ | |
3769 | + uint32_t type; | |
3770 | + uint32_t index; | |
3771 | + /* OUT variables. */ | |
3772 | + union { | |
3773 | + struct { | |
3774 | + /* Int13, Fn48: Check Extensions Present. */ | |
3775 | + uint8_t device; /* %dl: bios device number */ | |
3776 | + uint8_t version; /* %ah: major version */ | |
3777 | + uint16_t interface_support; /* %cx: support bitmap */ | |
3778 | + /* Int13, Fn08: Legacy Get Device Parameters. */ | |
3779 | + uint16_t legacy_max_cylinder; /* %cl[7:6]:%ch: max cyl # */ | |
3780 | + uint8_t legacy_max_head; /* %dh: max head # */ | |
3781 | + uint8_t legacy_sectors_per_track; /* %cl[5:0]: max sector # */ | |
3782 | + /* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */ | |
3783 | + /* NB. First uint16_t of buffer must be set to buffer size. */ | |
3784 | + XEN_GUEST_HANDLE(void) edd_params; | |
3785 | + } disk_info; /* XEN_FW_DISK_INFO */ | |
3786 | + struct { | |
3787 | + uint8_t device; /* bios device number */ | |
3788 | + uint32_t mbr_signature; /* offset 0x1b8 in mbr */ | |
3789 | + } disk_mbr_signature; /* XEN_FW_DISK_MBR_SIGNATURE */ | |
3790 | + struct { | |
3791 | + /* Int10, AX=4F15: Get EDID info. */ | |
3792 | + uint8_t capabilities; | |
3793 | + uint8_t edid_transfer_time; | |
3794 | + /* must refer to 128-byte buffer */ | |
3795 | + XEN_GUEST_HANDLE(uint8) edid; | |
3796 | + } vbeddc_info; /* XEN_FW_VBEDDC_INFO */ | |
3797 | + } u; | |
3798 | +}; | |
3799 | +typedef struct xenpf_firmware_info xenpf_firmware_info_t; | |
3800 | +DEFINE_XEN_GUEST_HANDLE(xenpf_firmware_info_t); | |
3801 | + | |
3802 | +#define XENPF_enter_acpi_sleep 51 | |
3803 | +struct xenpf_enter_acpi_sleep { | |
3804 | + /* IN variables */ | |
3805 | + uint16_t pm1a_cnt_val; /* PM1a control value. */ | |
3806 | + uint16_t pm1b_cnt_val; /* PM1b control value. */ | |
3807 | + uint32_t sleep_state; /* Which state to enter (Sn). */ | |
3808 | + uint32_t flags; /* Must be zero. */ | |
3809 | +}; | |
3810 | +typedef struct xenpf_enter_acpi_sleep xenpf_enter_acpi_sleep_t; | |
3811 | +DEFINE_XEN_GUEST_HANDLE(xenpf_enter_acpi_sleep_t); | |
3812 | + | |
3813 | +#define XENPF_change_freq 52 | |
3814 | +struct xenpf_change_freq { | |
3815 | + /* IN variables */ | |
3816 | + uint32_t flags; /* Must be zero. */ | |
3817 | + uint32_t cpu; /* Physical cpu. */ | |
3818 | + uint64_t freq; /* New frequency (Hz). */ | |
3819 | +}; | |
3820 | +typedef struct xenpf_change_freq xenpf_change_freq_t; | |
3821 | +DEFINE_XEN_GUEST_HANDLE(xenpf_change_freq_t); | |
3822 | + | |
3823 | +/* | |
3824 | + * Get idle times (nanoseconds since boot) for physical CPUs specified in the | |
3825 | + * @cpumap_bitmap with range [0..@cpumap_nr_cpus-1]. The @idletime array is | |
3826 | + * indexed by CPU number; only entries with the corresponding @cpumap_bitmap | |
3827 | + * bit set are written to. On return, @cpumap_bitmap is modified so that any | |
3828 | + * non-existent CPUs are cleared. Such CPUs have their @idletime array entry | |
3829 | + * cleared. | |
3830 | + */ | |
3831 | +#define XENPF_getidletime 53 | |
3832 | +struct xenpf_getidletime { | |
3833 | + /* IN/OUT variables */ | |
3834 | + /* IN: CPUs to interrogate; OUT: subset of IN which are present */ | |
3835 | + XEN_GUEST_HANDLE(uint8) cpumap_bitmap; | |
3836 | + /* IN variables */ | |
3837 | + /* Size of cpumap bitmap. */ | |
3838 | + uint32_t cpumap_nr_cpus; | |
3839 | + /* Must be indexable for every cpu in cpumap_bitmap. */ | |
3840 | + XEN_GUEST_HANDLE(uint64) idletime; | |
3841 | + /* OUT variables */ | |
3842 | + /* System time when the idletime snapshots were taken. */ | |
3843 | + uint64_t now; | |
3844 | +}; | |
3845 | +typedef struct xenpf_getidletime xenpf_getidletime_t; | |
3846 | +DEFINE_XEN_GUEST_HANDLE(xenpf_getidletime_t); | |
3847 | + | |
3848 | +#define XENPF_set_processor_pminfo 54 | |
3849 | + | |
3850 | +/* ability bits */ | |
3851 | +#define XEN_PROCESSOR_PM_CX 1 | |
3852 | +#define XEN_PROCESSOR_PM_PX 2 | |
3853 | +#define XEN_PROCESSOR_PM_TX 4 | |
3854 | + | |
3855 | +/* cmd type */ | |
3856 | +#define XEN_PM_CX 0 | |
3857 | +#define XEN_PM_PX 1 | |
3858 | +#define XEN_PM_TX 2 | |
3859 | + | |
3860 | +/* Px sub info type */ | |
3861 | +#define XEN_PX_PCT 1 | |
3862 | +#define XEN_PX_PSS 2 | |
3863 | +#define XEN_PX_PPC 4 | |
3864 | +#define XEN_PX_PSD 8 | |
3865 | + | |
3866 | +struct xen_power_register { | |
3867 | + uint32_t space_id; | |
3868 | + uint32_t bit_width; | |
3869 | + uint32_t bit_offset; | |
3870 | + uint32_t access_size; | |
3871 | + uint64_t address; | |
3872 | +}; | |
3873 | + | |
3874 | +struct xen_processor_csd { | |
3875 | + uint32_t domain; /* domain number of one dependent group */ | |
3876 | + uint32_t coord_type; /* coordination type */ | |
3877 | + uint32_t num; /* number of processors in same domain */ | |
3878 | +}; | |
3879 | +typedef struct xen_processor_csd xen_processor_csd_t; | |
3880 | +DEFINE_XEN_GUEST_HANDLE(xen_processor_csd_t); | |
3881 | + | |
3882 | +struct xen_processor_cx { | |
3883 | + struct xen_power_register reg; /* GAS for Cx trigger register */ | |
3884 | + uint8_t type; /* cstate value, c0: 0, c1: 1, ... */ | |
3885 | + uint32_t latency; /* worst latency (ms) to enter/exit this cstate */ | |
3886 | + uint32_t power; /* average power consumption(mW) */ | |
3887 | + uint32_t dpcnt; /* number of dependency entries */ | |
3888 | + XEN_GUEST_HANDLE(xen_processor_csd_t) dp; /* NULL if no dependency */ | |
3889 | +}; | |
3890 | +typedef struct xen_processor_cx xen_processor_cx_t; | |
3891 | +DEFINE_XEN_GUEST_HANDLE(xen_processor_cx_t); | |
3892 | + | |
3893 | +struct xen_processor_flags { | |
3894 | + uint32_t bm_control:1; | |
3895 | + uint32_t bm_check:1; | |
3896 | + uint32_t has_cst:1; | |
3897 | + uint32_t power_setup_done:1; | |
3898 | + uint32_t bm_rld_set:1; | |
3899 | +}; | |
3900 | + | |
3901 | +struct xen_processor_power { | |
3902 | + uint32_t count; /* number of C state entries in array below */ | |
3903 | + struct xen_processor_flags flags; /* global flags of this processor */ | |
3904 | + XEN_GUEST_HANDLE(xen_processor_cx_t) states; /* supported c states */ | |
3905 | +}; | |
3906 | + | |
3907 | +struct xen_pct_register { | |
3908 | + uint8_t descriptor; | |
3909 | + uint16_t length; | |
3910 | + uint8_t space_id; | |
3911 | + uint8_t bit_width; | |
3912 | + uint8_t bit_offset; | |
3913 | + uint8_t reserved; | |
3914 | + uint64_t address; | |
3915 | +}; | |
3916 | + | |
3917 | +struct xen_processor_px { | |
3918 | + uint64_t core_frequency; /* megahertz */ | |
3919 | + uint64_t power; /* milliWatts */ | |
3920 | + uint64_t transition_latency; /* microseconds */ | |
3921 | + uint64_t bus_master_latency; /* microseconds */ | |
3922 | + uint64_t control; /* control value */ | |
3923 | + uint64_t status; /* success indicator */ | |
3924 | +}; | |
3925 | +typedef struct xen_processor_px xen_processor_px_t; | |
3926 | +DEFINE_XEN_GUEST_HANDLE(xen_processor_px_t); | |
3927 | + | |
3928 | +struct xen_psd_package { | |
3929 | + uint64_t num_entries; | |
3930 | + uint64_t revision; | |
3931 | + uint64_t domain; | |
3932 | + uint64_t coord_type; | |
3933 | + uint64_t num_processors; | |
3934 | +}; | |
3935 | + | |
3936 | +struct xen_processor_performance { | |
3937 | + uint32_t flags; /* flag for Px sub info type */ | |
3938 | + uint32_t platform_limit; /* Platform limitation on freq usage */ | |
3939 | + struct xen_pct_register control_register; | |
3940 | + struct xen_pct_register status_register; | |
3941 | + uint32_t state_count; /* total available performance states */ | |
3942 | + XEN_GUEST_HANDLE(xen_processor_px_t) states; | |
3943 | + struct xen_psd_package domain_info; | |
3944 | + uint32_t shared_type; /* coordination type of this processor */ | |
3945 | +}; | |
3946 | +typedef struct xen_processor_performance xen_processor_performance_t; | |
3947 | +DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t); | |
3948 | + | |
3949 | +struct xenpf_set_processor_pminfo { | |
3950 | + /* IN variables */ | |
3951 | + uint32_t id; /* ACPI CPU ID */ | |
3952 | + uint32_t type; /* {XEN_PM_CX, XEN_PM_PX} */ | |
3953 | + union { | |
3954 | + struct xen_processor_power power;/* Cx: _CST/_CSD */ | |
3955 | + struct xen_processor_performance perf; /* Px: _PPC/_PCT/_PSS/_PSD */ | |
3956 | + }; | |
3957 | +}; | |
3958 | +typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t; | |
3959 | +DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t); | |
3960 | + | |
3961 | +struct xen_platform_op { | |
3962 | + uint32_t cmd; | |
3963 | + uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ | |
3964 | + union { | |
3965 | + struct xenpf_settime settime; | |
3966 | + struct xenpf_add_memtype add_memtype; | |
3967 | + struct xenpf_del_memtype del_memtype; | |
3968 | + struct xenpf_read_memtype read_memtype; | |
3969 | + struct xenpf_microcode_update microcode; | |
3970 | + struct xenpf_platform_quirk platform_quirk; | |
3971 | + struct xenpf_firmware_info firmware_info; | |
3972 | + struct xenpf_enter_acpi_sleep enter_acpi_sleep; | |
3973 | + struct xenpf_change_freq change_freq; | |
3974 | + struct xenpf_getidletime getidletime; | |
3975 | + struct xenpf_set_processor_pminfo set_pminfo; | |
3976 | + uint8_t pad[128]; | |
3977 | + } u; | |
3978 | +}; | |
3979 | +typedef struct xen_platform_op xen_platform_op_t; | |
3980 | +DEFINE_XEN_GUEST_HANDLE(xen_platform_op_t); | |
3981 | + | |
3982 | +#endif /* __XEN_PUBLIC_PLATFORM_H__ */ | |
3983 | + | |
3984 | +/* | |
3985 | + * Local variables: | |
3986 | + * mode: C | |
3987 | + * c-set-style: "BSD" | |
3988 | + * c-basic-offset: 4 | |
3989 | + * tab-width: 4 | |
3990 | + * indent-tabs-mode: nil | |
3991 | + * End: | |
3992 | + */ | |
3993 | Index: head-2008-11-25/include/xen/interface/sysctl.h | |
3994 | =================================================================== | |
3995 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
3996 | +++ head-2008-11-25/include/xen/interface/sysctl.h 2008-09-25 13:55:33.000000000 +0200 | |
3997 | @@ -0,0 +1,308 @@ | |
3998 | +/****************************************************************************** | |
3999 | + * sysctl.h | |
4000 | + * | |
4001 | + * System management operations. For use by node control stack. | |
4002 | + * | |
4003 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
4004 | + * of this software and associated documentation files (the "Software"), to | |
4005 | + * deal in the Software without restriction, including without limitation the | |
4006 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
4007 | + * sell copies of the Software, and to permit persons to whom the Software is | |
4008 | + * furnished to do so, subject to the following conditions: | |
4009 | + * | |
4010 | + * The above copyright notice and this permission notice shall be included in | |
4011 | + * all copies or substantial portions of the Software. | |
4012 | + * | |
4013 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
4014 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
4015 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
4016 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
4017 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
4018 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
4019 | + * DEALINGS IN THE SOFTWARE. | |
4020 | + * | |
4021 | + * Copyright (c) 2002-2006, K Fraser | |
4022 | + */ | |
4023 | + | |
4024 | +#ifndef __XEN_PUBLIC_SYSCTL_H__ | |
4025 | +#define __XEN_PUBLIC_SYSCTL_H__ | |
4026 | + | |
4027 | +#if !defined(__XEN__) && !defined(__XEN_TOOLS__) | |
4028 | +#error "sysctl operations are intended for use by node control tools only" | |
4029 | +#endif | |
4030 | + | |
4031 | +#include "xen.h" | |
4032 | +#include "domctl.h" | |
4033 | + | |
4034 | +#define XEN_SYSCTL_INTERFACE_VERSION 0x00000006 | |
4035 | + | |
4036 | +/* | |
4037 | + * Read console content from Xen buffer ring. | |
4038 | + */ | |
4039 | +#define XEN_SYSCTL_readconsole 1 | |
4040 | +struct xen_sysctl_readconsole { | |
4041 | + /* IN: Non-zero -> clear after reading. */ | |
4042 | + uint8_t clear; | |
4043 | + /* IN: Non-zero -> start index specified by @index field. */ | |
4044 | + uint8_t incremental; | |
4045 | + uint8_t pad0, pad1; | |
4046 | + /* | |
4047 | + * IN: Start index for consuming from ring buffer (if @incremental); | |
4048 | + * OUT: End index after consuming from ring buffer. | |
4049 | + */ | |
4050 | + uint32_t index; | |
4051 | + /* IN: Virtual address to write console data. */ | |
4052 | + XEN_GUEST_HANDLE_64(char) buffer; | |
4053 | + /* IN: Size of buffer; OUT: Bytes written to buffer. */ | |
4054 | + uint32_t count; | |
4055 | +}; | |
4056 | +typedef struct xen_sysctl_readconsole xen_sysctl_readconsole_t; | |
4057 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_readconsole_t); | |
4058 | + | |
4059 | +/* Get trace buffers machine base address */ | |
4060 | +#define XEN_SYSCTL_tbuf_op 2 | |
4061 | +struct xen_sysctl_tbuf_op { | |
4062 | + /* IN variables */ | |
4063 | +#define XEN_SYSCTL_TBUFOP_get_info 0 | |
4064 | +#define XEN_SYSCTL_TBUFOP_set_cpu_mask 1 | |
4065 | +#define XEN_SYSCTL_TBUFOP_set_evt_mask 2 | |
4066 | +#define XEN_SYSCTL_TBUFOP_set_size 3 | |
4067 | +#define XEN_SYSCTL_TBUFOP_enable 4 | |
4068 | +#define XEN_SYSCTL_TBUFOP_disable 5 | |
4069 | + uint32_t cmd; | |
4070 | + /* IN/OUT variables */ | |
4071 | + struct xenctl_cpumap cpu_mask; | |
4072 | + uint32_t evt_mask; | |
4073 | + /* OUT variables */ | |
4074 | + uint64_aligned_t buffer_mfn; | |
4075 | + uint32_t size; | |
4076 | +}; | |
4077 | +typedef struct xen_sysctl_tbuf_op xen_sysctl_tbuf_op_t; | |
4078 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tbuf_op_t); | |
4079 | + | |
4080 | +/* | |
4081 | + * Get physical information about the host machine | |
4082 | + */ | |
4083 | +#define XEN_SYSCTL_physinfo 3 | |
4084 | + /* (x86) The platform supports HVM guests. */ | |
4085 | +#define _XEN_SYSCTL_PHYSCAP_hvm 0 | |
4086 | +#define XEN_SYSCTL_PHYSCAP_hvm (1u<<_XEN_SYSCTL_PHYSCAP_hvm) | |
4087 | + /* (x86) The platform supports HVM-guest direct access to I/O devices. */ | |
4088 | +#define _XEN_SYSCTL_PHYSCAP_hvm_directio 1 | |
4089 | +#define XEN_SYSCTL_PHYSCAP_hvm_directio (1u<<_XEN_SYSCTL_PHYSCAP_hvm_directio) | |
4090 | +struct xen_sysctl_physinfo { | |
4091 | + uint32_t threads_per_core; | |
4092 | + uint32_t cores_per_socket; | |
4093 | + uint32_t nr_cpus; | |
4094 | + uint32_t nr_nodes; | |
4095 | + uint32_t cpu_khz; | |
4096 | + uint64_aligned_t total_pages; | |
4097 | + uint64_aligned_t free_pages; | |
4098 | + uint64_aligned_t scrub_pages; | |
4099 | + uint32_t hw_cap[8]; | |
4100 | + | |
4101 | + /* | |
4102 | + * IN: maximum addressable entry in the caller-provided cpu_to_node array. | |
4103 | + * OUT: largest cpu identifier in the system. | |
4104 | + * If OUT is greater than IN then the cpu_to_node array is truncated! | |
4105 | + */ | |
4106 | + uint32_t max_cpu_id; | |
4107 | + /* | |
4108 | + * If not NULL, this array is filled with node identifier for each cpu. | |
4109 | + * If a cpu has no node information (e.g., cpu not present) then the | |
4110 | + * sentinel value ~0u is written. | |
4111 | + * The size of this array is specified by the caller in @max_cpu_id. | |
4112 | + * If the actual @max_cpu_id is smaller than the array then the trailing | |
4113 | + * elements of the array will not be written by the sysctl. | |
4114 | + */ | |
4115 | + XEN_GUEST_HANDLE_64(uint32) cpu_to_node; | |
4116 | + | |
4117 | + /* XEN_SYSCTL_PHYSCAP_??? */ | |
4118 | + uint32_t capabilities; | |
4119 | +}; | |
4120 | +typedef struct xen_sysctl_physinfo xen_sysctl_physinfo_t; | |
4121 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_physinfo_t); | |
4122 | + | |
4123 | +/* | |
4124 | + * Get the ID of the current scheduler. | |
4125 | + */ | |
4126 | +#define XEN_SYSCTL_sched_id 4 | |
4127 | +struct xen_sysctl_sched_id { | |
4128 | + /* OUT variable */ | |
4129 | + uint32_t sched_id; | |
4130 | +}; | |
4131 | +typedef struct xen_sysctl_sched_id xen_sysctl_sched_id_t; | |
4132 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_sched_id_t); | |
4133 | + | |
4134 | +/* Interface for controlling Xen software performance counters. */ | |
4135 | +#define XEN_SYSCTL_perfc_op 5 | |
4136 | +/* Sub-operations: */ | |
4137 | +#define XEN_SYSCTL_PERFCOP_reset 1 /* Reset all counters to zero. */ | |
4138 | +#define XEN_SYSCTL_PERFCOP_query 2 /* Get perfctr information. */ | |
4139 | +struct xen_sysctl_perfc_desc { | |
4140 | + char name[80]; /* name of perf counter */ | |
4141 | + uint32_t nr_vals; /* number of values for this counter */ | |
4142 | +}; | |
4143 | +typedef struct xen_sysctl_perfc_desc xen_sysctl_perfc_desc_t; | |
4144 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t); | |
4145 | +typedef uint32_t xen_sysctl_perfc_val_t; | |
4146 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t); | |
4147 | + | |
4148 | +struct xen_sysctl_perfc_op { | |
4149 | + /* IN variables. */ | |
4150 | + uint32_t cmd; /* XEN_SYSCTL_PERFCOP_??? */ | |
4151 | + /* OUT variables. */ | |
4152 | + uint32_t nr_counters; /* number of counters description */ | |
4153 | + uint32_t nr_vals; /* number of values */ | |
4154 | + /* counter information (or NULL) */ | |
4155 | + XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc; | |
4156 | + /* counter values (or NULL) */ | |
4157 | + XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val; | |
4158 | +}; | |
4159 | +typedef struct xen_sysctl_perfc_op xen_sysctl_perfc_op_t; | |
4160 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_op_t); | |
4161 | + | |
4162 | +#define XEN_SYSCTL_getdomaininfolist 6 | |
4163 | +struct xen_sysctl_getdomaininfolist { | |
4164 | + /* IN variables. */ | |
4165 | + domid_t first_domain; | |
4166 | + uint32_t max_domains; | |
4167 | + XEN_GUEST_HANDLE_64(xen_domctl_getdomaininfo_t) buffer; | |
4168 | + /* OUT variables. */ | |
4169 | + uint32_t num_domains; | |
4170 | +}; | |
4171 | +typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t; | |
4172 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t); | |
4173 | + | |
4174 | +/* Inject debug keys into Xen. */ | |
4175 | +#define XEN_SYSCTL_debug_keys 7 | |
4176 | +struct xen_sysctl_debug_keys { | |
4177 | + /* IN variables. */ | |
4178 | + XEN_GUEST_HANDLE_64(char) keys; | |
4179 | + uint32_t nr_keys; | |
4180 | +}; | |
4181 | +typedef struct xen_sysctl_debug_keys xen_sysctl_debug_keys_t; | |
4182 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_debug_keys_t); | |
4183 | + | |
4184 | +/* Get physical CPU information. */ | |
4185 | +#define XEN_SYSCTL_getcpuinfo 8 | |
4186 | +struct xen_sysctl_cpuinfo { | |
4187 | + uint64_aligned_t idletime; | |
4188 | +}; | |
4189 | +typedef struct xen_sysctl_cpuinfo xen_sysctl_cpuinfo_t; | |
4190 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpuinfo_t); | |
4191 | +struct xen_sysctl_getcpuinfo { | |
4192 | + /* IN variables. */ | |
4193 | + uint32_t max_cpus; | |
4194 | + XEN_GUEST_HANDLE_64(xen_sysctl_cpuinfo_t) info; | |
4195 | + /* OUT variables. */ | |
4196 | + uint32_t nr_cpus; | |
4197 | +}; | |
4198 | +typedef struct xen_sysctl_getcpuinfo xen_sysctl_getcpuinfo_t; | |
4199 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getcpuinfo_t); | |
4200 | + | |
4201 | +#define XEN_SYSCTL_availheap 9 | |
4202 | +struct xen_sysctl_availheap { | |
4203 | + /* IN variables. */ | |
4204 | + uint32_t min_bitwidth; /* Smallest address width (zero if don't care). */ | |
4205 | + uint32_t max_bitwidth; /* Largest address width (zero if don't care). */ | |
4206 | + int32_t node; /* NUMA node of interest (-1 for all nodes). */ | |
4207 | + /* OUT variables. */ | |
4208 | + uint64_aligned_t avail_bytes;/* Bytes available in the specified region. */ | |
4209 | +}; | |
4210 | +typedef struct xen_sysctl_availheap xen_sysctl_availheap_t; | |
4211 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_availheap_t); | |
4212 | + | |
4213 | +#define XEN_SYSCTL_get_pmstat 10 | |
4214 | +struct pm_px_val { | |
4215 | + uint64_aligned_t freq; /* Px core frequency */ | |
4216 | + uint64_aligned_t residency; /* Px residency time */ | |
4217 | + uint64_aligned_t count; /* Px transition count */ | |
4218 | +}; | |
4219 | +typedef struct pm_px_val pm_px_val_t; | |
4220 | +DEFINE_XEN_GUEST_HANDLE(pm_px_val_t); | |
4221 | + | |
4222 | +struct pm_px_stat { | |
4223 | + uint8_t total; /* total Px states */ | |
4224 | + uint8_t usable; /* usable Px states */ | |
4225 | + uint8_t last; /* last Px state */ | |
4226 | + uint8_t cur; /* current Px state */ | |
4227 | + XEN_GUEST_HANDLE_64(uint64) trans_pt; /* Px transition table */ | |
4228 | + XEN_GUEST_HANDLE_64(pm_px_val_t) pt; | |
4229 | +}; | |
4230 | +typedef struct pm_px_stat pm_px_stat_t; | |
4231 | +DEFINE_XEN_GUEST_HANDLE(pm_px_stat_t); | |
4232 | + | |
4233 | +struct pm_cx_stat { | |
4234 | + uint32_t nr; /* entry nr in triggers & residencies, including C0 */ | |
4235 | + uint32_t last; /* last Cx state */ | |
4236 | + uint64_aligned_t idle_time; /* idle time from boot */ | |
4237 | + XEN_GUEST_HANDLE_64(uint64) triggers; /* Cx trigger counts */ | |
4238 | + XEN_GUEST_HANDLE_64(uint64) residencies; /* Cx residencies */ | |
4239 | +}; | |
4240 | + | |
4241 | +struct xen_sysctl_get_pmstat { | |
4242 | +#define PMSTAT_CATEGORY_MASK 0xf0 | |
4243 | +#define PMSTAT_PX 0x10 | |
4244 | +#define PMSTAT_CX 0x20 | |
4245 | +#define PMSTAT_get_max_px (PMSTAT_PX | 0x1) | |
4246 | +#define PMSTAT_get_pxstat (PMSTAT_PX | 0x2) | |
4247 | +#define PMSTAT_reset_pxstat (PMSTAT_PX | 0x3) | |
4248 | +#define PMSTAT_get_max_cx (PMSTAT_CX | 0x1) | |
4249 | +#define PMSTAT_get_cxstat (PMSTAT_CX | 0x2) | |
4250 | +#define PMSTAT_reset_cxstat (PMSTAT_CX | 0x3) | |
4251 | + uint32_t type; | |
4252 | + uint32_t cpuid; | |
4253 | + union { | |
4254 | + struct pm_px_stat getpx; | |
4255 | + struct pm_cx_stat getcx; | |
4256 | + /* other struct for tx, etc */ | |
4257 | + } u; | |
4258 | +}; | |
4259 | +typedef struct xen_sysctl_get_pmstat xen_sysctl_get_pmstat_t; | |
4260 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_get_pmstat_t); | |
4261 | + | |
4262 | +#define XEN_SYSCTL_cpu_hotplug 11 | |
4263 | +struct xen_sysctl_cpu_hotplug { | |
4264 | + /* IN variables */ | |
4265 | + uint32_t cpu; /* Physical cpu. */ | |
4266 | +#define XEN_SYSCTL_CPU_HOTPLUG_ONLINE 0 | |
4267 | +#define XEN_SYSCTL_CPU_HOTPLUG_OFFLINE 1 | |
4268 | + uint32_t op; /* hotplug opcode */ | |
4269 | +}; | |
4270 | +typedef struct xen_sysctl_cpu_hotplug xen_sysctl_cpu_hotplug_t; | |
4271 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpu_hotplug_t); | |
4272 | + | |
4273 | + | |
4274 | +struct xen_sysctl { | |
4275 | + uint32_t cmd; | |
4276 | + uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */ | |
4277 | + union { | |
4278 | + struct xen_sysctl_readconsole readconsole; | |
4279 | + struct xen_sysctl_tbuf_op tbuf_op; | |
4280 | + struct xen_sysctl_physinfo physinfo; | |
4281 | + struct xen_sysctl_sched_id sched_id; | |
4282 | + struct xen_sysctl_perfc_op perfc_op; | |
4283 | + struct xen_sysctl_getdomaininfolist getdomaininfolist; | |
4284 | + struct xen_sysctl_debug_keys debug_keys; | |
4285 | + struct xen_sysctl_getcpuinfo getcpuinfo; | |
4286 | + struct xen_sysctl_availheap availheap; | |
4287 | + struct xen_sysctl_get_pmstat get_pmstat; | |
4288 | + struct xen_sysctl_cpu_hotplug cpu_hotplug; | |
4289 | + uint8_t pad[128]; | |
4290 | + } u; | |
4291 | +}; | |
4292 | +typedef struct xen_sysctl xen_sysctl_t; | |
4293 | +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t); | |
4294 | + | |
4295 | +#endif /* __XEN_PUBLIC_SYSCTL_H__ */ | |
4296 | + | |
4297 | +/* | |
4298 | + * Local variables: | |
4299 | + * mode: C | |
4300 | + * c-set-style: "BSD" | |
4301 | + * c-basic-offset: 4 | |
4302 | + * tab-width: 4 | |
4303 | + * indent-tabs-mode: nil | |
4304 | + * End: | |
4305 | + */ | |
4306 | Index: head-2008-11-25/include/xen/interface/trace.h | |
4307 | =================================================================== | |
4308 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
4309 | +++ head-2008-11-25/include/xen/interface/trace.h 2008-11-25 12:22:34.000000000 +0100 | |
4310 | @@ -0,0 +1,205 @@ | |
4311 | +/****************************************************************************** | |
4312 | + * include/public/trace.h | |
4313 | + * | |
4314 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
4315 | + * of this software and associated documentation files (the "Software"), to | |
4316 | + * deal in the Software without restriction, including without limitation the | |
4317 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
4318 | + * sell copies of the Software, and to permit persons to whom the Software is | |
4319 | + * furnished to do so, subject to the following conditions: | |
4320 | + * | |
4321 | + * The above copyright notice and this permission notice shall be included in | |
4322 | + * all copies or substantial portions of the Software. | |
4323 | + * | |
4324 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
4325 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
4326 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
4327 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
4328 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
4329 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
4330 | + * DEALINGS IN THE SOFTWARE. | |
4331 | + * | |
4332 | + * Mark Williamson, (C) 2004 Intel Research Cambridge | |
4333 | + * Copyright (C) 2005 Bin Ren | |
4334 | + */ | |
4335 | + | |
4336 | +#ifndef __XEN_PUBLIC_TRACE_H__ | |
4337 | +#define __XEN_PUBLIC_TRACE_H__ | |
4338 | + | |
4339 | +#define TRACE_EXTRA_MAX 7 | |
4340 | +#define TRACE_EXTRA_SHIFT 28 | |
4341 | + | |
4342 | +/* Trace classes */ | |
4343 | +#define TRC_CLS_SHIFT 16 | |
4344 | +#define TRC_GEN 0x0001f000 /* General trace */ | |
4345 | +#define TRC_SCHED 0x0002f000 /* Xen Scheduler trace */ | |
4346 | +#define TRC_DOM0OP 0x0004f000 /* Xen DOM0 operation trace */ | |
4347 | +#define TRC_HVM 0x0008f000 /* Xen HVM trace */ | |
4348 | +#define TRC_MEM 0x0010f000 /* Xen memory trace */ | |
4349 | +#define TRC_PV 0x0020f000 /* Xen PV traces */ | |
4350 | +#define TRC_SHADOW 0x0040f000 /* Xen shadow tracing */ | |
4351 | +#define TRC_PM 0x0080f000 /* Xen power management trace */ | |
4352 | +#define TRC_ALL 0x0ffff000 | |
4353 | +#define TRC_HD_TO_EVENT(x) ((x)&0x0fffffff) | |
4354 | +#define TRC_HD_CYCLE_FLAG (1UL<<31) | |
4355 | +#define TRC_HD_INCLUDES_CYCLE_COUNT(x) ( !!( (x) & TRC_HD_CYCLE_FLAG ) ) | |
4356 | +#define TRC_HD_EXTRA(x) (((x)>>TRACE_EXTRA_SHIFT)&TRACE_EXTRA_MAX) | |
4357 | + | |
4358 | +/* Trace subclasses */ | |
4359 | +#define TRC_SUBCLS_SHIFT 12 | |
4360 | + | |
4361 | +/* trace subclasses for SVM */ | |
4362 | +#define TRC_HVM_ENTRYEXIT 0x00081000 /* VMENTRY and #VMEXIT */ | |
4363 | +#define TRC_HVM_HANDLER 0x00082000 /* various HVM handlers */ | |
4364 | + | |
4365 | +#define TRC_SCHED_MIN 0x00021000 /* Just runstate changes */ | |
4366 | +#define TRC_SCHED_VERBOSE 0x00028000 /* More inclusive scheduling */ | |
4367 | + | |
4368 | +/* Trace events per class */ | |
4369 | +#define TRC_LOST_RECORDS (TRC_GEN + 1) | |
4370 | +#define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2) | |
4371 | +#define TRC_TRACE_CPU_CHANGE (TRC_GEN + 3) | |
4372 | + | |
4373 | +#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1) | |
4374 | +#define TRC_SCHED_DOM_ADD (TRC_SCHED_VERBOSE + 1) | |
4375 | +#define TRC_SCHED_DOM_REM (TRC_SCHED_VERBOSE + 2) | |
4376 | +#define TRC_SCHED_SLEEP (TRC_SCHED_VERBOSE + 3) | |
4377 | +#define TRC_SCHED_WAKE (TRC_SCHED_VERBOSE + 4) | |
4378 | +#define TRC_SCHED_YIELD (TRC_SCHED_VERBOSE + 5) | |
4379 | +#define TRC_SCHED_BLOCK (TRC_SCHED_VERBOSE + 6) | |
4380 | +#define TRC_SCHED_SHUTDOWN (TRC_SCHED_VERBOSE + 7) | |
4381 | +#define TRC_SCHED_CTL (TRC_SCHED_VERBOSE + 8) | |
4382 | +#define TRC_SCHED_ADJDOM (TRC_SCHED_VERBOSE + 9) | |
4383 | +#define TRC_SCHED_SWITCH (TRC_SCHED_VERBOSE + 10) | |
4384 | +#define TRC_SCHED_S_TIMER_FN (TRC_SCHED_VERBOSE + 11) | |
4385 | +#define TRC_SCHED_T_TIMER_FN (TRC_SCHED_VERBOSE + 12) | |
4386 | +#define TRC_SCHED_DOM_TIMER_FN (TRC_SCHED_VERBOSE + 13) | |
4387 | +#define TRC_SCHED_SWITCH_INFPREV (TRC_SCHED_VERBOSE + 14) | |
4388 | +#define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED_VERBOSE + 15) | |
4389 | + | |
4390 | +#define TRC_MEM_PAGE_GRANT_MAP (TRC_MEM + 1) | |
4391 | +#define TRC_MEM_PAGE_GRANT_UNMAP (TRC_MEM + 2) | |
4392 | +#define TRC_MEM_PAGE_GRANT_TRANSFER (TRC_MEM + 3) | |
4393 | + | |
4394 | +#define TRC_PV_HYPERCALL (TRC_PV + 1) | |
4395 | +#define TRC_PV_TRAP (TRC_PV + 3) | |
4396 | +#define TRC_PV_PAGE_FAULT (TRC_PV + 4) | |
4397 | +#define TRC_PV_FORCED_INVALID_OP (TRC_PV + 5) | |
4398 | +#define TRC_PV_EMULATE_PRIVOP (TRC_PV + 6) | |
4399 | +#define TRC_PV_EMULATE_4GB (TRC_PV + 7) | |
4400 | +#define TRC_PV_MATH_STATE_RESTORE (TRC_PV + 8) | |
4401 | +#define TRC_PV_PAGING_FIXUP (TRC_PV + 9) | |
4402 | +#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV + 10) | |
4403 | +#define TRC_PV_PTWR_EMULATION (TRC_PV + 11) | |
4404 | +#define TRC_PV_PTWR_EMULATION_PAE (TRC_PV + 12) | |
4405 | + /* Indicates that addresses in trace record are 64 bits */ | |
4406 | +#define TRC_64_FLAG (0x100) | |
4407 | + | |
4408 | +#define TRC_SHADOW_NOT_SHADOW (TRC_SHADOW + 1) | |
4409 | +#define TRC_SHADOW_FAST_PROPAGATE (TRC_SHADOW + 2) | |
4410 | +#define TRC_SHADOW_FAST_MMIO (TRC_SHADOW + 3) | |
4411 | +#define TRC_SHADOW_FALSE_FAST_PATH (TRC_SHADOW + 4) | |
4412 | +#define TRC_SHADOW_MMIO (TRC_SHADOW + 5) | |
4413 | +#define TRC_SHADOW_FIXUP (TRC_SHADOW + 6) | |
4414 | +#define TRC_SHADOW_DOMF_DYING (TRC_SHADOW + 7) | |
4415 | +#define TRC_SHADOW_EMULATE (TRC_SHADOW + 8) | |
4416 | +#define TRC_SHADOW_EMULATE_UNSHADOW_USER (TRC_SHADOW + 9) | |
4417 | +#define TRC_SHADOW_EMULATE_UNSHADOW_EVTINJ (TRC_SHADOW + 10) | |
4418 | +#define TRC_SHADOW_EMULATE_UNSHADOW_UNHANDLED (TRC_SHADOW + 11) | |
4419 | +#define TRC_SHADOW_WRMAP_BF (TRC_SHADOW + 12) | |
4420 | +#define TRC_SHADOW_PREALLOC_UNPIN (TRC_SHADOW + 13) | |
4421 | +#define TRC_SHADOW_RESYNC_FULL (TRC_SHADOW + 14) | |
4422 | +#define TRC_SHADOW_RESYNC_ONLY (TRC_SHADOW + 15) | |
4423 | + | |
4424 | +/* trace events per subclass */ | |
4425 | +#define TRC_HVM_VMENTRY (TRC_HVM_ENTRYEXIT + 0x01) | |
4426 | +#define TRC_HVM_VMEXIT (TRC_HVM_ENTRYEXIT + 0x02) | |
4427 | +#define TRC_HVM_VMEXIT64 (TRC_HVM_ENTRYEXIT + TRC_64_FLAG + 0x02) | |
4428 | +#define TRC_HVM_PF_XEN (TRC_HVM_HANDLER + 0x01) | |
4429 | +#define TRC_HVM_PF_XEN64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x01) | |
4430 | +#define TRC_HVM_PF_INJECT (TRC_HVM_HANDLER + 0x02) | |
4431 | +#define TRC_HVM_PF_INJECT64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x02) | |
4432 | +#define TRC_HVM_INJ_EXC (TRC_HVM_HANDLER + 0x03) | |
4433 | +#define TRC_HVM_INJ_VIRQ (TRC_HVM_HANDLER + 0x04) | |
4434 | +#define TRC_HVM_REINJ_VIRQ (TRC_HVM_HANDLER + 0x05) | |
4435 | +#define TRC_HVM_IO_READ (TRC_HVM_HANDLER + 0x06) | |
4436 | +#define TRC_HVM_IO_WRITE (TRC_HVM_HANDLER + 0x07) | |
4437 | +#define TRC_HVM_CR_READ (TRC_HVM_HANDLER + 0x08) | |
4438 | +#define TRC_HVM_CR_READ64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x08) | |
4439 | +#define TRC_HVM_CR_WRITE (TRC_HVM_HANDLER + 0x09) | |
4440 | +#define TRC_HVM_CR_WRITE64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x09) | |
4441 | +#define TRC_HVM_DR_READ (TRC_HVM_HANDLER + 0x0A) | |
4442 | +#define TRC_HVM_DR_WRITE (TRC_HVM_HANDLER + 0x0B) | |
4443 | +#define TRC_HVM_MSR_READ (TRC_HVM_HANDLER + 0x0C) | |
4444 | +#define TRC_HVM_MSR_WRITE (TRC_HVM_HANDLER + 0x0D) | |
4445 | +#define TRC_HVM_CPUID (TRC_HVM_HANDLER + 0x0E) | |
4446 | +#define TRC_HVM_INTR (TRC_HVM_HANDLER + 0x0F) | |
4447 | +#define TRC_HVM_NMI (TRC_HVM_HANDLER + 0x10) | |
4448 | +#define TRC_HVM_SMI (TRC_HVM_HANDLER + 0x11) | |
4449 | +#define TRC_HVM_VMMCALL (TRC_HVM_HANDLER + 0x12) | |
4450 | +#define TRC_HVM_HLT (TRC_HVM_HANDLER + 0x13) | |
4451 | +#define TRC_HVM_INVLPG (TRC_HVM_HANDLER + 0x14) | |
4452 | +#define TRC_HVM_INVLPG64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x14) | |
4453 | +#define TRC_HVM_MCE (TRC_HVM_HANDLER + 0x15) | |
4454 | +#define TRC_HVM_IO_ASSIST (TRC_HVM_HANDLER + 0x16) | |
4455 | +#define TRC_HVM_IO_ASSIST64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x16) | |
4456 | +#define TRC_HVM_MMIO_ASSIST (TRC_HVM_HANDLER + 0x17) | |
4457 | +#define TRC_HVM_MMIO_ASSIST64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x17) | |
4458 | +#define TRC_HVM_CLTS (TRC_HVM_HANDLER + 0x18) | |
4459 | +#define TRC_HVM_LMSW (TRC_HVM_HANDLER + 0x19) | |
4460 | +#define TRC_HVM_LMSW64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x19) | |
4461 | + | |
4462 | +/* trace subclasses for power management */ | |
4463 | +#define TRC_PM_FREQ 0x00801000 /* xen cpu freq events */ | |
4464 | +#define TRC_PM_IDLE 0x00802000 /* xen cpu idle events */ | |
4465 | + | |
4466 | +/* trace events for per class */ | |
4467 | +#define TRC_PM_FREQ_CHANGE (TRC_PM_FREQ + 0x01) | |
4468 | +#define TRC_PM_IDLE_ENTRY (TRC_PM_IDLE + 0x01) | |
4469 | +#define TRC_PM_IDLE_EXIT (TRC_PM_IDLE + 0x02) | |
4470 | + | |
4471 | +/* This structure represents a single trace buffer record. */ | |
4472 | +struct t_rec { | |
4473 | + uint32_t event:28; | |
4474 | + uint32_t extra_u32:3; /* # entries in trailing extra_u32[] array */ | |
4475 | + uint32_t cycles_included:1; /* u.cycles or u.no_cycles? */ | |
4476 | + union { | |
4477 | + struct { | |
4478 | + uint32_t cycles_lo, cycles_hi; /* cycle counter timestamp */ | |
4479 | + uint32_t extra_u32[7]; /* event data items */ | |
4480 | + } cycles; | |
4481 | + struct { | |
4482 | + uint32_t extra_u32[7]; /* event data items */ | |
4483 | + } nocycles; | |
4484 | + } u; | |
4485 | +}; | |
4486 | + | |
4487 | +/* | |
4488 | + * This structure contains the metadata for a single trace buffer. The head | |
4489 | + * field, indexes into an array of struct t_rec's. | |
4490 | + */ | |
4491 | +struct t_buf { | |
4492 | + /* Assume the data buffer size is X. X is generally not a power of 2. | |
4493 | + * CONS and PROD are incremented modulo (2*X): | |
4494 | + * 0 <= cons < 2*X | |
4495 | + * 0 <= prod < 2*X | |
4496 | + * This is done because addition modulo X breaks at 2^32 when X is not a | |
4497 | + * power of 2: | |
4498 | + * (((2^32 - 1) % X) + 1) % X != (2^32) % X | |
4499 | + */ | |
4500 | + uint32_t cons; /* Offset of next item to be consumed by control tools. */ | |
4501 | + uint32_t prod; /* Offset of next item to be produced by Xen. */ | |
4502 | + /* Records follow immediately after the meta-data header. */ | |
4503 | +}; | |
4504 | + | |
4505 | +#endif /* __XEN_PUBLIC_TRACE_H__ */ | |
4506 | + | |
4507 | +/* | |
4508 | + * Local variables: | |
4509 | + * mode: C | |
4510 | + * c-set-style: "BSD" | |
4511 | + * c-basic-offset: 4 | |
4512 | + * tab-width: 4 | |
4513 | + * indent-tabs-mode: nil | |
4514 | + * End: | |
4515 | + */ | |
4516 | Index: head-2008-11-25/include/xen/interface/xen-compat.h | |
4517 | =================================================================== | |
4518 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
4519 | +++ head-2008-11-25/include/xen/interface/xen-compat.h 2008-09-01 12:07:31.000000000 +0200 | |
4520 | @@ -0,0 +1,44 @@ | |
4521 | +/****************************************************************************** | |
4522 | + * xen-compat.h | |
4523 | + * | |
4524 | + * Guest OS interface to Xen. Compatibility layer. | |
4525 | + * | |
4526 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
4527 | + * of this software and associated documentation files (the "Software"), to | |
4528 | + * deal in the Software without restriction, including without limitation the | |
4529 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
4530 | + * sell copies of the Software, and to permit persons to whom the Software is | |
4531 | + * furnished to do so, subject to the following conditions: | |
4532 | + * | |
4533 | + * The above copyright notice and this permission notice shall be included in | |
4534 | + * all copies or substantial portions of the Software. | |
4535 | + * | |
4536 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
4537 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
4538 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
4539 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
4540 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
4541 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
4542 | + * DEALINGS IN THE SOFTWARE. | |
4543 | + * | |
4544 | + * Copyright (c) 2006, Christian Limpach | |
4545 | + */ | |
4546 | + | |
4547 | +#ifndef __XEN_PUBLIC_XEN_COMPAT_H__ | |
4548 | +#define __XEN_PUBLIC_XEN_COMPAT_H__ | |
4549 | + | |
4550 | +#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030209 | |
4551 | + | |
4552 | +#if defined(__XEN__) || defined(__XEN_TOOLS__) | |
4553 | +/* Xen is built with matching headers and implements the latest interface. */ | |
4554 | +#define __XEN_INTERFACE_VERSION__ __XEN_LATEST_INTERFACE_VERSION__ | |
4555 | +#elif !defined(__XEN_INTERFACE_VERSION__) | |
4556 | +/* Guests which do not specify a version get the legacy interface. */ | |
4557 | +#define __XEN_INTERFACE_VERSION__ 0x00000000 | |
4558 | +#endif | |
4559 | + | |
4560 | +#if __XEN_INTERFACE_VERSION__ > __XEN_LATEST_INTERFACE_VERSION__ | |
4561 | +#error "These header files do not support the requested interface version." | |
4562 | +#endif | |
4563 | + | |
4564 | +#endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */ | |
4565 | Index: head-2008-11-25/include/xen/interface/xenoprof.h | |
4566 | =================================================================== | |
4567 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
4568 | +++ head-2008-11-25/include/xen/interface/xenoprof.h 2007-06-12 13:14:19.000000000 +0200 | |
4569 | @@ -0,0 +1,138 @@ | |
4570 | +/****************************************************************************** | |
4571 | + * xenoprof.h | |
4572 | + * | |
4573 | + * Interface for enabling system wide profiling based on hardware performance | |
4574 | + * counters | |
4575 | + * | |
4576 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
4577 | + * of this software and associated documentation files (the "Software"), to | |
4578 | + * deal in the Software without restriction, including without limitation the | |
4579 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
4580 | + * sell copies of the Software, and to permit persons to whom the Software is | |
4581 | + * furnished to do so, subject to the following conditions: | |
4582 | + * | |
4583 | + * The above copyright notice and this permission notice shall be included in | |
4584 | + * all copies or substantial portions of the Software. | |
4585 | + * | |
4586 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
4587 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
4588 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
4589 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
4590 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
4591 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
4592 | + * DEALINGS IN THE SOFTWARE. | |
4593 | + * | |
4594 | + * Copyright (C) 2005 Hewlett-Packard Co. | |
4595 | + * Written by Aravind Menon & Jose Renato Santos | |
4596 | + */ | |
4597 | + | |
4598 | +#ifndef __XEN_PUBLIC_XENOPROF_H__ | |
4599 | +#define __XEN_PUBLIC_XENOPROF_H__ | |
4600 | + | |
4601 | +#include "xen.h" | |
4602 | + | |
4603 | +/* | |
4604 | + * Commands to HYPERVISOR_xenoprof_op(). | |
4605 | + */ | |
4606 | +#define XENOPROF_init 0 | |
4607 | +#define XENOPROF_reset_active_list 1 | |
4608 | +#define XENOPROF_reset_passive_list 2 | |
4609 | +#define XENOPROF_set_active 3 | |
4610 | +#define XENOPROF_set_passive 4 | |
4611 | +#define XENOPROF_reserve_counters 5 | |
4612 | +#define XENOPROF_counter 6 | |
4613 | +#define XENOPROF_setup_events 7 | |
4614 | +#define XENOPROF_enable_virq 8 | |
4615 | +#define XENOPROF_start 9 | |
4616 | +#define XENOPROF_stop 10 | |
4617 | +#define XENOPROF_disable_virq 11 | |
4618 | +#define XENOPROF_release_counters 12 | |
4619 | +#define XENOPROF_shutdown 13 | |
4620 | +#define XENOPROF_get_buffer 14 | |
4621 | +#define XENOPROF_set_backtrace 15 | |
4622 | +#define XENOPROF_last_op 15 | |
4623 | + | |
4624 | +#define MAX_OPROF_EVENTS 32 | |
4625 | +#define MAX_OPROF_DOMAINS 25 | |
4626 | +#define XENOPROF_CPU_TYPE_SIZE 64 | |
4627 | + | |
4628 | +/* Xenoprof performance events (not Xen events) */ | |
4629 | +struct event_log { | |
4630 | + uint64_t eip; | |
4631 | + uint8_t mode; | |
4632 | + uint8_t event; | |
4633 | +}; | |
4634 | + | |
4635 | +/* PC value that indicates a special code */ | |
4636 | +#define XENOPROF_ESCAPE_CODE ~0UL | |
4637 | +/* Transient events for the xenoprof->oprofile cpu buf */ | |
4638 | +#define XENOPROF_TRACE_BEGIN 1 | |
4639 | + | |
4640 | +/* Xenoprof buffer shared between Xen and domain - 1 per VCPU */ | |
4641 | +struct xenoprof_buf { | |
4642 | + uint32_t event_head; | |
4643 | + uint32_t event_tail; | |
4644 | + uint32_t event_size; | |
4645 | + uint32_t vcpu_id; | |
4646 | + uint64_t xen_samples; | |
4647 | + uint64_t kernel_samples; | |
4648 | + uint64_t user_samples; | |
4649 | + uint64_t lost_samples; | |
4650 | + struct event_log event_log[1]; | |
4651 | +}; | |
4652 | +#ifndef __XEN__ | |
4653 | +typedef struct xenoprof_buf xenoprof_buf_t; | |
4654 | +DEFINE_XEN_GUEST_HANDLE(xenoprof_buf_t); | |
4655 | +#endif | |
4656 | + | |
4657 | +struct xenoprof_init { | |
4658 | + int32_t num_events; | |
4659 | + int32_t is_primary; | |
4660 | + char cpu_type[XENOPROF_CPU_TYPE_SIZE]; | |
4661 | +}; | |
4662 | +typedef struct xenoprof_init xenoprof_init_t; | |
4663 | +DEFINE_XEN_GUEST_HANDLE(xenoprof_init_t); | |
4664 | + | |
4665 | +struct xenoprof_get_buffer { | |
4666 | + int32_t max_samples; | |
4667 | + int32_t nbuf; | |
4668 | + int32_t bufsize; | |
4669 | + uint64_t buf_gmaddr; | |
4670 | +}; | |
4671 | +typedef struct xenoprof_get_buffer xenoprof_get_buffer_t; | |
4672 | +DEFINE_XEN_GUEST_HANDLE(xenoprof_get_buffer_t); | |
4673 | + | |
4674 | +struct xenoprof_counter { | |
4675 | + uint32_t ind; | |
4676 | + uint64_t count; | |
4677 | + uint32_t enabled; | |
4678 | + uint32_t event; | |
4679 | + uint32_t hypervisor; | |
4680 | + uint32_t kernel; | |
4681 | + uint32_t user; | |
4682 | + uint64_t unit_mask; | |
4683 | +}; | |
4684 | +typedef struct xenoprof_counter xenoprof_counter_t; | |
4685 | +DEFINE_XEN_GUEST_HANDLE(xenoprof_counter_t); | |
4686 | + | |
4687 | +typedef struct xenoprof_passive { | |
4688 | + uint16_t domain_id; | |
4689 | + int32_t max_samples; | |
4690 | + int32_t nbuf; | |
4691 | + int32_t bufsize; | |
4692 | + uint64_t buf_gmaddr; | |
4693 | +} xenoprof_passive_t; | |
4694 | +DEFINE_XEN_GUEST_HANDLE(xenoprof_passive_t); | |
4695 | + | |
4696 | + | |
4697 | +#endif /* __XEN_PUBLIC_XENOPROF_H__ */ | |
4698 | + | |
4699 | +/* | |
4700 | + * Local variables: | |
4701 | + * mode: C | |
4702 | + * c-set-style: "BSD" | |
4703 | + * c-basic-offset: 4 | |
4704 | + * tab-width: 4 | |
4705 | + * indent-tabs-mode: nil | |
4706 | + * End: | |
4707 | + */ | |
4708 | Index: head-2008-11-25/include/xen/interface/xsm/acm.h | |
4709 | =================================================================== | |
4710 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
4711 | +++ head-2008-11-25/include/xen/interface/xsm/acm.h 2008-07-21 11:00:33.000000000 +0200 | |
4712 | @@ -0,0 +1,235 @@ | |
4713 | +/* | |
4714 | + * acm.h: Xen access control module interface defintions | |
4715 | + * | |
4716 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
4717 | + * of this software and associated documentation files (the "Software"), to | |
4718 | + * deal in the Software without restriction, including without limitation the | |
4719 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
4720 | + * sell copies of the Software, and to permit persons to whom the Software is | |
4721 | + * furnished to do so, subject to the following conditions: | |
4722 | + * | |
4723 | + * The above copyright notice and this permission notice shall be included in | |
4724 | + * all copies or substantial portions of the Software. | |
4725 | + * | |
4726 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
4727 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
4728 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
4729 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
4730 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
4731 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
4732 | + * DEALINGS IN THE SOFTWARE. | |
4733 | + * | |
4734 | + * Reiner Sailer <sailer@watson.ibm.com> | |
4735 | + * Copyright (c) 2005, International Business Machines Corporation. | |
4736 | + */ | |
4737 | + | |
4738 | +#ifndef _XEN_PUBLIC_ACM_H | |
4739 | +#define _XEN_PUBLIC_ACM_H | |
4740 | + | |
4741 | +#include "../xen.h" | |
4742 | + | |
4743 | +/* if ACM_DEBUG defined, all hooks should | |
4744 | + * print a short trace message (comment it out | |
4745 | + * when not in testing mode ) | |
4746 | + */ | |
4747 | +/* #define ACM_DEBUG */ | |
4748 | + | |
4749 | +#ifdef ACM_DEBUG | |
4750 | +# define printkd(fmt, args...) printk(fmt,## args) | |
4751 | +#else | |
4752 | +# define printkd(fmt, args...) | |
4753 | +#endif | |
4754 | + | |
4755 | +/* default ssid reference value if not supplied */ | |
4756 | +#define ACM_DEFAULT_SSID 0x0 | |
4757 | +#define ACM_DEFAULT_LOCAL_SSID 0x0 | |
4758 | + | |
4759 | +/* Internal ACM ERROR types */ | |
4760 | +#define ACM_OK 0 | |
4761 | +#define ACM_UNDEF -1 | |
4762 | +#define ACM_INIT_SSID_ERROR -2 | |
4763 | +#define ACM_INIT_SOID_ERROR -3 | |
4764 | +#define ACM_ERROR -4 | |
4765 | + | |
4766 | +/* External ACCESS DECISIONS */ | |
4767 | +#define ACM_ACCESS_PERMITTED 0 | |
4768 | +#define ACM_ACCESS_DENIED -111 | |
4769 | +#define ACM_NULL_POINTER_ERROR -200 | |
4770 | + | |
4771 | +/* | |
4772 | + Error codes reported in when trying to test for a new policy | |
4773 | + These error codes are reported in an array of tuples where | |
4774 | + each error code is followed by a parameter describing the error | |
4775 | + more closely, such as a domain id. | |
4776 | +*/ | |
4777 | +#define ACM_EVTCHN_SHARING_VIOLATION 0x100 | |
4778 | +#define ACM_GNTTAB_SHARING_VIOLATION 0x101 | |
4779 | +#define ACM_DOMAIN_LOOKUP 0x102 | |
4780 | +#define ACM_CHWALL_CONFLICT 0x103 | |
4781 | +#define ACM_SSIDREF_IN_USE 0x104 | |
4782 | + | |
4783 | + | |
4784 | +/* primary policy in lower 4 bits */ | |
4785 | +#define ACM_NULL_POLICY 0 | |
4786 | +#define ACM_CHINESE_WALL_POLICY 1 | |
4787 | +#define ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY 2 | |
4788 | +#define ACM_POLICY_UNDEFINED 15 | |
4789 | + | |
4790 | +/* combinations have secondary policy component in higher 4bit */ | |
4791 | +#define ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY \ | |
4792 | + ((ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY << 4) | ACM_CHINESE_WALL_POLICY) | |
4793 | + | |
4794 | +/* policy: */ | |
4795 | +#define ACM_POLICY_NAME(X) \ | |
4796 | + ((X) == (ACM_NULL_POLICY)) ? "NULL" : \ | |
4797 | + ((X) == (ACM_CHINESE_WALL_POLICY)) ? "CHINESE WALL" : \ | |
4798 | + ((X) == (ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY)) ? "SIMPLE TYPE ENFORCEMENT" : \ | |
4799 | + ((X) == (ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY)) ? "CHINESE WALL AND SIMPLE TYPE ENFORCEMENT" : \ | |
4800 | + "UNDEFINED" | |
4801 | + | |
4802 | +/* the following policy versions must be increased | |
4803 | + * whenever the interpretation of the related | |
4804 | + * policy's data structure changes | |
4805 | + */ | |
4806 | +#define ACM_POLICY_VERSION 4 | |
4807 | +#define ACM_CHWALL_VERSION 1 | |
4808 | +#define ACM_STE_VERSION 1 | |
4809 | + | |
4810 | +/* defines a ssid reference used by xen */ | |
4811 | +typedef uint32_t ssidref_t; | |
4812 | + | |
4813 | +/* hooks that are known to domains */ | |
4814 | +#define ACMHOOK_none 0 | |
4815 | +#define ACMHOOK_sharing 1 | |
4816 | +#define ACMHOOK_authorization 2 | |
4817 | +#define ACMHOOK_conflictset 3 | |
4818 | + | |
4819 | +/* -------security policy relevant type definitions-------- */ | |
4820 | + | |
4821 | +/* type identifier; compares to "equal" or "not equal" */ | |
4822 | +typedef uint16_t domaintype_t; | |
4823 | + | |
4824 | +/* CHINESE WALL POLICY DATA STRUCTURES | |
4825 | + * | |
4826 | + * current accumulated conflict type set: | |
4827 | + * When a domain is started and has a type that is in | |
4828 | + * a conflict set, the conflicting types are incremented in | |
4829 | + * the aggregate set. When a domain is destroyed, the | |
4830 | + * conflicting types to its type are decremented. | |
4831 | + * If a domain has multiple types, this procedure works over | |
4832 | + * all those types. | |
4833 | + * | |
4834 | + * conflict_aggregate_set[i] holds the number of | |
4835 | + * running domains that have a conflict with type i. | |
4836 | + * | |
4837 | + * running_types[i] holds the number of running domains | |
4838 | + * that include type i in their ssidref-referenced type set | |
4839 | + * | |
4840 | + * conflict_sets[i][j] is "0" if type j has no conflict | |
4841 | + * with type i and is "1" otherwise. | |
4842 | + */ | |
4843 | +/* high-16 = version, low-16 = check magic */ | |
4844 | +#define ACM_MAGIC 0x0001debc | |
4845 | + | |
4846 | +/* size of the SHA1 hash identifying the XML policy from which the | |
4847 | + binary policy was created */ | |
4848 | +#define ACM_SHA1_HASH_SIZE 20 | |
4849 | + | |
4850 | +/* each offset in bytes from start of the struct they | |
4851 | + * are part of */ | |
4852 | + | |
4853 | +/* V3 of the policy buffer aded a version structure */ | |
4854 | +struct acm_policy_version | |
4855 | +{ | |
4856 | + uint32_t major; | |
4857 | + uint32_t minor; | |
4858 | +}; | |
4859 | + | |
4860 | + | |
4861 | +/* each buffer consists of all policy information for | |
4862 | + * the respective policy given in the policy code | |
4863 | + * | |
4864 | + * acm_policy_buffer, acm_chwall_policy_buffer, | |
4865 | + * and acm_ste_policy_buffer need to stay 32-bit aligned | |
4866 | + * because we create binary policies also with external | |
4867 | + * tools that assume packed representations (e.g. the java tool) | |
4868 | + */ | |
4869 | +struct acm_policy_buffer { | |
4870 | + uint32_t magic; | |
4871 | + uint32_t policy_version; /* ACM_POLICY_VERSION */ | |
4872 | + uint32_t len; | |
4873 | + uint32_t policy_reference_offset; | |
4874 | + uint32_t primary_policy_code; | |
4875 | + uint32_t primary_buffer_offset; | |
4876 | + uint32_t secondary_policy_code; | |
4877 | + uint32_t secondary_buffer_offset; | |
4878 | + struct acm_policy_version xml_pol_version; /* add in V3 */ | |
4879 | + uint8_t xml_policy_hash[ACM_SHA1_HASH_SIZE]; /* added in V4 */ | |
4880 | +}; | |
4881 | + | |
4882 | + | |
4883 | +struct acm_policy_reference_buffer { | |
4884 | + uint32_t len; | |
4885 | +}; | |
4886 | + | |
4887 | +struct acm_chwall_policy_buffer { | |
4888 | + uint32_t policy_version; /* ACM_CHWALL_VERSION */ | |
4889 | + uint32_t policy_code; | |
4890 | + uint32_t chwall_max_types; | |
4891 | + uint32_t chwall_max_ssidrefs; | |
4892 | + uint32_t chwall_max_conflictsets; | |
4893 | + uint32_t chwall_ssid_offset; | |
4894 | + uint32_t chwall_conflict_sets_offset; | |
4895 | + uint32_t chwall_running_types_offset; | |
4896 | + uint32_t chwall_conflict_aggregate_offset; | |
4897 | +}; | |
4898 | + | |
4899 | +struct acm_ste_policy_buffer { | |
4900 | + uint32_t policy_version; /* ACM_STE_VERSION */ | |
4901 | + uint32_t policy_code; | |
4902 | + uint32_t ste_max_types; | |
4903 | + uint32_t ste_max_ssidrefs; | |
4904 | + uint32_t ste_ssid_offset; | |
4905 | +}; | |
4906 | + | |
4907 | +struct acm_stats_buffer { | |
4908 | + uint32_t magic; | |
4909 | + uint32_t len; | |
4910 | + uint32_t primary_policy_code; | |
4911 | + uint32_t primary_stats_offset; | |
4912 | + uint32_t secondary_policy_code; | |
4913 | + uint32_t secondary_stats_offset; | |
4914 | +}; | |
4915 | + | |
4916 | +struct acm_ste_stats_buffer { | |
4917 | + uint32_t ec_eval_count; | |
4918 | + uint32_t gt_eval_count; | |
4919 | + uint32_t ec_denied_count; | |
4920 | + uint32_t gt_denied_count; | |
4921 | + uint32_t ec_cachehit_count; | |
4922 | + uint32_t gt_cachehit_count; | |
4923 | +}; | |
4924 | + | |
4925 | +struct acm_ssid_buffer { | |
4926 | + uint32_t len; | |
4927 | + ssidref_t ssidref; | |
4928 | + uint32_t policy_reference_offset; | |
4929 | + uint32_t primary_policy_code; | |
4930 | + uint32_t primary_max_types; | |
4931 | + uint32_t primary_types_offset; | |
4932 | + uint32_t secondary_policy_code; | |
4933 | + uint32_t secondary_max_types; | |
4934 | + uint32_t secondary_types_offset; | |
4935 | +}; | |
4936 | + | |
4937 | +#endif | |
4938 | + | |
4939 | +/* | |
4940 | + * Local variables: | |
4941 | + * mode: C | |
4942 | + * c-set-style: "BSD" | |
4943 | + * c-basic-offset: 4 | |
4944 | + * tab-width: 4 | |
4945 | + * indent-tabs-mode: nil | |
4946 | + * End: | |
4947 | + */ | |
4948 | Index: head-2008-11-25/include/xen/interface/xsm/acm_ops.h | |
4949 | =================================================================== | |
4950 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
4951 | +++ head-2008-11-25/include/xen/interface/xsm/acm_ops.h 2007-10-22 13:39:15.000000000 +0200 | |
4952 | @@ -0,0 +1,159 @@ | |
4953 | +/* | |
4954 | + * acm_ops.h: Xen access control module hypervisor commands | |
4955 | + * | |
4956 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
4957 | + * of this software and associated documentation files (the "Software"), to | |
4958 | + * deal in the Software without restriction, including without limitation the | |
4959 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
4960 | + * sell copies of the Software, and to permit persons to whom the Software is | |
4961 | + * furnished to do so, subject to the following conditions: | |
4962 | + * | |
4963 | + * The above copyright notice and this permission notice shall be included in | |
4964 | + * all copies or substantial portions of the Software. | |
4965 | + * | |
4966 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
4967 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
4968 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
4969 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
4970 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
4971 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
4972 | + * DEALINGS IN THE SOFTWARE. | |
4973 | + * | |
4974 | + * Reiner Sailer <sailer@watson.ibm.com> | |
4975 | + * Copyright (c) 2005,2006 International Business Machines Corporation. | |
4976 | + */ | |
4977 | + | |
4978 | +#ifndef __XEN_PUBLIC_ACM_OPS_H__ | |
4979 | +#define __XEN_PUBLIC_ACM_OPS_H__ | |
4980 | + | |
4981 | +#include "../xen.h" | |
4982 | +#include "acm.h" | |
4983 | + | |
4984 | +/* | |
4985 | + * Make sure you increment the interface version whenever you modify this file! | |
4986 | + * This makes sure that old versions of acm tools will stop working in a | |
4987 | + * well-defined way (rather than crashing the machine, for instance). | |
4988 | + */ | |
4989 | +#define ACM_INTERFACE_VERSION 0xAAAA000A | |
4990 | + | |
4991 | +/************************************************************************/ | |
4992 | + | |
4993 | +/* | |
4994 | + * Prototype for this hypercall is: | |
4995 | + * int acm_op(int cmd, void *args) | |
4996 | + * @cmd == ACMOP_??? (access control module operation). | |
4997 | + * @args == Operation-specific extra arguments (NULL if none). | |
4998 | + */ | |
4999 | + | |
5000 | + | |
5001 | +#define ACMOP_setpolicy 1 | |
5002 | +struct acm_setpolicy { | |
5003 | + /* IN */ | |
5004 | + XEN_GUEST_HANDLE_64(void) pushcache; | |
5005 | + uint32_t pushcache_size; | |
5006 | +}; | |
5007 | + | |
5008 | + | |
5009 | +#define ACMOP_getpolicy 2 | |
5010 | +struct acm_getpolicy { | |
5011 | + /* IN */ | |
5012 | + XEN_GUEST_HANDLE_64(void) pullcache; | |
5013 | + uint32_t pullcache_size; | |
5014 | +}; | |
5015 | + | |
5016 | + | |
5017 | +#define ACMOP_dumpstats 3 | |
5018 | +struct acm_dumpstats { | |
5019 | + /* IN */ | |
5020 | + XEN_GUEST_HANDLE_64(void) pullcache; | |
5021 | + uint32_t pullcache_size; | |
5022 | +}; | |
5023 | + | |
5024 | + | |
5025 | +#define ACMOP_getssid 4 | |
5026 | +#define ACM_GETBY_ssidref 1 | |
5027 | +#define ACM_GETBY_domainid 2 | |
5028 | +struct acm_getssid { | |
5029 | + /* IN */ | |
5030 | + uint32_t get_ssid_by; /* ACM_GETBY_* */ | |
5031 | + union { | |
5032 | + domaintype_t domainid; | |
5033 | + ssidref_t ssidref; | |
5034 | + } id; | |
5035 | + XEN_GUEST_HANDLE_64(void) ssidbuf; | |
5036 | + uint32_t ssidbuf_size; | |
5037 | +}; | |
5038 | + | |
5039 | +#define ACMOP_getdecision 5 | |
5040 | +struct acm_getdecision { | |
5041 | + /* IN */ | |
5042 | + uint32_t get_decision_by1; /* ACM_GETBY_* */ | |
5043 | + uint32_t get_decision_by2; /* ACM_GETBY_* */ | |
5044 | + union { | |
5045 | + domaintype_t domainid; | |
5046 | + ssidref_t ssidref; | |
5047 | + } id1; | |
5048 | + union { | |
5049 | + domaintype_t domainid; | |
5050 | + ssidref_t ssidref; | |
5051 | + } id2; | |
5052 | + uint32_t hook; | |
5053 | + /* OUT */ | |
5054 | + uint32_t acm_decision; | |
5055 | +}; | |
5056 | + | |
5057 | + | |
5058 | +#define ACMOP_chgpolicy 6 | |
5059 | +struct acm_change_policy { | |
5060 | + /* IN */ | |
5061 | + XEN_GUEST_HANDLE_64(void) policy_pushcache; | |
5062 | + uint32_t policy_pushcache_size; | |
5063 | + XEN_GUEST_HANDLE_64(void) del_array; | |
5064 | + uint32_t delarray_size; | |
5065 | + XEN_GUEST_HANDLE_64(void) chg_array; | |
5066 | + uint32_t chgarray_size; | |
5067 | + /* OUT */ | |
5068 | + /* array with error code */ | |
5069 | + XEN_GUEST_HANDLE_64(void) err_array; | |
5070 | + uint32_t errarray_size; | |
5071 | +}; | |
5072 | + | |
5073 | +#define ACMOP_relabeldoms 7 | |
5074 | +struct acm_relabel_doms { | |
5075 | + /* IN */ | |
5076 | + XEN_GUEST_HANDLE_64(void) relabel_map; | |
5077 | + uint32_t relabel_map_size; | |
5078 | + /* OUT */ | |
5079 | + XEN_GUEST_HANDLE_64(void) err_array; | |
5080 | + uint32_t errarray_size; | |
5081 | +}; | |
5082 | + | |
5083 | +/* future interface to Xen */ | |
5084 | +struct xen_acmctl { | |
5085 | + uint32_t cmd; | |
5086 | + uint32_t interface_version; | |
5087 | + union { | |
5088 | + struct acm_setpolicy setpolicy; | |
5089 | + struct acm_getpolicy getpolicy; | |
5090 | + struct acm_dumpstats dumpstats; | |
5091 | + struct acm_getssid getssid; | |
5092 | + struct acm_getdecision getdecision; | |
5093 | + struct acm_change_policy change_policy; | |
5094 | + struct acm_relabel_doms relabel_doms; | |
5095 | + } u; | |
5096 | +}; | |
5097 | + | |
5098 | +typedef struct xen_acmctl xen_acmctl_t; | |
5099 | +DEFINE_XEN_GUEST_HANDLE(xen_acmctl_t); | |
5100 | + | |
5101 | +#endif /* __XEN_PUBLIC_ACM_OPS_H__ */ | |
5102 | + | |
5103 | +/* | |
5104 | + * Local variables: | |
5105 | + * mode: C | |
5106 | + * c-set-style: "BSD" | |
5107 | + * c-basic-offset: 4 | |
5108 | + * tab-width: 4 | |
5109 | + * indent-tabs-mode: nil | |
5110 | + * End: | |
5111 | + */ | |
5112 | Index: head-2008-11-25/include/xen/interface/xsm/flask_op.h | |
5113 | =================================================================== | |
5114 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
5115 | +++ head-2008-11-25/include/xen/interface/xsm/flask_op.h 2008-09-01 12:07:31.000000000 +0200 | |
5116 | @@ -0,0 +1,45 @@ | |
5117 | +/* | |
5118 | + * This file contains the flask_op hypercall commands and definitions. | |
5119 | + * | |
5120 | + * Author: George Coker, <gscoker@alpha.ncsc.mil> | |
5121 | + * | |
5122 | + * This program is free software; you can redistribute it and/or modify | |
5123 | + * it under the terms of the GNU General Public License version 2, | |
5124 | + * as published by the Free Software Foundation. | |
5125 | + */ | |
5126 | + | |
5127 | +#ifndef __FLASK_OP_H__ | |
5128 | +#define __FLASK_OP_H__ | |
5129 | + | |
5130 | +#define FLASK_LOAD 1 | |
5131 | +#define FLASK_GETENFORCE 2 | |
5132 | +#define FLASK_SETENFORCE 3 | |
5133 | +#define FLASK_CONTEXT_TO_SID 4 | |
5134 | +#define FLASK_SID_TO_CONTEXT 5 | |
5135 | +#define FLASK_ACCESS 6 | |
5136 | +#define FLASK_CREATE 7 | |
5137 | +#define FLASK_RELABEL 8 | |
5138 | +#define FLASK_USER 9 | |
5139 | +#define FLASK_POLICYVERS 10 | |
5140 | +#define FLASK_GETBOOL 11 | |
5141 | +#define FLASK_SETBOOL 12 | |
5142 | +#define FLASK_COMMITBOOLS 13 | |
5143 | +#define FLASK_MLS 14 | |
5144 | +#define FLASK_DISABLE 15 | |
5145 | +#define FLASK_GETAVC_THRESHOLD 16 | |
5146 | +#define FLASK_SETAVC_THRESHOLD 17 | |
5147 | +#define FLASK_AVC_HASHSTATS 18 | |
5148 | +#define FLASK_AVC_CACHESTATS 19 | |
5149 | +#define FLASK_MEMBER 20 | |
5150 | + | |
5151 | +#define FLASK_LAST FLASK_MEMBER | |
5152 | + | |
5153 | +typedef struct flask_op { | |
5154 | + uint32_t cmd; | |
5155 | + uint32_t size; | |
5156 | + char *buf; | |
5157 | +} flask_op_t; | |
5158 | + | |
5159 | +DEFINE_XEN_GUEST_HANDLE(flask_op_t); | |
5160 | + | |
5161 | +#endif |