Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cfg_if::cfg_if! {
mod vmx;
use vmx as vender;
pub use vmx::{VmxExitInfo, VmxExitReason, VmxInterruptInfo, VmxIoExitInfo};
pub use vmx::invalid_ept;

pub use vender::VmxArchVCpu;
pub use vender::VmxArchPerCpuState;
Expand Down
2 changes: 2 additions & 0 deletions src/vmx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub use self::percpu::VmxPerCpuState as VmxArchPerCpuState;
pub use self::vcpu::VmxVcpu as VmxArchVCpu;
pub use self::vmcs::{VmxExitInfo, VmxInterruptInfo, VmxIoExitInfo};

pub use self::vcpu::invalid_ept;

/// Return if current platform support virtualization extension.
pub fn has_hardware_support() -> bool {
if let Some(feature) = raw_cpuid::CpuId::new().get_feature_info() {
Expand Down
8 changes: 8 additions & 0 deletions src/vmx/vcpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ impl<H: AxVCpuHal> VmxVcpu<H> {
}

fn setup_vmcs_host(&self) -> AxResult {
// warn!("Host IA32_PAT {:#x}", Msr::IA32_PAT.read());
// warn!("Host IA32_EFER {:#x}", Msr::IA32_EFER.read());

VmcsHost64::IA32_PAT.write(Msr::IA32_PAT.read())?;
VmcsHost64::IA32_EFER.write(Msr::IA32_EFER.read())?;

Expand Down Expand Up @@ -1647,3 +1650,8 @@ impl<H: AxVCpuHal> AxVcpuAccessGuestState for VmxVcpu<H> {
warn!("Dumping VmxVcpu {:#x?}", self);
}
}

pub fn invalid_ept(eptp: EPTPointer) -> AxResult<()> {
use super::instructions::{InvEptType, invept};
unsafe { invept(InvEptType::SingleContext, eptp.bits()).map_err(as_axerr) }
}
Loading