fix EPT allocation
This commit is contained in:
@ -105,7 +105,7 @@ impl EPT {
|
||||
&mut self,
|
||||
gpa: u64,
|
||||
hpa: u64,
|
||||
allocator: &mut impl FrameAllocator<Size4KiB>,
|
||||
allocator: &mut dyn FrameAllocator<Size4KiB>,
|
||||
) -> Result<(), &'static str> {
|
||||
let lv4_index = (gpa >> 39) & 0x1FF;
|
||||
let lv3_index = (gpa >> 30) & 0x1FF;
|
||||
|
@ -144,8 +144,8 @@ impl IntelVCpu {
|
||||
let frame = frame_allocator.allocate_frame().ok_or("No free frames")?;
|
||||
let hpa = frame.start_address().as_u64();
|
||||
|
||||
self.ept.map_2m(gpa, hpa, frame_allocator)?;
|
||||
gpa += (4 * 1024) << 9;
|
||||
self.ept.map_4k(gpa, hpa, frame_allocator)?;
|
||||
gpa += 0x1000;
|
||||
pages -= 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user