4 * \brief X86 virtualization interface.
7 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8 * Alexander Warg <warg@os.inf.tu-dresden.de>
9 * economic rights: Technische Universität Dresden (Germany)
11 * This file is part of TUD:OS and distributed under the terms of the
12 * GNU General Public License 2.
13 * Please see the COPYING-GPL-2 file for details.
15 * As a special exception, you may use this file as part of a free software
16 * library without restriction. Specifically, if other files instantiate
17 * templates or use macros or inline functions from this file, or you compile
18 * this file and link it with other files to produce an executable, this
19 * file does not by itself cause the resulting executable to be covered by
20 * the GNU General Public License. This exception does not however
21 * invalidate any other reasons why the executable file might be covered by
22 * the GNU General Public License.
26 #include <l4/sys/types.h>
29 * \defgroup l4_vm_svm_api VM API for SVM
30 * \brief Virtual machine API for SVM.
36 * \brief VMCB structure for SVM VMs
37 * \ingroup l4_vm_svm_api
39 typedef struct l4_vm_svm_vmcb_control_area
41 l4_uint16_t intercept_rd_crX;
42 l4_uint16_t intercept_wr_crX;
44 l4_uint16_t intercept_rd_drX;
45 l4_uint16_t intercept_wr_drX;
47 l4_uint32_t intercept_exceptions;
49 l4_uint32_t intercept_instruction0;
50 l4_uint32_t intercept_instruction1;
52 l4_uint8_t _reserved0[44];
54 l4_uint64_t iopm_base_pa;
55 l4_uint64_t msrpm_base_pa;
56 l4_uint64_t tsc_offset;
57 l4_uint64_t guest_asid_tlb_ctl;
58 l4_uint64_t interrupt_ctl;
59 l4_uint64_t interrupt_shadow;
61 l4_uint64_t exitinfo1;
62 l4_uint64_t exitinfo2;
63 l4_uint64_t exitintinfo;
64 l4_uint64_t np_enable;
66 l4_uint8_t _reserved1[16];
70 l4_uint64_t lbr_virtualization_enable;
72 l4_uint8_t _reserved2[832];
73 } __attribute__((packed)) l4_vm_svm_vmcb_control_area_t;
76 * \brief State save area segment selector struct
77 * \ingroup l4_vm_svm_api
79 typedef struct l4_vm_svm_vmcb_state_save_area_seg
85 } __attribute__((packed)) l4_vm_svm_vmcb_state_save_area_seg_t;
88 * \brief State save area structure for SVM VMs
89 * \ingroup l4_vm_svm_api
91 typedef struct l4_vm_svm_vmcb_state_save_area
93 struct l4_vm_svm_vmcb_state_save_area_seg es;
94 struct l4_vm_svm_vmcb_state_save_area_seg cs;
95 struct l4_vm_svm_vmcb_state_save_area_seg ss;
96 struct l4_vm_svm_vmcb_state_save_area_seg ds;
97 struct l4_vm_svm_vmcb_state_save_area_seg fs;
98 struct l4_vm_svm_vmcb_state_save_area_seg gs;
99 struct l4_vm_svm_vmcb_state_save_area_seg gdtr;
100 struct l4_vm_svm_vmcb_state_save_area_seg ldtr;
101 struct l4_vm_svm_vmcb_state_save_area_seg idtr;
102 struct l4_vm_svm_vmcb_state_save_area_seg tr;
104 l4_uint8_t _reserved0[43];
108 l4_uint32_t _reserved1;
112 l4_uint8_t _reserved2[112];
122 l4_uint8_t _reserved3[88];
126 l4_uint8_t _reserved4[24];
133 l4_uint64_t kernelgsbase;
134 l4_uint64_t sysenter_cs;
135 l4_uint64_t sysenter_esp;
136 l4_uint64_t sysenter_eip;
139 l4_uint8_t _reserved5[32];
145 l4_uint64_t lastexcpfrom;
146 l4_uint64_t last_excpto;
148 l4_uint8_t _reserved6[2408];
149 } __attribute__((packed)) l4_vm_svm_vmcb_state_save_area_t;
153 * \brief Control structure for SVM VMs
154 * \ingroup l4_vm_svm_api
156 typedef struct l4_vm_svm_vmcb_t
158 l4_vm_svm_vmcb_control_area_t control_area;
159 l4_vm_svm_vmcb_state_save_area_t state_save_area;