Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
Host CR3 needs to take the PML4 PA
Browse files Browse the repository at this point in the history
  • Loading branch information
memN0ps committed Dec 21, 2023
1 parent 8b4cda2 commit 67b113b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hypervisor/src/intel/vmcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl Vmcs {
#[rustfmt::skip]
pub fn setup_host_registers_state(context: &CONTEXT, host_descriptor_table: &Box<DescriptorTables, KernelAlloc>, host_paging: &Box<PageTables, KernelAlloc>) {
unsafe { vmwrite(vmcs::host::CR0, controlregs::cr0().bits() as u64) };
vmwrite(vmcs::host::CR3, host_paging.as_ref() as *const _ as u64);
vmwrite(vmcs::host::CR3, PhysicalAddress::pa_from_va(host_paging.as_ref() as *const _ as u64));
unsafe { vmwrite(vmcs::host::CR4, controlregs::cr4().bits() as u64) };

// The RIP/RSP registers are set within `launch_vm`.
Expand Down

0 comments on commit 67b113b

Please sign in to comment.