vmcs_intel_x64_16bit_control_fields.h
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 // 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_16BIT_CONTROL_FIELDS_H
24 #define VMCS_INTEL_X64_16BIT_CONTROL_FIELDS_H
25 
28 
35 
36 // *INDENT-OFF*
37 
38 namespace intel_x64
39 {
40 namespace vmcs
41 {
42 
43 namespace virtual_processor_identifier
44 {
45  constexpr const auto addr = 0x0000000000000000UL;
46  constexpr const auto name = "virtual_processor_identifier";
47 
48  inline bool exists() noexcept
49  {
52  }
53 
54  inline auto get()
55  { return get_vmcs_field(addr, name, exists()); }
56 
57  inline auto get_if_exists(bool verbose = false) noexcept
58  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
59 
60  template<class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
61  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
62 
63  template<class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
64  void set_if_exists(T val, bool verbose = false) noexcept
65  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
66 }
67 
68 namespace posted_interrupt_notification_vector
69 {
70  constexpr const auto addr = 0x0000000000000002UL;
71  constexpr const auto name = "posted_interrupt_notification_vector";
72 
73  inline bool exists() noexcept
75 
76  inline auto get()
77  { return get_vmcs_field(addr, name, exists()); }
78 
79  inline auto get_if_exists(bool verbose = false) noexcept
80  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
81 
82  template<class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
83  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
84 
85  template<class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
86  void set_if_exists(T val, bool verbose = false) noexcept
87  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
88 }
89 
90 namespace eptp_index
91 {
92  constexpr const auto addr = 0x0000000000000004UL;
93  constexpr const auto name = "eptp_index";
94 
95  inline bool exists() noexcept
96  {
99  }
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 }
116 }
117 
118 // *INDENT-ON*
119 
120 #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
auto set_vmcs_field_if_exists(V val, A addr, const char *name, bool verbose, bool exists) noexcept
void uint64_t uint64_t uint64_t *rdx noexcept
auto set_vmcs_field(V val, A addr, const char *name, bool exists)
auto get_if_exists(bool verbose=false) noexcept
auto get_vmcs_field(T addr, const char *name, bool exists)