HyperPlatform Programmer's Reference
HyperPlatform
ept.h
Go to the documentation of this file.
1
// Copyright (c) 2015-2017, Satoshi Tanda. All rights reserved.
2
// Use of this source code is governed by a MIT-style license that can be
3
// found in the LICENSE file.
4
7
8
#ifndef HYPERPLATFORM_EPT_H_
9
#define HYPERPLATFORM_EPT_H_
10
11
#include <fltKernel.h>
12
13
extern
"C"
{
15
//
16
// macro utilities
17
//
18
20
//
21
// constants and macros
22
//
23
25
//
26
// types
27
//
28
29
struct
EptData
;
30
32
union
EptCommonEntry
{
33
ULONG64
all
;
34
struct
{
35
ULONG64
read_access
: 1;
36
ULONG64
write_access
: 1;
37
ULONG64
execute_access
: 1;
38
ULONG64
memory_type
: 3;
39
ULONG64
reserved1
: 6;
40
ULONG64
physial_address
: 36;
41
ULONG64
reserved2
: 16;
42
}
fields
;
43
};
44
static_assert(
sizeof
(
EptCommonEntry
) == 8,
"Size check"
);
45
47
//
48
// prototypes
49
//
50
53
_IRQL_requires_max_(PASSIVE_LEVEL)
bool
EptIsEptAvailable
();
54
58
ULONG64
EptGetEptPointer
(_In_
EptData
* ept_data);
59
61
_IRQL_requires_max_(PASSIVE_LEVEL)
void
EptInitializeMtrrEntries
();
62
68
_IRQL_requires_max_(PASSIVE_LEVEL)
EptData
*
EptInitialization
();
69
72
void
EptTermination
(_In_
EptData
* ept_data);
73
76
_IRQL_requires_min_(DISPATCH_LEVEL)
void
EptHandleEptViolation
(
77
_In_
EptData
* ept_data);
78
83
EptCommonEntry
*
EptGetEptPtEntry
(_In_
EptData
* ept_data,
84
_In_ ULONG64 physical_address);
85
87
//
88
// variables
89
//
90
92
//
93
// implementations
94
//
95
96
}
// extern "C"
97
98
#endif // HYPERPLATFORM_EPT_H_
EptIsEptAvailable
bool EptIsEptAvailable()
Checks if the system supports EPT technology sufficient enough.
Definition:
ept.cpp:163
EptHandleEptViolation
void EptHandleEptViolation(_In_ EptData *ept_data)
Handles VM-exit triggered by EPT violation.
EptCommonEntry::physial_address
ULONG64 physial_address
[12:48-1]
Definition:
ept.h:40
EptCommonEntry::fields
struct EptCommonEntry::@0 fields
EptCommonEntry::reserved1
ULONG64 reserved1
[6:11]
Definition:
ept.h:39
EptCommonEntry::memory_type
ULONG64 memory_type
[3:5]
Definition:
ept.h:38
EptInitializeMtrrEntries
void EptInitializeMtrrEntries()
Reads and stores all MTRRs to set a correct memory type for EPT.
Definition:
ept.cpp:193
EptGetEptPtEntry
EptCommonEntry * EptGetEptPtEntry(_In_ EptData *ept_data, _In_ ULONG64 physical_address)
Returns an EPT entry corresponds to physical_address.
EptTermination
void EptTermination(_In_ EptData *ept_data)
De-allocates ept_data and all resources referenced in it.
EptCommonEntry::read_access
ULONG64 read_access
[0]
Definition:
ept.h:35
EptCommonEntry::execute_access
ULONG64 execute_access
[2]
Definition:
ept.h:37
EptCommonEntry::write_access
ULONG64 write_access
[1]
Definition:
ept.h:36
EptInitialization
EptData * EptInitialization()
Builds EPT, allocates pre-allocated entires, initializes and returns EptData.
Definition:
ept.cpp:399
EptData
Definition:
ept.cpp:86
EptCommonEntry::reserved2
ULONG64 reserved2
[48:63]
Definition:
ept.h:41
EptCommonEntry::all
ULONG64 all
Definition:
ept.h:33
EptCommonEntry
A structure made up of mutual fields across all EPT entry types.
Definition:
ept.h:32
EptGetEptPointer
ULONG64 EptGetEptPointer(_In_ EptData *ept_data)
Returns an EPT pointer from ept_data.
Generated by
1.8.14