vmcs_intel_x64_32bit_control_fields.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_32BIT_CONTROL_FIELDS_H
23 #define VMCS_INTEL_X64_32BIT_CONTROL_FIELDS_H
24 
25 #include <bitmanip.h>
26 #include <vmcs/vmcs_intel_x64.h>
28 
35 
36 // *INDENT-OFF*
37 
38 namespace intel_x64
39 {
40 namespace vmcs
41 {
42 
43 namespace pin_based_vm_execution_controls
44 {
45  constexpr const auto addr = 0x0000000000004000UL;
46  constexpr const auto name = "pin_based_vm_execution_controls";
48 
49  inline auto exists() noexcept
50  { return true; }
51 
52  inline auto get()
53  { return get_vmcs_field(addr, name, exists()); }
54 
55  inline auto get_if_exists(bool verbose = false) noexcept
56  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
57 
58  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
59  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
60 
61  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
62  void set_if_exists(T val, bool verbose = false) noexcept
63  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
64 
65  namespace external_interrupt_exiting
66  {
67  constexpr const auto mask = 0x0000000000000001UL;
68  constexpr const auto from = 0;
69  constexpr const auto name = "external_interrupt_exiting";
70 
71  inline auto is_enabled()
72  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
73 
74  inline auto is_enabled_if_exists(bool verbose = false) noexcept
75  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
76 
77  inline auto is_disabled()
78  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
79 
80  inline auto is_disabled_if_exists(bool verbose = false) noexcept
81  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
82 
83  inline void enable()
84  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
85 
86  inline void enable_if_allowed(bool verbose = false) noexcept
87  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
88 
89  inline void disable()
90  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
91 
92  inline void disable_if_allowed(bool verbose = false) noexcept
93  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
94  }
95 
96  namespace nmi_exiting
97  {
98  constexpr const auto mask = 0x0000000000000008UL;
99  constexpr const auto from = 3;
100  constexpr const auto name = "nmi_exiting";
101 
102  inline auto is_enabled()
103  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
104 
105  inline auto is_enabled_if_exists(bool verbose = false) noexcept
106  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
107 
108  inline auto is_disabled()
109  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
110 
111  inline auto is_disabled_if_exists(bool verbose = false) noexcept
112  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
113 
114  inline void enable()
115  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
116 
117  inline void enable_if_allowed(bool verbose = false) noexcept
118  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
119 
120  inline void disable()
121  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
122 
123  inline void disable_if_allowed(bool verbose = false) noexcept
124  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
125  }
126 
127  namespace virtual_nmis
128  {
129  constexpr const auto mask = 0x0000000000000020UL;
130  constexpr const auto from = 5;
131  constexpr const auto name = "virtual_nmis";
132 
133  inline auto is_enabled()
134  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
135 
136  inline auto is_enabled_if_exists(bool verbose = false) noexcept
137  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
138 
139  inline auto is_disabled()
140  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
141 
142  inline auto is_disabled_if_exists(bool verbose = false) noexcept
143  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
144 
145  inline void enable()
146  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
147 
148  inline void enable_if_allowed(bool verbose = false) noexcept
149  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
150 
151  inline void disable()
152  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
153 
154  inline void disable_if_allowed(bool verbose = false) noexcept
155  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
156  }
157 
158  namespace activate_vmx_preemption_timer
159  {
160  constexpr const auto mask = 0x0000000000000040UL;
161  constexpr const auto from = 6;
162  constexpr const auto name = "activate_vmx_preemption_timer";
163 
164  inline auto is_enabled()
165  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
166 
167  inline auto is_enabled_if_exists(bool verbose = false) noexcept
168  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
169 
170  inline auto is_disabled()
171  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
172 
173  inline auto is_disabled_if_exists(bool verbose = false) noexcept
174  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
175 
176  inline void enable()
177  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
178 
179  inline void enable_if_allowed(bool verbose = false) noexcept
180  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
181 
182  inline void disable()
183  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
184 
185  inline void disable_if_allowed(bool verbose = false) noexcept
186  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
187  }
188 
189  namespace process_posted_interrupts
190  {
191  constexpr const auto mask = 0x0000000000000080UL;
192  constexpr const auto from = 7;
193  constexpr const auto name = "process_posted_interrupts";
194 
195  inline auto is_enabled()
196  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
197 
198  inline auto is_enabled_if_exists(bool verbose = false) noexcept
199  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
200 
201  inline auto is_disabled()
202  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
203 
204  inline auto is_disabled_if_exists(bool verbose = false) noexcept
205  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
206 
207  inline void enable()
208  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
209 
210  inline void enable_if_allowed(bool verbose = false) noexcept
211  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
212 
213  inline void disable()
214  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
215 
216  inline void disable_if_allowed(bool verbose = false) noexcept
217  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
218  }
219 }
220 
221 namespace primary_processor_based_vm_execution_controls
222 {
223  constexpr const auto addr = 0x0000000000004002UL;
224  constexpr const auto name = "primary_processor_based_vm_execution_controls";
226 
227  inline auto exists() noexcept
228  { return true; }
229 
230  inline auto get()
231  { return get_vmcs_field(addr, name, exists()); }
232 
233  inline auto get_if_exists(bool verbose = false) noexcept
234  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
235 
236  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
237  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
238 
239  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
240  void set_if_exists(T val, bool verbose = false) noexcept
241  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
242 
243  namespace interrupt_window_exiting
244  {
245  constexpr const auto mask = 0x0000000000000004UL;
246  constexpr const auto from = 2;
247  constexpr const auto name = "interrupt_window_exiting";
248 
249  inline auto is_enabled()
250  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
251 
252  inline auto is_enabled_if_exists(bool verbose = false) noexcept
253  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
254 
255  inline auto is_disabled()
256  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
257 
258  inline auto is_disabled_if_exists(bool verbose = false) noexcept
259  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
260 
261  inline void enable()
262  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
263 
264  inline void enable_if_allowed(bool verbose = false) noexcept
265  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
266 
267  inline void disable()
268  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
269 
270  inline void disable_if_allowed(bool verbose = false) noexcept
271  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
272  }
273 
274  namespace use_tsc_offsetting
275  {
276  constexpr const auto mask = 0x0000000000000008UL;
277  constexpr const auto from = 3;
278  constexpr const auto name = "use_tsc_offsetting";
279 
280  inline auto is_enabled()
281  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
282 
283  inline auto is_enabled_if_exists(bool verbose = false) noexcept
284  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
285 
286  inline auto is_disabled()
287  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
288 
289  inline auto is_disabled_if_exists(bool verbose = false) noexcept
290  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
291 
292  inline void enable()
293  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
294 
295  inline void enable_if_allowed(bool verbose = false) noexcept
296  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
297 
298  inline void disable()
299  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
300 
301  inline void disable_if_allowed(bool verbose = false) noexcept
302  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
303  }
304 
305  namespace hlt_exiting
306  {
307  constexpr const auto mask = 0x0000000000000080UL;
308  constexpr const auto from = 7;
309  constexpr const auto name = "hlt_exiting";
310 
311  inline auto is_enabled()
312  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
313 
314  inline auto is_enabled_if_exists(bool verbose = false) noexcept
315  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
316 
317  inline auto is_disabled()
318  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
319 
320  inline auto is_disabled_if_exists(bool verbose = false) noexcept
321  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
322 
323  inline void enable()
324  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
325 
326  inline void enable_if_allowed(bool verbose = false) noexcept
327  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
328 
329  inline void disable()
330  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
331 
332  inline void disable_if_allowed(bool verbose = false) noexcept
333  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
334  }
335 
336  namespace invlpg_exiting
337  {
338  constexpr const auto mask = 0x0000000000000200UL;
339  constexpr const auto from = 9;
340  constexpr const auto name = "invlpg_exiting";
341 
342  inline auto is_enabled()
343  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
344 
345  inline auto is_enabled_if_exists(bool verbose = false) noexcept
346  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
347 
348  inline auto is_disabled()
349  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
350 
351  inline auto is_disabled_if_exists(bool verbose = false) noexcept
352  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
353 
354  inline void enable()
355  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
356 
357  inline void enable_if_allowed(bool verbose = false) noexcept
358  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
359 
360  inline void disable()
361  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
362 
363  inline void disable_if_allowed(bool verbose = false) noexcept
364  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
365  }
366 
367  namespace mwait_exiting
368  {
369  constexpr const auto mask = 0x0000000000000400UL;
370  constexpr const auto from = 10;
371  constexpr const auto name = "mwait_exiting";
372 
373  inline auto is_enabled()
374  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
375 
376  inline auto is_enabled_if_exists(bool verbose = false) noexcept
377  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
378 
379  inline auto is_disabled()
380  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
381 
382  inline auto is_disabled_if_exists(bool verbose = false) noexcept
383  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
384 
385  inline void enable()
386  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
387 
388  inline void enable_if_allowed(bool verbose = false) noexcept
389  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
390 
391  inline void disable()
392  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
393 
394  inline void disable_if_allowed(bool verbose = false) noexcept
395  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
396  }
397 
398  namespace rdpmc_exiting
399  {
400  constexpr const auto mask = 0x0000000000000800UL;
401  constexpr const auto from = 11;
402  constexpr const auto name = "rdpmc_exiting";
403 
404  inline auto is_enabled()
405  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
406 
407  inline auto is_enabled_if_exists(bool verbose = false) noexcept
408  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
409 
410  inline auto is_disabled()
411  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
412 
413  inline auto is_disabled_if_exists(bool verbose = false) noexcept
414  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
415 
416  inline void enable()
417  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
418 
419  inline void enable_if_allowed(bool verbose = false) noexcept
420  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
421 
422  inline void disable()
423  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
424 
425  inline void disable_if_allowed(bool verbose = false) noexcept
426  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
427  }
428 
429  namespace rdtsc_exiting
430  {
431  constexpr const auto mask = 0x0000000000001000UL;
432  constexpr const auto from = 12;
433  constexpr const auto name = "rdtsc_exiting";
434 
435  inline auto is_enabled()
436  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
437 
438  inline auto is_enabled_if_exists(bool verbose = false) noexcept
439  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
440 
441  inline auto is_disabled()
442  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
443 
444  inline auto is_disabled_if_exists(bool verbose = false) noexcept
445  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
446 
447  inline void enable()
448  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
449 
450  inline void enable_if_allowed(bool verbose = false) noexcept
451  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
452 
453  inline void disable()
454  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
455 
456  inline void disable_if_allowed(bool verbose = false) noexcept
457  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
458  }
459 
460  namespace cr3_load_exiting
461  {
462  constexpr const auto mask = 0x0000000000008000UL;
463  constexpr const auto from = 15;
464  constexpr const auto name = "cr3_load_exiting";
465 
466  inline auto is_enabled()
467  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
468 
469  inline auto is_enabled_if_exists(bool verbose = false) noexcept
470  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
471 
472  inline auto is_disabled()
473  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
474 
475  inline auto is_disabled_if_exists(bool verbose = false) noexcept
476  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
477 
478  inline void enable()
479  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
480 
481  inline void enable_if_allowed(bool verbose = false) noexcept
482  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
483 
484  inline void disable()
485  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
486 
487  inline void disable_if_allowed(bool verbose = false) noexcept
488  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
489  }
490 
491  namespace cr3_store_exiting
492  {
493  constexpr const auto mask = 0x0000000000010000UL;
494  constexpr const auto from = 16;
495  constexpr const auto name = "cr3_store_exiting";
496 
497  inline auto is_enabled()
498  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
499 
500  inline auto is_enabled_if_exists(bool verbose = false) noexcept
501  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
502 
503  inline auto is_disabled()
504  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
505 
506  inline auto is_disabled_if_exists(bool verbose = false) noexcept
507  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
508 
509  inline void enable()
510  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
511 
512  inline void enable_if_allowed(bool verbose = false) noexcept
513  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
514 
515  inline void disable()
516  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
517 
518  inline void disable_if_allowed(bool verbose = false) noexcept
519  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
520  }
521 
522  namespace cr8_load_exiting
523  {
524  constexpr const auto mask = 0x0000000000080000UL;
525  constexpr const auto from = 19;
526  constexpr const auto name = "cr8_load_exiting";
527 
528  inline auto is_enabled()
529  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
530 
531  inline auto is_enabled_if_exists(bool verbose = false) noexcept
532  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
533 
534  inline auto is_disabled()
535  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
536 
537  inline auto is_disabled_if_exists(bool verbose = false) noexcept
538  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
539 
540  inline void enable()
541  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
542 
543  inline void enable_if_allowed(bool verbose = false) noexcept
544  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
545 
546  inline void disable()
547  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
548 
549  inline void disable_if_allowed(bool verbose = false) noexcept
550  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
551  }
552 
553  namespace cr8_store_exiting
554  {
555  constexpr const auto mask = 0x0000000000100000UL;
556  constexpr const auto from = 20;
557  constexpr const auto name = "cr8_store_exiting";
558 
559  inline auto is_enabled()
560  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
561 
562  inline auto is_enabled_if_exists(bool verbose = false) noexcept
563  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
564 
565  inline auto is_disabled()
566  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
567 
568  inline auto is_disabled_if_exists(bool verbose = false) noexcept
569  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
570 
571  inline void enable()
572  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
573 
574  inline void enable_if_allowed(bool verbose = false) noexcept
575  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
576 
577  inline void disable()
578  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
579 
580  inline void disable_if_allowed(bool verbose = false) noexcept
581  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
582  }
583 
584  namespace use_tpr_shadow
585  {
586  constexpr const auto mask = 0x0000000000200000UL;
587  constexpr const auto from = 21;
588  constexpr const auto name = "use_tpr_shadow";
589 
590  inline auto is_enabled()
591  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
592 
593  inline auto is_enabled_if_exists(bool verbose = false) noexcept
594  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
595 
596  inline auto is_disabled()
597  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
598 
599  inline auto is_disabled_if_exists(bool verbose = false) noexcept
600  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
601 
602  inline void enable()
603  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
604 
605  inline void enable_if_allowed(bool verbose = false) noexcept
606  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
607 
608  inline void disable()
609  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
610 
611  inline void disable_if_allowed(bool verbose = false) noexcept
612  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
613  }
614 
615  namespace nmi_window_exiting
616  {
617  constexpr const auto mask = 0x0000000000400000UL;
618  constexpr const auto from = 22;
619  constexpr const auto name = "nmi_window_exiting";
620 
621  inline auto is_enabled()
622  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
623 
624  inline auto is_enabled_if_exists(bool verbose = false) noexcept
625  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
626 
627  inline auto is_disabled()
628  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
629 
630  inline auto is_disabled_if_exists(bool verbose = false) noexcept
631  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
632 
633  inline void enable()
634  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
635 
636  inline void enable_if_allowed(bool verbose = false) noexcept
637  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
638 
639  inline void disable()
640  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
641 
642  inline void disable_if_allowed(bool verbose = false) noexcept
643  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
644  }
645 
646  namespace mov_dr_exiting
647  {
648  constexpr const auto mask = 0x0000000000800000UL;
649  constexpr const auto from = 23;
650  constexpr const auto name = "mov_dr_exiting";
651 
652  inline auto is_enabled()
653  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
654 
655  inline auto is_enabled_if_exists(bool verbose = false) noexcept
656  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
657 
658  inline auto is_disabled()
659  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
660 
661  inline auto is_disabled_if_exists(bool verbose = false) noexcept
662  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
663 
664  inline void enable()
665  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
666 
667  inline void enable_if_allowed(bool verbose = false) noexcept
668  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
669 
670  inline void disable()
671  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
672 
673  inline void disable_if_allowed(bool verbose = false) noexcept
674  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
675  }
676 
677  namespace unconditional_io_exiting
678  {
679  constexpr const auto mask = 0x0000000001000000UL;
680  constexpr const auto from = 24;
681  constexpr const auto name = "unconditional_io_exiting";
682 
683  inline auto is_enabled()
684  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
685 
686  inline auto is_enabled_if_exists(bool verbose = false) noexcept
687  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
688 
689  inline auto is_disabled()
690  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
691 
692  inline auto is_disabled_if_exists(bool verbose = false) noexcept
693  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
694 
695  inline void enable()
696  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
697 
698  inline void enable_if_allowed(bool verbose = false) noexcept
699  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
700 
701  inline void disable()
702  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
703 
704  inline void disable_if_allowed(bool verbose = false) noexcept
705  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
706  }
707 
708  namespace use_io_bitmaps
709  {
710  constexpr const auto mask = 0x0000000002000000UL;
711  constexpr const auto from = 25;
712  constexpr const auto name = "use_io_bitmaps";
713 
714  inline auto is_enabled()
715  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
716 
717  inline auto is_enabled_if_exists(bool verbose = false) noexcept
718  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
719 
720  inline auto is_disabled()
721  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
722 
723  inline auto is_disabled_if_exists(bool verbose = false) noexcept
724  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
725 
726  inline void enable()
727  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
728 
729  inline void enable_if_allowed(bool verbose = false) noexcept
730  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
731 
732  inline void disable()
733  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
734 
735  inline void disable_if_allowed(bool verbose = false) noexcept
736  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
737  }
738 
740  {
741  constexpr const auto mask = 0x0000000008000000UL;
742  constexpr const auto from = 27;
743  constexpr const auto name = "monitor_trap_flag";
744 
745  inline auto is_enabled()
746  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
747 
748  inline auto is_enabled_if_exists(bool verbose = false) noexcept
749  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
750 
751  inline auto is_disabled()
752  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
753 
754  inline auto is_disabled_if_exists(bool verbose = false) noexcept
755  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
756 
757  inline void enable()
758  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
759 
760  inline void enable_if_allowed(bool verbose = false) noexcept
761  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
762 
763  inline void disable()
764  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
765 
766  inline void disable_if_allowed(bool verbose = false) noexcept
767  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
768  }
769 
770  namespace use_msr_bitmap
771  {
772  constexpr const auto mask = 0x0000000010000000UL;
773  constexpr const auto from = 28;
774  constexpr const auto name = "use_msr_bitmap";
775 
776  inline auto is_enabled()
777  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
778 
779  inline auto is_enabled_if_exists(bool verbose = false) noexcept
780  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
781 
782  inline auto is_disabled()
783  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
784 
785  inline auto is_disabled_if_exists(bool verbose = false) noexcept
786  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
787 
788  inline void enable()
789  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
790 
791  inline void enable_if_allowed(bool verbose = false) noexcept
792  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
793 
794  inline void disable()
795  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
796 
797  inline void disable_if_allowed(bool verbose = false) noexcept
798  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
799  }
800 
801  namespace monitor_exiting
802  {
803  constexpr const auto mask = 0x0000000020000000UL;
804  constexpr const auto from = 29;
805  constexpr const auto name = "monitor_exiting";
806 
807  inline auto is_enabled()
808  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
809 
810  inline auto is_enabled_if_exists(bool verbose = false) noexcept
811  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
812 
813  inline auto is_disabled()
814  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
815 
816  inline auto is_disabled_if_exists(bool verbose = false) noexcept
817  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
818 
819  inline void enable()
820  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
821 
822  inline void enable_if_allowed(bool verbose = false) noexcept
823  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
824 
825  inline void disable()
826  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
827 
828  inline void disable_if_allowed(bool verbose = false) noexcept
829  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
830  }
831 
832  namespace pause_exiting
833  {
834  constexpr const auto mask = 0x0000000040000000UL;
835  constexpr const auto from = 30;
836  constexpr const auto name = "pause_exiting";
837 
838  inline auto is_enabled()
839  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
840 
841  inline auto is_enabled_if_exists(bool verbose = false) noexcept
842  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
843 
844  inline auto is_disabled()
845  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
846 
847  inline auto is_disabled_if_exists(bool verbose = false) noexcept
848  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
849 
850  inline void enable()
851  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
852 
853  inline void enable_if_allowed(bool verbose = false) noexcept
854  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
855 
856  inline void disable()
857  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
858 
859  inline void disable_if_allowed(bool verbose = false) noexcept
860  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
861  }
862 
863  namespace activate_secondary_controls
864  {
865  constexpr const auto mask = 0x0000000080000000UL;
866  constexpr const auto from = 31;
867  constexpr const auto name = "activate_secondary_controls";
868 
869  inline auto is_enabled()
870  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
871 
872  inline auto is_enabled_if_exists(bool verbose = false) noexcept
873  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
874 
875  inline auto is_disabled()
876  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
877 
878  inline auto is_disabled_if_exists(bool verbose = false) noexcept
879  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
880 
881  inline void enable()
882  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
883 
884  inline void enable_if_allowed(bool verbose = false) noexcept
885  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
886 
887  inline void disable()
888  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
889 
890  inline void disable_if_allowed(bool verbose = false) noexcept
891  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
892  }
893 }
894 
895 namespace exception_bitmap
896 {
897  constexpr const auto addr = 0x0000000000004004UL;
898  constexpr const auto name = "execption_bitmap";
899 
900  inline auto exists() noexcept
901  { return true; }
902 
903  inline auto get()
904  { return get_vmcs_field(addr, name, exists()); }
905 
906  inline auto get_if_exists(bool verbose = false) noexcept
907  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
908 
909  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
910  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
911 
912  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
913  void set_if_exists(T val, bool verbose = false) noexcept
914  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
915 }
916 
917 namespace page_fault_error_code_mask
918 {
919  constexpr const auto addr = 0x0000000000004006UL;
920  constexpr const auto name = "page_fault_error_code_mask";
921 
922  inline auto exists() noexcept
923  { return true; }
924 
925  inline auto get()
926  { return get_vmcs_field(addr, name, exists()); }
927 
928  inline auto get_if_exists(bool verbose = false) noexcept
929  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
930 
931  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
932  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
933 
934  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
935  void set_if_exists(T val, bool verbose = false) noexcept
936  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
937 }
938 
939 namespace page_fault_error_code_match
940 {
941  constexpr const auto addr = 0x0000000000004008UL;
942  constexpr const auto name = "page_fault_error_code_match";
943 
944  inline auto exists() noexcept
945  { return true; }
946 
947  inline auto get()
948  { return get_vmcs_field(addr, name, exists()); }
949 
950  inline auto get_if_exists(bool verbose = false) noexcept
951  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
952 
953  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
954  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
955 
956  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
957  void set_if_exists(T val, bool verbose = false) noexcept
958  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
959 }
960 
961 namespace cr3_target_count
962 {
963  constexpr const auto addr = 0x000000000000400AUL;
964  constexpr const auto name = "cr3_target_count";
965 
966  inline auto exists() noexcept
967  { return true; }
968 
969  inline auto get()
970  { return get_vmcs_field(addr, name, exists()); }
971 
972  inline auto get_if_exists(bool verbose = false) noexcept
973  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
974 
975  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
976  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
977 
978  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
979  void set_if_exists(T val, bool verbose = false) noexcept
980  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
981 }
982 
983 namespace vm_exit_controls
984 {
985  constexpr const auto addr = 0x000000000000400CUL;
986  constexpr const auto name = "vm_exit_controls";
988 
989  inline auto exists() noexcept
990  { return true; }
991 
992  inline auto get()
993  { return get_vmcs_field(addr, name, exists()); }
994 
995  inline auto get_if_exists(bool verbose = false) noexcept
996  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
997 
998  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
999  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1000 
1001  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1002  void set_if_exists(T val, bool verbose = false) noexcept
1003  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1004 
1005  namespace save_debug_controls
1006  {
1007  constexpr const auto mask = 0x0000000000000004UL;
1008  constexpr const auto from = 2;
1009  constexpr const auto name = "save_debug_controls";
1010 
1011  inline auto is_enabled()
1012  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1013 
1014  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1015  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1016 
1017  inline auto is_disabled()
1018  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1019 
1020  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1021  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1022 
1023  inline void enable()
1024  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1025 
1026  inline void enable_if_allowed(bool verbose = false) noexcept
1027  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1028 
1029  inline void disable()
1030  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1031 
1032  inline void disable_if_allowed(bool verbose = false) noexcept
1033  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1034  }
1035 
1036  namespace host_address_space_size
1037  {
1038  constexpr const auto mask = 0x0000000000000200UL;
1039  constexpr const auto from = 9;
1040  constexpr const auto name = "host_address_space_size";
1041 
1042  inline auto is_enabled()
1043  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1044 
1045  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1046  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1047 
1048  inline auto is_disabled()
1049  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1050 
1051  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1052  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1053 
1054  inline void enable()
1055  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1056 
1057  inline void enable_if_allowed(bool verbose = false) noexcept
1058  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1059 
1060  inline void disable()
1061  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1062 
1063  inline void disable_if_allowed(bool verbose = false) noexcept
1064  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1065  }
1066 
1067  namespace load_ia32_perf_global_ctrl
1068  {
1069  constexpr const auto mask = 0x0000000000001000UL;
1070  constexpr const auto from = 12;
1071  constexpr const auto name = "load_ia32_perf_global_ctrl";
1072 
1073  inline auto is_enabled()
1074  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1075 
1076  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1077  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1078 
1079  inline auto is_disabled()
1080  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1081 
1082  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1083  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1084 
1085  inline void enable()
1086  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1087 
1088  inline void enable_if_allowed(bool verbose = false) noexcept
1089  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1090 
1091  inline void disable()
1092  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1093 
1094  inline void disable_if_allowed(bool verbose = false) noexcept
1095  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1096  }
1097 
1098  namespace acknowledge_interrupt_on_exit
1099  {
1100  constexpr const auto mask = 0x0000000000008000UL;
1101  constexpr const auto from = 15;
1102  constexpr const auto name = "acknowledge_interrupt_on_exit";
1103 
1104  inline auto is_enabled()
1105  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1106 
1107  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1108  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1109 
1110  inline auto is_disabled()
1111  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1112 
1113  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1114  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1115 
1116  inline void enable()
1117  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1118 
1119  inline void enable_if_allowed(bool verbose = false) noexcept
1120  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1121 
1122  inline void disable()
1123  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1124 
1125  inline void disable_if_allowed(bool verbose = false) noexcept
1126  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1127  }
1128 
1129  namespace save_ia32_pat
1130  {
1131  constexpr const auto mask = 0x0000000000040000UL;
1132  constexpr const auto from = 18;
1133  constexpr const auto name = "save_ia32_pat";
1134 
1135  inline auto is_enabled()
1136  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1137 
1138  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1139  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1140 
1141  inline auto is_disabled()
1142  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1143 
1144  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1145  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1146 
1147  inline void enable()
1148  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1149 
1150  inline void enable_if_allowed(bool verbose = false) noexcept
1151  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1152 
1153  inline void disable()
1154  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1155 
1156  inline void disable_if_allowed(bool verbose = false) noexcept
1157  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1158  }
1159 
1160  namespace load_ia32_pat
1161  {
1162  constexpr const auto mask = 0x0000000000080000UL;
1163  constexpr const auto from = 19;
1164  constexpr const auto name = "load_ia32_pat";
1165 
1166  inline auto is_enabled()
1167  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1168 
1169  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1170  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1171 
1172  inline auto is_disabled()
1173  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1174 
1175  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1176  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1177 
1178  inline void enable()
1179  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1180 
1181  inline void enable_if_allowed(bool verbose = false) noexcept
1182  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1183 
1184  inline void disable()
1185  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1186 
1187  inline void disable_if_allowed(bool verbose = false) noexcept
1188  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1189  }
1190 
1191  namespace save_ia32_efer
1192  {
1193  constexpr const auto mask = 0x0000000000100000UL;
1194  constexpr const auto from = 20;
1195  constexpr const auto name = "save_ia32_efer";
1196 
1197  inline auto is_enabled()
1198  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1199 
1200  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1201  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1202 
1203  inline auto is_disabled()
1204  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1205 
1206  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1207  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1208 
1209  inline void enable()
1210  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1211 
1212  inline void enable_if_allowed(bool verbose = false) noexcept
1213  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1214 
1215  inline void disable()
1216  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1217 
1218  inline void disable_if_allowed(bool verbose = false) noexcept
1219  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1220  }
1221 
1222  namespace load_ia32_efer
1223  {
1224  constexpr const auto mask = 0x0000000000200000UL;
1225  constexpr const auto from = 21;
1226  constexpr const auto name = "load_ia32_efer";
1227 
1228  inline auto is_enabled()
1229  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1230 
1231  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1232  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1233 
1234  inline auto is_disabled()
1235  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1236 
1237  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1238  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1239 
1240  inline void enable()
1241  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1242 
1243  inline void enable_if_allowed(bool verbose = false) noexcept
1244  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1245 
1246  inline void disable()
1247  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1248 
1249  inline void disable_if_allowed(bool verbose = false) noexcept
1250  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1251  }
1252 
1253  namespace save_vmx_preemption_timer_value
1254  {
1255  constexpr const auto mask = 0x0000000000400000UL;
1256  constexpr const auto from = 22;
1257  constexpr const auto name = "save_vmx_preemption_timer_value";
1258 
1259  inline auto is_enabled()
1260  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1261 
1262  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1263  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1264 
1265  inline auto is_disabled()
1266  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1267 
1268  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1269  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1270 
1271  inline void enable()
1272  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1273 
1274  inline void enable_if_allowed(bool verbose = false) noexcept
1275  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1276 
1277  inline void disable()
1278  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1279 
1280  inline void disable_if_allowed(bool verbose = false) noexcept
1281  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1282  }
1283 
1284  namespace clear_ia32_bndcfgs
1285  {
1286  constexpr const auto mask = 0x0000000000800000UL;
1287  constexpr const auto from = 23;
1288  constexpr const auto name = "clear_ia32_bndcfgs";
1289 
1290  inline auto is_enabled()
1291  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1292 
1293  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1294  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1295 
1296  inline auto is_disabled()
1297  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1298 
1299  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1300  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1301 
1302  inline void enable()
1303  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1304 
1305  inline void enable_if_allowed(bool verbose = false) noexcept
1306  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1307 
1308  inline void disable()
1309  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1310 
1311  inline void disable_if_allowed(bool verbose = false) noexcept
1312  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1313  }
1314 }
1315 
1316 namespace vm_exit_msr_store_count
1317 {
1318  constexpr const auto addr = 0x000000000000400EUL;
1319  constexpr const auto name = "vm_exit_msr_store_count";
1320 
1321  inline auto exists() noexcept
1322  { return true; }
1323 
1324  inline auto get()
1325  { return get_vmcs_field(addr, name, exists()); }
1326 
1327  inline auto get_if_exists(bool verbose = false) noexcept
1328  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1329 
1330  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1331  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1332 
1333  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1334  void set_if_exists(T val, bool verbose = false) noexcept
1335  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1336 }
1337 
1338 namespace vm_exit_msr_load_count
1339 {
1340  constexpr const auto addr = 0x0000000000004010UL;
1341  constexpr const auto name = "vm_exit_msr_load_count";
1342 
1343  inline auto exists() noexcept
1344  { return true; }
1345 
1346  inline auto get()
1347  { return get_vmcs_field(addr, name, exists()); }
1348 
1349  inline auto get_if_exists(bool verbose = false) noexcept
1350  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1351 
1352  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1353  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1354 
1355  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1356  void set_if_exists(T val, bool verbose = false) noexcept
1357  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1358 }
1359 
1360 namespace vm_entry_controls
1361 {
1362  constexpr const auto addr = 0x0000000000004012UL;
1363  constexpr const auto name = "vm_entry_controls";
1365 
1366  inline auto exists() noexcept
1367  { return true; }
1368 
1369  inline auto get()
1370  { return get_vmcs_field(addr, name, exists()); }
1371 
1372  inline auto get_if_exists(bool verbose = false) noexcept
1373  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1374 
1375  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1376  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1377 
1378  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1379  void set_if_exists(T val, bool verbose = false) noexcept
1380  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1381 
1382  namespace load_debug_controls
1383  {
1384  constexpr const auto mask = 0x0000000000000004UL;
1385  constexpr const auto from = 2;
1386  constexpr const auto name = "load_debug_controls";
1387 
1388  inline auto is_enabled()
1389  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1390 
1391  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1392  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1393 
1394  inline auto is_disabled()
1395  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1396 
1397  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1398  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1399 
1400  inline void enable()
1401  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1402 
1403  inline void enable_if_allowed(bool verbose = false) noexcept
1404  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1405 
1406  inline void disable()
1407  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1408 
1409  inline void disable_if_allowed(bool verbose = false) noexcept
1410  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1411  }
1412 
1413  namespace ia_32e_mode_guest
1414  {
1415  constexpr const auto mask = 0x0000000000000200UL;
1416  constexpr const auto from = 9;
1417  constexpr const auto name = "ia_32e_mode_guest";
1418 
1419  inline auto is_enabled()
1420  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1421 
1422  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1423  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1424 
1425  inline auto is_disabled()
1426  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1427 
1428  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1429  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1430 
1431  inline void enable()
1432  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1433 
1434  inline void enable_if_allowed(bool verbose = false) noexcept
1435  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1436 
1437  inline void disable()
1438  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1439 
1440  inline void disable_if_allowed(bool verbose = false) noexcept
1441  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1442  }
1443 
1444  namespace entry_to_smm
1445  {
1446  constexpr const auto mask = 0x0000000000000400UL;
1447  constexpr const auto from = 10;
1448  constexpr const auto name = "entry_to_smm";
1449 
1450  inline auto is_enabled()
1451  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1452 
1453  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1454  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1455 
1456  inline auto is_disabled()
1457  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1458 
1459  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1460  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1461 
1462  inline void enable()
1463  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1464 
1465  inline void enable_if_allowed(bool verbose = false) noexcept
1466  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1467 
1468  inline void disable()
1469  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1470 
1471  inline void disable_if_allowed(bool verbose = false) noexcept
1472  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1473  }
1474 
1475  namespace deactivate_dual_monitor_treatment
1476  {
1477  constexpr const auto mask = 0x0000000000000800UL;
1478  constexpr const auto from = 11;
1479  constexpr const auto name = "deactivate_dual_monitor_treatment";
1480 
1481  inline auto is_enabled()
1482  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1483 
1484  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1485  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1486 
1487  inline auto is_disabled()
1488  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1489 
1490  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1491  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1492 
1493  inline void enable()
1494  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1495 
1496  inline void enable_if_allowed(bool verbose = false) noexcept
1497  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1498 
1499  inline void disable()
1500  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1501 
1502  inline void disable_if_allowed(bool verbose = false) noexcept
1503  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1504  }
1505 
1506  namespace load_ia32_perf_global_ctrl
1507  {
1508  constexpr const auto mask = 0x0000000000002000UL;
1509  constexpr const auto from = 13;
1510  constexpr const auto name = "load_ia32_perf_global_ctrl";
1511 
1512  inline auto is_enabled()
1513  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1514 
1515  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1516  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1517 
1518  inline auto is_disabled()
1519  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1520 
1521  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1522  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1523 
1524  inline void enable()
1525  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1526 
1527  inline void enable_if_allowed(bool verbose = false) noexcept
1528  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1529 
1530  inline void disable()
1531  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1532 
1533  inline void disable_if_allowed(bool verbose = false) noexcept
1534  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1535  }
1536 
1537  namespace load_ia32_pat
1538  {
1539  constexpr const auto mask = 0x0000000000004000UL;
1540  constexpr const auto from = 14;
1541  constexpr const auto name = "load_ia32_pat";
1542 
1543  inline auto is_enabled()
1544  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1545 
1546  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1547  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1548 
1549  inline auto is_disabled()
1550  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1551 
1552  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1553  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1554 
1555  inline void enable()
1556  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1557 
1558  inline void enable_if_allowed(bool verbose = false) noexcept
1559  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1560 
1561  inline void disable()
1562  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1563 
1564  inline void disable_if_allowed(bool verbose = false) noexcept
1565  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1566  }
1567 
1568  namespace load_ia32_efer
1569  {
1570  constexpr const auto mask = 0x0000000000008000UL;
1571  constexpr const auto from = 15;
1572  constexpr const auto name = "load_ia32_efer";
1573 
1574  inline auto is_enabled()
1575  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1576 
1577  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1578  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1579 
1580  inline auto is_disabled()
1581  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1582 
1583  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1584  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1585 
1586  inline void enable()
1587  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1588 
1589  inline void enable_if_allowed(bool verbose = false) noexcept
1590  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1591 
1592  inline void disable()
1593  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1594 
1595  inline void disable_if_allowed(bool verbose = false) noexcept
1596  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1597  }
1598 
1599  namespace load_ia32_bndcfgs
1600  {
1601  constexpr const auto mask = 0x0000000000010000UL;
1602  constexpr const auto from = 16;
1603  constexpr const auto name = "load_ia32_bndcfgs";
1604 
1605  inline auto is_enabled()
1606  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1607 
1608  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1609  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1610 
1611  inline auto is_disabled()
1612  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1613 
1614  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1615  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1616 
1617  inline void enable()
1618  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1619 
1620  inline void enable_if_allowed(bool verbose = false) noexcept
1621  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1622 
1623  inline void disable()
1624  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1625 
1626  inline void disable_if_allowed(bool verbose = false) noexcept
1627  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1628  }
1629 }
1630 
1631 namespace vm_entry_msr_load_count
1632 {
1633  constexpr const auto addr = 0x0000000000004014UL;
1634  constexpr const auto name = "vm_entry_msr_load_count";
1635 
1636  inline auto exists() noexcept
1637  { return true; }
1638 
1639  inline auto get()
1640  { return get_vmcs_field(addr, name, exists()); }
1641 
1642  inline auto get_if_exists(bool verbose = false) noexcept
1643  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1644 
1645  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1646  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1647 
1648  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1649  void set_if_exists(T val, bool verbose = false) noexcept
1650  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1651 }
1652 
1653 namespace vm_entry_interruption_information_field
1654 {
1655  constexpr const auto addr = 0x0000000000004016UL;
1656  constexpr const auto name = "vm_entry_interruption_information_field";
1657 
1658  inline auto exists() noexcept
1659  { return true; }
1660 
1661  inline auto get()
1662  { return get_vmcs_field(addr, name, exists()); }
1663 
1664  inline auto get_if_exists(bool verbose = false) noexcept
1665  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1666 
1667  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1668  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1669 
1670  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1671  void set_if_exists(T val, bool verbose = false) noexcept
1672  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1673 
1674  namespace vector
1675  {
1676  constexpr const auto mask = 0x000000FFUL;
1677  constexpr const auto from = 0;
1678  constexpr const auto name = "vector";
1679 
1680  inline auto get()
1681  { return get_bits(get_vmcs_field(addr, name, exists()), mask) >> from; }
1682 
1683  inline auto get_if_exists(bool verbose = false) noexcept
1684  { return get_bits(get_vmcs_field_if_exists(addr, name, verbose, exists()), mask) >> from; }
1685 
1686  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1687  void set(T val)
1688  {
1689  auto&& field = get_vmcs_field(addr, name, exists());
1690  set_vmcs_field(set_bits(field, mask, (val << from)), addr, name, exists());
1691  }
1692 
1693  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1694  void set_if_exists(T val, bool verbose = false) noexcept
1695  {
1696  auto&& field = get_vmcs_field_if_exists(addr, name, verbose, exists());
1697  set_vmcs_field_if_exists(set_bits(field, mask, (val << from)), addr, name, verbose, exists());
1698  }
1699  }
1700 
1701  namespace interruption_type
1702  {
1703  constexpr const auto mask = 0x00000700UL;
1704  constexpr const auto from = 8;
1705  constexpr const auto name = "interruption_type";
1706 
1707  constexpr const auto external_interrupt = 0UL;
1708  constexpr const auto reserved = 1UL;
1709  constexpr const auto non_maskable_interrupt = 2UL;
1710  constexpr const auto hardware_exception = 3UL;
1711  constexpr const auto software_interrupt = 4UL;
1712  constexpr const auto privileged_software_exception = 5UL;
1713  constexpr const auto software_exception = 6UL;
1714  constexpr const auto other_event = 7UL;
1715 
1716  inline auto get()
1717  { return get_bits(get_vmcs_field(addr, name, exists()), mask) >> from; }
1718 
1719  inline auto get_if_exists(bool verbose = false) noexcept
1720  { return get_bits(get_vmcs_field_if_exists(addr, name, verbose, exists()), mask) >> from; }
1721 
1722  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1723  void set(T val)
1724  {
1725  auto&& field = get_vmcs_field(addr, name, exists());
1726  set_vmcs_field(set_bits(field, mask, (val << from)), addr, name, exists());
1727  }
1728 
1729  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1730  void set_if_exists(T val, bool verbose = false) noexcept
1731  {
1732  auto&& field = get_vmcs_field_if_exists(addr, name, verbose, exists());
1733  set_vmcs_field_if_exists(set_bits(field, mask, (val << from)), addr, name, verbose, exists());
1734  }
1735  }
1736 
1737  namespace deliver_error_code_bit
1738  {
1739  constexpr const auto mask = 0x00000800UL;
1740  constexpr const auto from = 11;
1741  constexpr const auto name = "deliver_error_code_bit";
1742 
1743  inline auto is_enabled()
1744  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1745 
1746  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1747  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1748 
1749  inline auto is_disabled()
1750  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1751 
1752  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1753  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1754 
1755  inline void enable()
1756  {
1757  auto&& field = get_vmcs_field(addr, name, exists());
1758  set_vmcs_field(set_bit(field, from), addr, name, exists());
1759  }
1760 
1761  inline void enable_if_exists(bool verbose = false) noexcept
1762  {
1763  auto&& field = get_vmcs_field_if_exists(addr, name, verbose, exists());
1764  set_vmcs_field_if_exists(set_bit(field, from), addr, name, verbose, exists());
1765  }
1766 
1767  inline void disable()
1768  {
1769  auto&& field = get_vmcs_field(addr, name, exists());
1770  set_vmcs_field(clear_bit(field, from), addr, name, exists());
1771  }
1772 
1773  inline void disable_if_exists(bool verbose = false) noexcept
1774  {
1775  auto&& field = get_vmcs_field_if_exists(addr, name, verbose, exists());
1776  set_vmcs_field_if_exists(clear_bit(field, from), addr, name, verbose, exists());
1777  }
1778  }
1779 
1780  namespace reserved
1781  {
1782  constexpr const auto mask = 0x7FFFF000UL;
1783  constexpr const auto from = 12;
1784  constexpr const auto name = "reserved";
1785 
1786  inline auto get()
1787  { return get_bits(get_vmcs_field(addr, name, exists()), mask) >> from; }
1788 
1789  inline auto get_if_exists(bool verbose = false) noexcept
1790  { return get_bits(get_vmcs_field_if_exists(addr, name, verbose, exists()), mask) >> from; }
1791 
1792  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1793  void set(T val)
1794  {
1795  auto&& field = get_vmcs_field(addr, name, exists());
1796  set_vmcs_field(set_bits(field, mask, (val << from)), addr, name, exists());
1797  }
1798 
1799  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1800  void set_if_exists(T val, bool verbose = false) noexcept
1801  {
1802  auto&& field = get_vmcs_field_if_exists(addr, name, verbose, exists());
1803  set_vmcs_field_if_exists(set_bits(field, mask, (val << from)), addr, name, verbose, exists());
1804  }
1805  }
1806 
1807  namespace valid_bit
1808  {
1809  constexpr const auto mask = 0x80000000UL;
1810  constexpr const auto from = 31;
1811  constexpr const auto name = "valid_bit";
1812 
1813  inline auto is_enabled()
1814  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1815 
1816  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1817  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1818 
1819  inline auto is_disabled()
1820  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1821 
1822  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1823  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1824 
1825  inline void enable()
1826  {
1827  auto&& field = get_vmcs_field(addr, name, exists());
1828  set_vmcs_field(set_bit(field, from), addr, name, exists()); }
1829 
1830  inline void enable_if_exists(bool verbose = false) noexcept
1831  {
1832  auto&& field = get_vmcs_field_if_exists(addr, name, verbose, exists());
1833  set_vmcs_field_if_exists(set_bit(field, from), addr, name, verbose, exists());
1834  }
1835 
1836  inline void disable()
1837  {
1838  auto&& field = get_vmcs_field(addr, name, exists());
1839  set_vmcs_field(clear_bit(field, from), addr, name, exists());
1840  }
1841 
1842  inline void disable_if_exists(bool verbose = false) noexcept
1843  {
1844  auto&& field = get_vmcs_field_if_exists(addr, name, verbose, exists());
1845  set_vmcs_field_if_exists(clear_bit(field, from), addr, name, verbose, exists());
1846  }
1847  }
1848 }
1849 
1850 namespace vm_entry_exception_error_code
1851 {
1852  constexpr const auto addr = 0x0000000000004018UL;
1853  constexpr const auto name = "vm_entry_exception_error_code";
1854 
1855  inline auto exists() noexcept
1856  { return true; }
1857 
1858  inline auto get()
1859  { return get_vmcs_field(addr, name, exists()); }
1860 
1861  inline auto get_if_exists(bool verbose = false) noexcept
1862  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1863 
1864  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1865  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1866 
1867  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1868  void set_if_exists(T val, bool verbose = false) noexcept
1869  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1870 }
1871 
1872 namespace vm_entry_instruction_length
1873 {
1874  constexpr const auto addr = 0x000000000000401AUL;
1875  constexpr const auto name = "vm_entry_instruction_length";
1876 
1877  inline auto exists() noexcept
1878  { return true; }
1879 
1880  inline auto get()
1881  { return get_vmcs_field(addr, name, exists()); }
1882 
1883  inline auto get_if_exists(bool verbose = false) noexcept
1884  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1885 
1886  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1887  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1888 
1889  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1890  void set_if_exists(T val, bool verbose = false) noexcept
1891  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1892 }
1893 
1894 namespace tpr_threshold
1895 {
1896  constexpr const auto addr = 0x000000000000401CUL;
1897  constexpr const auto name = "tpr_threshold";
1898 
1899  inline auto exists() noexcept
1901 
1902  inline auto get()
1903  { return get_vmcs_field(addr, name, exists()); }
1904 
1905  inline auto get_if_exists(bool verbose = false) noexcept
1906  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1907 
1908  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1909  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1910 
1911  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1912  void set_if_exists(T val, bool verbose = false) noexcept
1913  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1914 }
1915 
1916 namespace secondary_processor_based_vm_execution_controls
1917 {
1918  constexpr const auto addr = 0x000000000000401EUL;
1919  constexpr const auto name = "secondary_processor_based_vm_execution_controls";
1921 
1922  inline auto exists() noexcept
1924 
1925  inline auto get()
1926  { return get_vmcs_field(addr, name, exists()); }
1927 
1928  inline auto get_if_exists(bool verbose = false) noexcept
1929  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
1930 
1931  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1932  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
1933 
1934  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
1935  void set_if_exists(T val, bool verbose = false) noexcept
1936  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
1937 
1938  namespace virtualize_apic_accesses
1939  {
1940  constexpr const auto mask = 0x0000000000000001UL;
1941  constexpr const auto from = 0;
1942  constexpr const auto name = "virtualize_apic_accesses";
1943 
1944  inline auto is_enabled()
1945  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1946 
1947  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1948  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1949 
1950  inline auto is_disabled()
1951  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1952 
1953  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1954  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1955 
1956  inline void enable()
1957  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1958 
1959  inline void enable_if_allowed(bool verbose = false) noexcept
1960  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1961 
1962  inline void disable()
1963  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1964 
1965  inline void disable_if_allowed(bool verbose = false) noexcept
1966  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1967  }
1968 
1969  namespace enable_ept
1970  {
1971  constexpr const auto mask = 0x0000000000000002UL;
1972  constexpr const auto from = 1;
1973  constexpr const auto name = "enable_ept";
1974 
1975  inline auto is_enabled()
1976  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
1977 
1978  inline auto is_enabled_if_exists(bool verbose = false) noexcept
1979  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1980 
1981  inline auto is_disabled()
1982  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
1983 
1984  inline auto is_disabled_if_exists(bool verbose = false) noexcept
1985  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
1986 
1987  inline void enable()
1988  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
1989 
1990  inline void enable_if_allowed(bool verbose = false) noexcept
1991  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
1992 
1993  inline void disable()
1994  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
1995 
1996  inline void disable_if_allowed(bool verbose = false) noexcept
1997  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
1998  }
1999 
2000  namespace descriptor_table_exiting
2001  {
2002  constexpr const auto mask = 0x0000000000000004UL;
2003  constexpr const auto from = 2;
2004  constexpr const auto name = "descriptor_table_exiting";
2005 
2006  inline auto is_enabled()
2007  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2008 
2009  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2010  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2011 
2012  inline auto is_disabled()
2013  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2014 
2015  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2016  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2017 
2018  inline void enable()
2019  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2020 
2021  inline void enable_if_allowed(bool verbose = false) noexcept
2022  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2023 
2024  inline void disable()
2025  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2026 
2027  inline void disable_if_allowed(bool verbose = false) noexcept
2028  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2029  }
2030 
2031  namespace enable_rdtscp
2032  {
2033  constexpr const auto mask = 0x0000000000000008UL;
2034  constexpr const auto from = 3;
2035  constexpr const auto name = "enable_rdtscp";
2036 
2037  inline auto is_enabled()
2038  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2039 
2040  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2041  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2042 
2043  inline auto is_disabled()
2044  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2045 
2046  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2047  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2048 
2049  inline void enable()
2050  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2051 
2052  inline void enable_if_allowed(bool verbose = false) noexcept
2053  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2054 
2055  inline void disable()
2056  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2057 
2058  inline void disable_if_allowed(bool verbose = false) noexcept
2059  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2060  }
2061 
2062  namespace virtualize_x2apic_mode
2063  {
2064  constexpr const auto mask = 0x0000000000000010UL;
2065  constexpr const auto from = 4;
2066  constexpr const auto name = "virtualize_x2apic_mode";
2067 
2068  inline auto is_enabled()
2069  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2070 
2071  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2072  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2073 
2074  inline auto is_disabled()
2075  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2076 
2077  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2078  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2079 
2080  inline void enable()
2081  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2082 
2083  inline void enable_if_allowed(bool verbose = false) noexcept
2084  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2085 
2086  inline void disable()
2087  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2088 
2089  inline void disable_if_allowed(bool verbose = false) noexcept
2090  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2091  }
2092 
2093  namespace enable_vpid
2094  {
2095  constexpr const auto mask = 0x0000000000000020UL;
2096  constexpr const auto from = 5;
2097  constexpr const auto name = "enable_vpid";
2098 
2099  inline auto is_enabled()
2100  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2101 
2102  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2103  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2104 
2105  inline auto is_disabled()
2106  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2107 
2108  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2109  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2110 
2111  inline void enable()
2112  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2113 
2114  inline void enable_if_allowed(bool verbose = false) noexcept
2115  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2116 
2117  inline void disable()
2118  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2119 
2120  inline void disable_if_allowed(bool verbose = false) noexcept
2121  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2122  }
2123 
2124  namespace wbinvd_exiting
2125  {
2126  constexpr const auto mask = 0x0000000000000040UL;
2127  constexpr const auto from = 6;
2128  constexpr const auto name = "wbinvd_exiting";
2129 
2130  inline auto is_enabled()
2131  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2132 
2133  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2134  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2135 
2136  inline auto is_disabled()
2137  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2138 
2139  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2140  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2141 
2142  inline void enable()
2143  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2144 
2145  inline void enable_if_allowed(bool verbose = false) noexcept
2146  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2147 
2148  inline void disable()
2149  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2150 
2151  inline void disable_if_allowed(bool verbose = false) noexcept
2152  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2153  }
2154 
2155  namespace unrestricted_guest
2156  {
2157  constexpr const auto mask = 0x0000000000000080UL;
2158  constexpr const auto from = 7;
2159  constexpr const auto name = "unrestricted_guest";
2160 
2161  inline auto is_enabled()
2162  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2163 
2164  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2165  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2166 
2167  inline auto is_disabled()
2168  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2169 
2170  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2171  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2172 
2173  inline void enable()
2174  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2175 
2176  inline void enable_if_allowed(bool verbose = false) noexcept
2177  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2178 
2179  inline void disable()
2180  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2181 
2182  inline void disable_if_allowed(bool verbose = false) noexcept
2183  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2184  }
2185 
2186  namespace apic_register_virtualization
2187  {
2188  constexpr const auto mask = 0x0000000000000100UL;
2189  constexpr const auto from = 8;
2190  constexpr const auto name = "apic_register_virtualization";
2191 
2192  inline auto is_enabled()
2193  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2194 
2195  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2196  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2197 
2198  inline auto is_disabled()
2199  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2200 
2201  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2202  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2203 
2204  inline void enable()
2205  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2206 
2207  inline void enable_if_allowed(bool verbose = false) noexcept
2208  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2209 
2210  inline void disable()
2211  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2212 
2213  inline void disable_if_allowed(bool verbose = false) noexcept
2214  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2215  }
2216 
2217  namespace virtual_interrupt_delivery
2218  {
2219  constexpr const auto mask = 0x0000000000000200UL;
2220  constexpr const auto from = 9;
2221  constexpr const auto name = "virtual_interrupt_delivery";
2222 
2223  inline auto is_enabled()
2224  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2225 
2226  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2227  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2228 
2229  inline auto is_disabled()
2230  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2231 
2232  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2233  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2234 
2235  inline void enable()
2236  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2237 
2238  inline void enable_if_allowed(bool verbose = false) noexcept
2239  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2240 
2241  inline void disable()
2242  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2243 
2244  inline void disable_if_allowed(bool verbose = false) noexcept
2245  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2246  }
2247 
2248  namespace pause_loop_exiting
2249  {
2250  constexpr const auto mask = 0x0000000000000400UL;
2251  constexpr const auto from = 10;
2252  constexpr const auto name = "pause_loop_exiting";
2253 
2254  inline auto is_enabled()
2255  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2256 
2257  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2258  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2259 
2260  inline auto is_disabled()
2261  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2262 
2263  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2264  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2265 
2266  inline void enable()
2267  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2268 
2269  inline void enable_if_allowed(bool verbose = false) noexcept
2270  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2271 
2272  inline void disable()
2273  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2274 
2275  inline void disable_if_allowed(bool verbose = false) noexcept
2276  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2277  }
2278 
2279  namespace rdrand_exiting
2280  {
2281  constexpr const auto mask = 0x0000000000000800UL;
2282  constexpr const auto from = 11;
2283  constexpr const auto name = "rdrand_exiting";
2284 
2285  inline auto is_enabled()
2286  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2287 
2288  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2289  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2290 
2291  inline auto is_disabled()
2292  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2293 
2294  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2295  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2296 
2297  inline void enable()
2298  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2299 
2300  inline void enable_if_allowed(bool verbose = false) noexcept
2301  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2302 
2303  inline void disable()
2304  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2305 
2306  inline void disable_if_allowed(bool verbose = false) noexcept
2307  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2308  }
2309 
2310  namespace enable_invpcid
2311  {
2312  constexpr const auto mask = 0x0000000000001000UL;
2313  constexpr const auto from = 12;
2314  constexpr const auto name = "enable_invpcid";
2315 
2316  inline auto is_enabled()
2317  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2318 
2319  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2320  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2321 
2322  inline auto is_disabled()
2323  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2324 
2325  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2326  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2327 
2328  inline void enable()
2329  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2330 
2331  inline void enable_if_allowed(bool verbose = false) noexcept
2332  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2333 
2334  inline void disable()
2335  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2336 
2337  inline void disable_if_allowed(bool verbose = false) noexcept
2338  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2339  }
2340 
2341  namespace enable_vm_functions
2342  {
2343  constexpr const auto mask = 0x0000000000002000UL;
2344  constexpr const auto from = 13;
2345  constexpr const auto name = "enable_vm_functions";
2346 
2347  inline auto is_enabled()
2348  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2349 
2350  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2351  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2352 
2353  inline auto is_disabled()
2354  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2355 
2356  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2357  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2358 
2359  inline void enable()
2360  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2361 
2362  inline void enable_if_allowed(bool verbose = false) noexcept
2363  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2364 
2365  inline void disable()
2366  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2367 
2368  inline void disable_if_allowed(bool verbose = false) noexcept
2369  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2370  }
2371 
2372  namespace vmcs_shadowing
2373  {
2374  constexpr const auto mask = 0x0000000000004000UL;
2375  constexpr const auto from = 14;
2376  constexpr const auto name = "vmcs_shadowing";
2377 
2378  inline auto is_enabled()
2379  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2380 
2381  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2382  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2383 
2384  inline auto is_disabled()
2385  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2386 
2387  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2388  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2389 
2390  inline void enable()
2391  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2392 
2393  inline void enable_if_allowed(bool verbose = false) noexcept
2394  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2395 
2396  inline void disable()
2397  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2398 
2399  inline void disable_if_allowed(bool verbose = false) noexcept
2400  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2401  }
2402 
2403  namespace rdseed_exiting
2404  {
2405  constexpr const auto mask = 0x0000000000010000UL;
2406  constexpr const auto from = 16;
2407  constexpr const auto name = "rdseed_exiting";
2408 
2409  inline auto is_enabled()
2410  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2411 
2412  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2413  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2414 
2415  inline auto is_disabled()
2416  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2417 
2418  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2419  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2420 
2421  inline void enable()
2422  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2423 
2424  inline void enable_if_allowed(bool verbose = false) noexcept
2425  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2426 
2427  inline void disable()
2428  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2429 
2430  inline void disable_if_allowed(bool verbose = false) noexcept
2431  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2432  }
2433 
2434  namespace enable_pml
2435  {
2436  constexpr const auto mask = 0x0000000000020000UL;
2437  constexpr const auto from = 17;
2438  constexpr const auto name = "enable_pml";
2439 
2440  inline auto is_enabled()
2441  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2442 
2443  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2444  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2445 
2446  inline auto is_disabled()
2447  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2448 
2449  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2450  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2451 
2452  inline void enable()
2453  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2454 
2455  inline void enable_if_allowed(bool verbose = false) noexcept
2456  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2457 
2458  inline void disable()
2459  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2460 
2461  inline void disable_if_allowed(bool verbose = false) noexcept
2462  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2463  }
2464 
2465  namespace ept_violation_ve
2466  {
2467  constexpr const auto mask = 0x0000000000040000UL;
2468  constexpr const auto from = 18;
2469  constexpr const auto name = "ept_violation_ve";
2470 
2471  inline auto is_enabled()
2472  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2473 
2474  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2475  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2476 
2477  inline auto is_disabled()
2478  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2479 
2480  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2481  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2482 
2483  inline void enable()
2484  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2485 
2486  inline void enable_if_allowed(bool verbose = false) noexcept
2487  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2488 
2489  inline void disable()
2490  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2491 
2492  inline void disable_if_allowed(bool verbose = false) noexcept
2493  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2494  }
2495 
2496  namespace enable_xsaves_xrstors
2497  {
2498  constexpr const auto mask = 0x0000000000100000UL;
2499  constexpr const auto from = 20 ;
2500  constexpr const auto name = "enable_xsaves_xrstors";
2501 
2502  inline auto is_enabled()
2503  { return is_bit_set(get_vmcs_field(addr, name, exists()), from); }
2504 
2505  inline auto is_enabled_if_exists(bool verbose = false) noexcept
2506  { return is_bit_set(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2507 
2508  inline auto is_disabled()
2509  { return is_bit_cleared(get_vmcs_field(addr, name, exists()), from); }
2510 
2511  inline auto is_disabled_if_exists(bool verbose = false) noexcept
2512  { return is_bit_cleared(get_vmcs_field_if_exists(addr, name, verbose, exists()), from); }
2513 
2514  inline void enable()
2515  { set_vm_control(true, msr_addr, addr, name, mask, exists()); }
2516 
2517  inline void enable_if_allowed(bool verbose = false) noexcept
2518  { set_vm_control_if_allowed(true, msr_addr, addr, name, mask, verbose, exists()); }
2519 
2520  inline void disable()
2521  { set_vm_control(false, msr_addr, addr, name, mask, exists()); }
2522 
2523  inline void disable_if_allowed(bool verbose = false) noexcept
2524  { set_vm_control_if_allowed(false, msr_addr, addr, name, mask, verbose, exists()); }
2525  }
2526 }
2527 
2528 namespace ple_gap
2529 {
2530  constexpr const auto addr = 0x0000000000004020UL;
2531  constexpr const auto name = "ple_gap";
2532 
2533  inline auto exists() noexcept
2534  {
2537  }
2538 
2539  inline auto get()
2540  { return get_vmcs_field(addr, name, exists()); }
2541 
2542  inline auto get_if_exists(bool verbose = false) noexcept
2543  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
2544 
2545  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
2546  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
2547 
2548  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
2549  void set_if_exists(T val, bool verbose = false) noexcept
2550  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
2551 }
2552 
2553 namespace ple_window
2554 {
2555  constexpr const auto addr = 0x0000000000004022UL;
2556  constexpr const auto name = "ple_window";
2557 
2558  inline auto exists() noexcept
2559  {
2562  }
2563 
2564  inline auto get()
2565  { return get_vmcs_field(addr, name, exists()); }
2566 
2567  inline auto get_if_exists(bool verbose = false) noexcept
2568  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
2569 
2570  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
2571  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
2572 
2573  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
2574  void set_if_exists(T val, bool verbose = false) noexcept
2575  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
2576 }
2577 
2578 }
2579 }
2580 
2581 // *INDENT-ON*
2582 
2583 #endif
auto is_enabled()
auto set_vm_control_if_allowed(bool val, MA msr_addr, CA ctls_addr, const char *name, M mask, bool verbose, bool field_exists) noexcept
auto is_enabled_if_exists(bool verbose=false) noexcept
void disable()
auto is_disabled_if_exists(bool verbose=false) noexcept
void disable()
auto get_vmcs_field_if_exists(T addr, const char *name, bool verbose, bool exists)
constexpr const auto from
void enable()
auto is_enabled()
void set_if_exists(T val, bool verbose=false) noexcept
constexpr const auto addr
void disable()
void set_if_exists(T val, bool verbose=false) noexcept
auto is_enabled_if_exists(bool verbose=false) noexcept
constexpr const auto mask
void enable_if_exists(bool verbose=false) noexcept
void enable_if_allowed(bool verbose=false) noexcept
void disable()
constexpr const auto mask
auto is_disabled()
void set_if_exists(T val, bool verbose=false) noexcept
constexpr const auto from
auto is_enabled_if_exists(bool verbose=false) noexcept
void enable_if_allowed(bool verbose=false) noexcept
constexpr const auto from
void disable_if_allowed(bool verbose=false) noexcept
constexpr const auto mask
void set_if_exists(T val, bool verbose=false) noexcept
constexpr const auto mask
void enable_if_allowed(bool verbose=false) noexcept
void enable()
void enable()
constexpr const auto mask
auto is_disabled()
constexpr const auto mask
constexpr const auto mask
auto is_enabled_if_exists(bool verbose=false) noexcept
constexpr const auto external_interrupt
auto get_if_exists(bool verbose=false) noexcept
auto get_if_exists(bool verbose=false) noexcept
auto is_disabled_if_exists(bool verbose=false) noexcept
constexpr const auto reserved
constexpr const auto from
constexpr const auto name
auto get_if_exists(bool verbose=false) noexcept
void disable_if_exists(bool verbose=false) noexcept
constexpr const auto mask
void enable()
constexpr const auto mask
auto exists() noexcept
auto exists() noexcept
void set_if_exists(T val, bool verbose=false) noexcept
auto exists() noexcept
auto is_disabled()
auto is_enabled_if_exists(bool verbose=false) noexcept
constexpr const auto software_interrupt
constexpr const auto from
constexpr const auto from
constexpr const auto from
void enable()
auto is_disabled_if_exists(bool verbose=false) noexcept
constexpr const auto other_event
constexpr const auto mask
auto is_enabled()
void set_if_exists(T val, bool verbose=false) noexcept
auto get_if_exists(bool verbose=false) noexcept
constexpr const auto hardware_exception
void set_if_exists(T val, bool verbose=false) noexcept
constexpr const auto name
auto set_vmcs_field_if_exists(V val, A addr, const char *name, bool verbose, bool exists) noexcept
void enable_if_exists(bool verbose=false) noexcept
constexpr const auto name
void uint64_t uint64_t uint64_t *rdx noexcept
void disable_if_allowed(bool verbose=false) noexcept
constexpr const auto from
auto get_if_exists(bool verbose=false) noexcept
constexpr const auto mask
auto is_enabled_if_exists(bool verbose=false) noexcept
void disable_if_allowed(bool verbose=false) noexcept
void enable()
constexpr const auto software_exception
auto is_bit_cleared(T t, B b) noexcept
Definition: bitmanip.h:54
void set_if_exists(T val, bool verbose=false) noexcept
auto is_enabled()
void set_if_exists(T val, bool verbose=false) noexcept
auto is_enabled_if_exists(bool verbose=false) noexcept
void disable_if_exists(bool verbose=false) noexcept
constexpr const auto from
auto is_disabled()
constexpr const auto non_maskable_interrupt
constexpr const auto name
auto is_disabled_if_exists(bool verbose=false) noexcept
void set_if_exists(T val, bool verbose=false) noexcept
auto get_if_exists(bool verbose=false) noexcept
constexpr const auto name
void disable()
auto is_disabled()
auto is_disabled_if_exists(bool verbose=false) noexcept
void set_if_exists(T val, bool verbose=false) noexcept
constexpr const auto privileged_software_exception
void disable()
void enable_if_allowed(bool verbose=false) noexcept
void enable_if_allowed(bool verbose=false) noexcept
void set_if_exists(T val, bool verbose=false) noexcept
void enable()
void enable()
auto get_if_exists(bool verbose=false) noexcept
auto exists() noexcept
auto clear_bit(T t, B b) noexcept
Definition: bitmanip.h:36
auto is_disabled_if_exists(bool verbose=false) noexcept
constexpr const auto addr
void disable_if_allowed(bool verbose=false) noexcept
auto is_disabled_if_exists(bool verbose=false) noexcept
constexpr const auto from
auto set_vmcs_field(V val, A addr, const char *name, bool exists)
constexpr const auto from
auto is_enabled()
constexpr const auto addr
constexpr const auto from
auto set_bit(T t, B b) noexcept
Definition: bitmanip.h:30
auto is_disabled()
void enable()
constexpr const auto addr
auto get_bits(T t, M m) noexcept
Definition: bitmanip.h:65
constexpr const auto addr
void set_if_exists(T val, bool verbose=false) noexcept
auto is_disabled()
auto is_disabled()
constexpr const auto mask
void set_if_exists(T val, bool verbose=false) noexcept
auto get_if_exists(bool verbose=false) noexcept
void enable_if_allowed(bool verbose=false) noexcept
void disable_if_allowed(bool verbose=false) noexcept
constexpr const auto addr
void disable_if_allowed(bool verbose=false) noexcept
auto get_if_exists(bool verbose=false) noexcept
auto is_enabled()
auto is_enabled()
auto get_vmcs_field(T addr, const char *name, bool exists)
auto is_disabled_if_exists(bool verbose=false) noexcept
void enable_if_allowed(bool verbose=false) noexcept
void set_if_exists(T val, bool verbose=false) noexcept
constexpr const auto from
void enable()
auto is_enabled_if_exists(bool verbose=false) noexcept
auto is_enabled()
auto set_vm_control(bool val, MA msr_addr, CA ctls_addr, const char *name, M mask, bool field_exists)
auto is_disabled()
auto is_enabled()
auto is_enabled_if_exists(bool verbose=false) noexcept
auto get_if_exists(bool verbose=false) noexcept
void disable_if_allowed(bool verbose=false) noexcept
void enable_if_allowed(bool verbose=false) noexcept
auto is_bit_set(T t, B b) noexcept
Definition: bitmanip.h:48
void disable()
constexpr const auto msr_addr
auto exists() noexcept
void disable()
auto is_disabled()
void disable()
auto is_disabled_if_exists(bool verbose=false) noexcept
void set_if_exists(T val, bool verbose=false) noexcept
void disable_if_allowed(bool verbose=false) noexcept
auto set_bits(T t, M m, V v) noexcept
Definition: bitmanip.h:72
auto get_if_exists(bool verbose=false) noexcept
auto is_enabled()
void disable()
auto is_disabled_if_exists(bool verbose=false) noexcept
void set_if_exists(T val, bool verbose=false) noexcept
constexpr const auto mask
auto is_enabled_if_exists(bool verbose=false) noexcept