test_vmcs_intel_x64_debug.cpp
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 // Author: Connor Davis <davisc@ainfosec.com>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 
22 #include <test.h>
24 
25 using namespace intel_x64;
26 using namespace msrs;
27 using namespace vmcs;
28 using namespace debug;
29 
30 void
31 vmcs_ut::test_debug_dump()
32 {
33  this->expect_no_exception([&] { dump(); });
34 }
35 
36 void
37 vmcs_ut::test_debug_dump_16bit_control_fields()
38 {
40 }
41 
42 void
43 vmcs_ut::test_debug_dump_16bit_guest_state_fields()
44 {
46 }
47 
48 void
49 vmcs_ut::test_debug_dump_16bit_host_state_fields()
50 {
52 }
53 
54 void
55 vmcs_ut::test_debug_dump_64bit_control_fields()
56 {
58 }
59 
60 void
61 vmcs_ut::test_debug_dump_64bit_read_only_data_field()
62 {
64 }
65 
66 void
67 vmcs_ut::test_debug_dump_64bit_guest_state_fields()
68 {
70 }
71 
72 void
73 vmcs_ut::test_debug_dump_64bit_host_state_fields()
74 {
76 }
77 
78 void
79 vmcs_ut::test_debug_dump_32bit_control_fields()
80 {
82 }
83 
84 void
85 vmcs_ut::test_debug_dump_32bit_read_only_data_fields()
86 {
88 }
89 
90 void
91 vmcs_ut::test_debug_dump_32bit_guest_state_fields()
92 {
94 }
95 
96 void
97 vmcs_ut::test_debug_dump_32bit_host_state_field()
98 {
100 }
101 
102 void
103 vmcs_ut::test_debug_dump_natural_width_control_fields()
104 {
106 }
107 
108 void
109 vmcs_ut::test_debug_dump_natural_width_read_only_data_fields()
110 {
112 }
113 
114 void
115 vmcs_ut::test_debug_dump_natural_width_guest_state_fields()
116 {
118 }
119 
120 void
121 vmcs_ut::test_debug_dump_natural_width_host_state_fields()
122 {
124 }
125 
126 void
127 vmcs_ut::test_debug_dump_vmx_controls()
128 {
129  this->expect_no_exception([&] { dump_vmx_controls(); });
130 }
131 
132 void
133 vmcs_ut::test_debug_dump_pin_based_vm_execution_controls()
134 {
136 }
137 
138 void
139 vmcs_ut::test_debug_dump_primary_processor_based_vm_execution_controls()
140 {
142 }
143 
144 void
145 vmcs_ut::test_debug_dump_secondary_processor_based_vm_execution_controls()
146 {
149 
152 }
153 
154 void
155 vmcs_ut::test_debug_dump_vm_exit_control_fields()
156 {
158 }
159 
160 void
161 vmcs_ut::test_debug_dump_vm_entry_control_fields()
162 {
164 }
165 
166 void
167 vmcs_ut::test_debug_dump_vmcs_field()
168 {
169  auto addr = 0x00UL;
170  auto name = "test";
171  auto exists = true;
172 
174  this->expect_no_exception([&] { dump_vmcs_field(addr, name, !exists); });
175 }
176 
177 void
178 vmcs_ut::test_debug_dump_vm_control()
179 {
180  auto name = "test";
181  auto is_set = true;
182 
183  this->expect_no_exception([&] { dump_vm_control(name, is_set); });
184  this->expect_no_exception([&] { dump_vm_control(name, !is_set); });
185 }
void dump_vmcs_field(vmcs::field_type addr, const char *name, bool exists)
#define expect_no_exception(f)
Definition: unittest.h:198
void dump_secondary_processor_based_vm_execution_controls()
void dump_vm_control(const char *name, bool is_set)
constexpr const auto addr
Definition: cpuid_x64.h:80
void proc_ctl_allow1(uint64_t mask)
Definition: test.cpp:70
constexpr const auto name
Definition: cpuid_x64.h:81
void dump_primary_processor_based_vm_execution_controls()
void proc_ctl_disallow1(uint64_t mask)
Definition: test.cpp:78