Public Types | |
using | pointer = void * |
using | integer_pointer = uintptr_t |
using | cr3_type = uint64_t |
using | attr_type = x64::memory_attr::attr_type |
using | size_type = size_t |
using | memory_descriptor_list = page_table_x64::memory_descriptor_list |
Root Page Tables
The VMM has to have a set of page tables for itself to map in memory for itself, but also from other guests. This class represents the root page tables that the VMM will use.
Note that this class does not flush the TLB when modifications are made. This needs to be done manually. In general, this class should not be used directly, but instead mapping should be done via a unique_map_ptr_x64.
Definition at line 47 of file root_page_table_x64.h.
using root_page_table_x64::pointer = void * |
Definition at line 51 of file root_page_table_x64.h.
using root_page_table_x64::integer_pointer = uintptr_t |
Definition at line 52 of file root_page_table_x64.h.
using root_page_table_x64::cr3_type = uint64_t |
Definition at line 53 of file root_page_table_x64.h.
Definition at line 54 of file root_page_table_x64.h.
using root_page_table_x64::size_type = size_t |
Definition at line 55 of file root_page_table_x64.h.
Definition at line 56 of file root_page_table_x64.h.
root_page_table_x64::root_page_table_x64 | ( | bool | is_vmm = false | ) |
Default Constructor
Definition at line 51 of file root_page_table_x64.cpp.
|
virtualdefault |
Default Destructor
|
default |
|
delete |
|
virtual |
CR3
Definition at line 57 of file root_page_table_x64.cpp.
|
inlinevirtual |
Map (1 Gigabyte)
Maps 1 gigabyte of memory in the page tables given a virtual address, the physical address and a set of attributes.
virt | the virtual address to map |
phys | the physical address to map the virt address |
attr | describes how to map the virt address |
Definition at line 94 of file root_page_table_x64.h.
|
inlinevirtual |
Map (2 Megabytes)
Maps 1 gigabyte of memory in the page tables given a virtual address, the physical address and a set of attributes.
virt | the virtual address to map |
phys | the physical address to map the virt address |
attr | describes how to map the virt address |
Definition at line 109 of file root_page_table_x64.h.
|
inlinevirtual |
Map (1 Kilobytes)
Maps 1 gigabyte of memory in the page tables given a virtual address, the physical address and a set of attributes.
virt | the virtual address to map |
phys | the physical address to map the virt address |
attr | describes how to map the virt address |
Definition at line 124 of file root_page_table_x64.h.
|
virtualnoexcept |
Unmap
Unmaps memory in the page tables give a virtual address.
virt | the virtual address to unmap |
Definition at line 61 of file root_page_table_x64.cpp.
void root_page_table_x64::setup_identity_map_1g | ( | integer_pointer | saddr, |
integer_pointer | eaddr | ||
) |
Setup Identify Map (1g Granularity)
Sets up an identify map in the page tables using 1 gigabyte of memory granularity.
saddr | the starting address for the identify map |
eaddr | the ending address for the identify map |
Definition at line 68 of file root_page_table_x64.cpp.
void root_page_table_x64::setup_identity_map_2m | ( | integer_pointer | saddr, |
integer_pointer | eaddr | ||
) |
Setup Identify Map (2m Granularity)
Sets up an identify map in the page tables using 1 gigabyte of memory granularity.
saddr | the starting address for the identify map |
eaddr | the ending address for the identify map |
Definition at line 79 of file root_page_table_x64.cpp.
void root_page_table_x64::setup_identity_map_4k | ( | integer_pointer | saddr, |
integer_pointer | eaddr | ||
) |
Setup Identify Map (4k Granularity)
Sets up an identify map in the page tables using 1 gigabyte of memory granularity.
saddr | the starting address for the identify map |
eaddr | the ending address for the identify map |
Definition at line 90 of file root_page_table_x64.cpp.
void root_page_table_x64::unmap_identity_map_1g | ( | integer_pointer | saddr, |
integer_pointer | eaddr | ||
) |
Unmap Identify Map (1g Granularity)
Unmaps an identity map previously mapped using the setup_identity_map_1g function.
saddr | the starting address for the identify map |
eaddr | the ending address for the identify map |
Definition at line 101 of file root_page_table_x64.cpp.
void root_page_table_x64::unmap_identity_map_2m | ( | integer_pointer | saddr, |
integer_pointer | eaddr | ||
) |
Unmap Identify Map (2m Granularity)
Unmaps an identity map previously mapped using the setup_identity_map_2m function.
saddr | the starting address for the identify map |
eaddr | the ending address for the identify map |
Definition at line 112 of file root_page_table_x64.cpp.
void root_page_table_x64::unmap_identity_map_4k | ( | integer_pointer | saddr, |
integer_pointer | eaddr | ||
) |
Unmap Identify Map (4k Granularity)
Unmaps an identity map previously mapped using the setup_identity_map_4k function.
saddr | the starting address for the identify map |
eaddr | the ending address for the identify map |
Definition at line 123 of file root_page_table_x64.cpp.
page_table_entry_x64 root_page_table_x64::virt_to_pte | ( | integer_pointer | virt | ) | const |
Virtual Address To Page Table Entry
Locates the page table entry given a virtual address. The entry is guaranteed not to be null (or an exception is thrown). This function can be used to access a PTE, enabling the user to modify any part of the PTE as desired. It should be noted that the root page table owns the PTE. Unmapping a PTE invalidates the PTE returned by this function.
virt | the virtual address to lookup |
Definition at line 134 of file root_page_table_x64.cpp.
root_page_table_x64::memory_descriptor_list root_page_table_x64::pt_to_mdl | ( | ) | const |
Page Table to Memory Descriptor List
This function converts the internal page table tree structure into a linear, memory descriptor list. Page table entry information is not provide, only the page tables. pages.
Definition at line 141 of file root_page_table_x64.cpp.
|
default |
|
delete |