Module x64

Module x64 

Source
Expand description

Methods to construct page tables on x64.

Structs§

IdentityMapBuilder
An IdentityMap Builder, which builds either a 4GB or 8GB identity map of the lower address space FUTURE: This logic can merged with the PageTableBuilder, rather than maintaining two implementations
MappedRange
A memory range to be mapped in a page table, and the associated permissions The default permissions bits are present, R/W, executable
PageTable
A single page table at any level of the page table hierarchy
PageTableBuilder
A builder for an x64 identity-mapped page table
PageTableEntry
An x64 page table entry

Enums§

EntryLevel
The depth of an x64 page table
PageTableEntryType

Constants§

PAGE_TABLE_MAX_BYTES
Maximum number of bytes needed to store an x64 identity map
PAGE_TABLE_MAX_COUNT
An upper bound on the number of page tables that will be built for an x64 identity map. The builder will greedily map the largest possible page size, a cap of 20 tables is more than enough for mapping a few gigabytes with mostly large pages, which is sufficient for all of the current use cases of the identity map builder
X64_1GB_PAGE_SIZE
Number of bytes in a 1GB page for X64.
X64_LARGE_PAGE_SIZE
Number of bytes in a large page for X64.
X64_PAGE_SIZE
Number of bytes in a page for X64.

Functions§

align_up_to_1_gb_page_size
Align an address up to the start of the next 1GB page.
align_up_to_large_page_size
Align an address up to the start of the next large (2MB) page.
align_up_to_page_size
Align an address up to the start of the next page.
calculate_pde_table_count
Calculate the number of PDE page tables required to identity map a given gpa and size.
get_amd64_pte_index
Get an AMD64 PTE index based on page table level.