2 * vmx_assist.h: Context definitions for the VMXASSIST world switch.
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
22 * Leendert van Doorn, leendert@watson.ibm.com
23 * Copyright (c) 2005, International Business Machines Corporation.
26 #ifndef _VMX_ASSIST_H_
27 #define _VMX_ASSIST_H_
31 #include <palacios/vm_guest.h>
33 #define VMXASSIST_BASE 0xD0000
34 #define VMXASSIST_MAGIC 0x17101966
37 struct vmx_assist_header {
38 uint64_t rsvd; // 8 bytes of nothing
42 } __attribute__((packed));
46 struct arbyte_fields {
47 unsigned int seg_type : 4,
58 } __attribute__((packed)) fields;
60 } __attribute__((packed));
62 struct vmx_assist_segment {
66 union vmcs_arbytes arbytes;
67 } __attribute__((packed));
72 struct vmx_assist_context {
73 uint32_t eip; /* execution pointer */
74 uint32_t esp; /* stack pointer */
75 uint32_t eflags; /* flags register */
77 uint32_t cr3; /* page table directory */
80 uint32_t idtr_limit; /* idt */
83 uint32_t gdtr_limit; /* gdt */
86 struct vmx_assist_segment cs;
87 struct vmx_assist_segment ds;
88 struct vmx_assist_segment es;
89 struct vmx_assist_segment ss;
90 struct vmx_assist_segment fs;
91 struct vmx_assist_segment gs;
92 struct vmx_assist_segment tr;
93 struct vmx_assist_segment ldtr;
96 unsigned char rm_irqbase[2];
97 } __attribute__((packed));
99 typedef struct vmx_assist_context vmx_assist_context_t;
101 int v3_vmxassist_ctx_switch(struct guest_info * info);
106 #endif /* _VMX_ASSIST_H_ */
114 * indent-tabs-mode: nil