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