vmx_intel_x64_mock.cpp
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #include <gsl/gsl>
23 #include <debug.h>
24 
25 extern "C" bool
26 __attribute__((weak)) __vmxon(void *ptr)
27 {
28  (void) ptr;
29 
30  std::cerr << __FUNC__ << " called" << '\n';
31  abort();
32 }
33 
34 extern "C" bool
35 __attribute__((weak)) __vmxoff(void) noexcept
36 {
37  std::cerr << __FUNC__ << " called" << '\n';
38  abort();
39 }
40 
41 extern "C" bool
42 __attribute__((weak)) __vmclear(void *ptr) noexcept
43 {
44  (void) ptr;
45 
46  std::cerr << __FUNC__ << " called" << '\n';
47  abort();
48 }
49 
50 extern "C" bool
51 __attribute__((weak)) __vmptrld(void *ptr) noexcept
52 {
53  (void) ptr;
54 
55  std::cerr << __FUNC__ << " called" << '\n';
56  abort();
57 }
58 
59 extern "C" bool
60 __attribute__((weak)) __vmptrst(void *ptr) noexcept
61 {
62  (void) ptr;
63 
64  std::cerr << __FUNC__ << " called" << '\n';
65  abort();
66 }
67 
68 extern "C" bool
69 __attribute__((weak)) __vmwrite(uint64_t field, uint64_t value) noexcept
70 {
71  std::cerr << __FUNC__ << " called with: " << '\n';
72  std::cerr << " - field: " << view_as_pointer(field) << '\n';
73  std::cerr << " - value: " << view_as_pointer(value) << '\n';
74  abort();
75 }
76 
77 extern "C" bool
78 __attribute__((weak)) __vmread(uint64_t field, uint64_t *value) noexcept
79 {
80  (void) value;
81 
82  std::cerr << __FUNC__ << " called with: " << '\n';
83  std::cerr << " - field: " << view_as_pointer(field) << '\n';
84  abort();
85 }
86 
87 extern "C" bool
89 {
90  std::cerr << __FUNC__ << " called" << '\n';
91  abort();
92 }
93 
94 extern "C" bool
95 __attribute__((weak)) __invept(uint64_t type, void *ptr) noexcept
96 {
97  (void) type;
98  (void) ptr;
99 
100  std::cerr << __FUNC__ << " called" << '\n';
101  abort();
102 }
103 
104 extern "C" bool
105 __attribute__((weak)) __invvpid(uint64_t type, void *ptr) noexcept
106 {
107  (void) type;
108  (void) ptr;
109 
110  std::cerr << __FUNC__ << " called" << '\n';
111  abort();
112 }
bool __invvpid(uint64_t type, void *ptr) noexcept
bool __vmwrite(uint64_t field, uint64_t val) noexcept
bool __vmptrld(void *ptr) noexcept
bool uint64_t value noexcept
bool __vmxoff(void) noexcept
bool __invept(uint64_t type, void *ptr) noexcept
bool __vmlaunch_demote(void) noexcept
bool __vmptrst(void *ptr) noexcept
const void * view_as_pointer(const T val)
bool __vmread(uint64_t field, uint64_t *val) noexcept
bool __vmclear(void *ptr) noexcept
bool __vmxon(void *ptr) noexcept
bool __attribute__((weak)) __vmxon(void *ptr)