vmcs_intel_x64_state.h
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #ifndef VMCS_INTEL_X64_STATE_H
23 #define VMCS_INTEL_X64_STATE_H
24 
25 #include <intrinsics/x64.h>
26 #include <intrinsics/gdt_x64.h>
27 #include <intrinsics/idt_x64.h>
28 #include <intrinsics/tss_x64.h>
29 #include <intrinsics/srs_x64.h>
30 #include <intrinsics/debug_x64.h>
31 #include <intrinsics/rflags_x64.h>
34 
57 {
58 public:
59 
60  using integer_pointer = uintptr_t;
61 
62  vmcs_intel_x64_state() = default;
63  virtual ~vmcs_intel_x64_state() = default;
64 
66  { return 0; }
68  { return 0; }
70  { return 0; }
72  { return 0; }
74  { return 0; }
76  { return 0; }
78  { return 0; }
80  { return 0; }
81 
83  { (void) val; }
85  { (void) val; }
87  { (void) val; }
89  { (void) val; }
91  { (void) val; }
93  { (void) val; }
95  { (void) val; }
97  { (void) val; }
98 
100  { return 0; }
102  { return 0; }
104  { return 0; }
105  virtual x64::dr7::value_type dr7() const
106  { return 0; }
107 
109  { (void) val; }
111  { (void) val; }
113  { (void) val; }
114  virtual void set_dr7(x64::dr7::value_type val)
115  { (void) val; }
116 
118  { return 0; }
120  { (void) val; }
121 
123  { return 0; }
125  { return 0; }
126 
128  { (void) val; }
130  { (void) val; }
131 
133  { return 0; }
135  { return 0; }
136 
138  { (void) val; }
140  { (void) val; }
141 
143  { return 0; }
145  { return 0; }
147  { return 0; }
149  { return 0; }
151  { return 0; }
153  { return 0; }
155  { return 0; }
157  { return 0; }
158 
160  { (void) val; }
162  { (void) val; }
164  { (void) val; }
166  { (void) val; }
168  { (void) val; }
170  { (void) val; }
172  { (void) val; }
174  { (void) val; }
175 
177  { return x64::access_rights::unusable; }
179  { return x64::access_rights::unusable; }
181  { return x64::access_rights::unusable; }
183  { return x64::access_rights::unusable; }
185  { return x64::access_rights::unusable; }
187  { return x64::access_rights::unusable; }
189  { return x64::access_rights::unusable; }
191  { return x64::access_rights::unusable; }
192 
194  { (void) val; }
196  { (void) val; }
198  { (void) val; }
200  { (void) val; }
202  { (void) val; }
204  { (void) val; }
206  { (void) val; }
208  { (void) val; }
209 
210  virtual gdt_x64::base_type es_base() const
211  { return 0; }
212  virtual gdt_x64::base_type cs_base() const
213  { return 0; }
214  virtual gdt_x64::base_type ss_base() const
215  { return 0; }
216  virtual gdt_x64::base_type ds_base() const
217  { return 0; }
218  virtual gdt_x64::base_type fs_base() const
219  { return 0; }
220  virtual gdt_x64::base_type gs_base() const
221  { return 0; }
223  { return 0; }
224  virtual gdt_x64::base_type tr_base() const
225  { return 0; }
226 
227  virtual void set_es_base(gdt_x64::base_type val)
228  { (void) val; }
229  virtual void set_cs_base(gdt_x64::base_type val)
230  { (void) val; }
231  virtual void set_ss_base(gdt_x64::base_type val)
232  { (void) val; }
233  virtual void set_ds_base(gdt_x64::base_type val)
234  { (void) val; }
235  virtual void set_fs_base(gdt_x64::base_type val)
236  { (void) val; }
237  virtual void set_gs_base(gdt_x64::base_type val)
238  { (void) val; }
240  { (void) val; }
241  virtual void set_tr_base(gdt_x64::base_type val)
242  { (void) val; }
243 
245  { return 0; }
247  { return 0; }
249  { return 0; }
251  { return 0; }
253  { return 0; }
255  { return 0; }
257  { return 0; }
259  { return 0; }
261  { return 0; }
262 
264  { (void) val; }
266  { (void) val; }
268  { (void) val; }
270  { (void) val; }
272  { (void) val; }
274  { (void) val; }
276  { (void) val; }
278  { (void) val; }
280  { (void) val; }
281 
282  virtual bool is_guest()
283  { return false; }
284 
285  virtual void dump() const {}
286 };
287 
288 #endif
virtual void set_tr(x64::segment_register::type val)
virtual void set_gs_limit(gdt_x64::limit_type val)
virtual void set_es_base(gdt_x64::base_type val)
virtual void set_ia32_sysenter_cs_msr(intel_x64::msrs::value_type val)
virtual void set_fs_base(gdt_x64::base_type val)
virtual void set_ds_limit(gdt_x64::limit_type val)
virtual void set_cs(x64::segment_register::type val)
virtual intel_x64::cr0::value_type cr0() const
virtual intel_x64::cr3::value_type cr3() const
virtual gdt_x64::access_rights_type ldtr_access_rights() const
virtual gdt_x64::access_rights_type gs_access_rights() const
virtual void set_ia32_debugctl_msr(intel_x64::msrs::value_type val)
virtual x64::segment_register::type es() const
virtual gdt_x64::limit_type es_limit() const
virtual void set_cr4(intel_x64::cr4::value_type val)
virtual gdt_x64::limit_type ldtr_limit() const
virtual intel_x64::msrs::value_type ia32_gs_base_msr() const
virtual void set_ss_access_rights(gdt_x64::access_rights_type val)
virtual x64::segment_register::type cs() const
virtual intel_x64::msrs::value_type ia32_sysenter_esp_msr() const
virtual gdt_x64::limit_type cs_limit() const
virtual void set_ia32_fs_base_msr(intel_x64::msrs::value_type val)
virtual gdt_x64::limit_type gs_limit() const
virtual void set_tr_limit(gdt_x64::limit_type val)
virtual gdt_x64::base_type ldtr_base() const
virtual void set_ss_base(gdt_x64::base_type val)
virtual x64::segment_register::type ldtr() const
virtual gdt_x64::base_type ds_base() const
virtual void set_ia32_sysenter_esp_msr(intel_x64::msrs::value_type val)
virtual intel_x64::msrs::value_type ia32_sysenter_cs_msr() const
virtual void set_cs_base(gdt_x64::base_type val)
virtual gdt_x64::limit_type ss_limit() const
uint64_t value_type
Definition: debug_x64.h:34
virtual void set_gdt_limit(gdt_x64::size_type val)
virtual void set_tr_access_rights(gdt_x64::access_rights_type val)
virtual void set_ldtr(x64::segment_register::type val)
virtual void set_ia32_gs_base_msr(intel_x64::msrs::value_type val)
virtual gdt_x64::base_type tr_base() const
virtual x64::segment_register::type tr() const
constexpr const auto unusable
Definition: x64.h:90
virtual gdt_x64::access_rights_type es_access_rights() const
virtual void set_ldtr_base(gdt_x64::base_type val)
virtual void set_ia32_sysenter_eip_msr(intel_x64::msrs::value_type val)
virtual void set_ds_access_rights(gdt_x64::access_rights_type val)
virtual void set_es(x64::segment_register::type val)
virtual x64::segment_register::type ss() const
uint64_t value_type
Definition: crs_intel_x64.h:46
virtual ~vmcs_intel_x64_state()=default
virtual gdt_x64::size_type gdt_limit() const
virtual x64::segment_register::type fs() const
virtual void set_ia32_perf_global_ctrl_msr(intel_x64::msrs::value_type val)
virtual void set_gdt_base(gdt_x64::integer_pointer val)
virtual void set_cr0(intel_x64::cr0::value_type val)
virtual gdt_x64::base_type es_base() const
virtual void set_ss_limit(gdt_x64::limit_type val)
virtual gdt_x64::limit_type ds_limit() const
virtual void set_es_access_rights(gdt_x64::access_rights_type val)
uintptr_t integer_pointer
Definition: idt_x64.h:159
virtual void set_ia32_pat_msr(intel_x64::msrs::value_type val)
virtual x64::segment_register::type gs() const
virtual void set_cs_limit(gdt_x64::limit_type val)
virtual void set_cr3(intel_x64::cr3::value_type val)
virtual gdt_x64::access_rights_type fs_access_rights() const
virtual intel_x64::msrs::value_type ia32_efer_msr() const
virtual gdt_x64::limit_type fs_limit() const
virtual intel_x64::msrs::value_type ia32_perf_global_ctrl_msr() const
virtual void set_tr_base(gdt_x64::base_type val)
uint32_t access_rights_type
Definition: gdt_x64.h:199
virtual void set_ia32_efer_msr(intel_x64::msrs::value_type val)
virtual void set_ds_base(gdt_x64::base_type val)
virtual gdt_x64::base_type cs_base() const
virtual void set_cs_access_rights(gdt_x64::access_rights_type val)
vmcs_intel_x64_state()=default
uint16_t size_type
Definition: idt_x64.h:158
virtual void set_rflags(x64::rflags::value_type val)
uint64_t base_type
Definition: gdt_x64.h:197
virtual intel_x64::cr4::value_type cr4() const
virtual idt_x64::size_type idt_limit() const
uint64_t value_type
Definition: rflags_x64.h:39
virtual gdt_x64::base_type fs_base() const
virtual gdt_x64::limit_type tr_limit() const
virtual gdt_x64::access_rights_type ds_access_rights() const
virtual gdt_x64::access_rights_type cs_access_rights() const
virtual x64::segment_register::type ds() const
virtual void set_gs(x64::segment_register::type val)
virtual intel_x64::msrs::value_type ia32_sysenter_eip_msr() const
virtual x64::dr7::value_type dr7() const
virtual gdt_x64::base_type gs_base() const
uint64_t value_type
virtual void set_dr7(x64::dr7::value_type val)
virtual gdt_x64::base_type ss_base() const
virtual intel_x64::msrs::value_type ia32_debugctl_msr() const
virtual void set_gs_base(gdt_x64::base_type val)
virtual gdt_x64::access_rights_type ss_access_rights() const
virtual void set_fs(x64::segment_register::type val)
virtual void set_gs_access_rights(gdt_x64::access_rights_type val)
virtual void set_idt_base(idt_x64::integer_pointer val)
virtual void set_idt_limit(idt_x64::size_type val)
virtual idt_x64::integer_pointer idt_base() const
virtual x64::rflags::value_type rflags() const
uintptr_t integer_pointer
Definition: gdt_x64.h:196
uint32_t limit_type
Definition: gdt_x64.h:198
uint64_t value_type
virtual void set_ldtr_limit(gdt_x64::limit_type val)
virtual void set_fs_limit(gdt_x64::limit_type val)
virtual intel_x64::msrs::value_type ia32_pat_msr() const
virtual void set_ldtr_access_rights(gdt_x64::access_rights_type val)
virtual void dump() const
virtual void set_es_limit(gdt_x64::limit_type val)
uint16_t size_type
Definition: gdt_x64.h:194
virtual void set_ss(x64::segment_register::type val)
virtual void set_ds(x64::segment_register::type val)
virtual gdt_x64::access_rights_type tr_access_rights() const
virtual intel_x64::msrs::value_type ia32_fs_base_msr() const
uint64_t value_type
virtual gdt_x64::integer_pointer gdt_base() const
virtual void set_fs_access_rights(gdt_x64::access_rights_type val)