Expand description
Extended Page Table.
Background
When multiple virtual machines are running on a single physical machine, the hypervisor must need to have a method for mapping virtual machine’s memory addresses to the physical memory addresses of the host memory. For this purpose, the hypervisor emulates the guest page table through Shadow Paging. However, virtualizing memory access by shadow paging requires processing all requests for virtual address translation demanded by all virtual machine OS kernels (such as CR3 register access, page table modifications, and VA-PA translation via MMU). EPT allows virtual machines to have their page tables, which map virtual addresses to physical addresses, while also allowing the hypervisor to maintain its own page table for the host machine.
Tasks
In this project, you are requested to implement of the Extended Page Table for the gKeOS operating system.
To manage and translate the guest physical address to the host physical address, [simple_ept_vm
] uses the
implemented EPT functionalities in this project.
The main concept of this project is similar to the page table implementations of Project 1.
You have to implement ExtendedPageTable::map
, ExtendedPageTable::unmap
and ExtendedPageTable::walk
to be used for managing extended page table.
In contrast to the page table implementation from Project 1, EPT determines the presence of an entry by examining the presence of flags in page table entries.
Stated differently, if there are no flags present in an EPT entry, this indicates that the physical address referenced by the entry is not valid (i.e., it is set to None).
It is important to account for huge pages in the address translation process kev::Probe::gpa2hpa
,
as there are instances where the allocation of huge pages cannot be avoided in x86 at the initial boot time.