vmxon_intel_x64.h
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #ifndef VMXON_INTEL_X64_H
23 #define VMXON_INTEL_X64_H
24 
25 #include <memory>
26 
27 // -----------------------------------------------------------------------------
28 // Definition
29 // -----------------------------------------------------------------------------
30 
40 {
41 public:
42 
49 
55  virtual ~vmxon_intel_x64() = default;
56 
66  virtual void start();
67 
75  virtual void stop();
76 
77 protected:
78 
84  void check_v8086_disabled();
85 
86  void create_vmxon_region();
88  void execute_vmxon();
89  void execute_vmxoff();
90 
91 private:
92 
93  friend class vmxon_ut;
94 
95  bool m_vmxon_enabled;
96  uintptr_t m_vmxon_region_phys;
97  std::unique_ptr<uint32_t[]> m_vmxon_region;
98 };
99 
100 #endif
void check_ia32_vmx_cr0_fixed_msr()
void check_vmx_capabilities_msr()
Definition: test.h:27
void check_ia32_vmx_cr4_fixed_msr()
void uint64_t uint64_t uint64_t *rdx noexcept
void check_ia32_feature_control_msr()
virtual ~vmxon_intel_x64()=default
void check_cpuid_vmx_supported()
virtual void start()
virtual void stop()
void release_vmxon_region() noexcept