File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ cfg_if::cfg_if! {
2626 mod vmx;
2727 use vmx as vender;
2828 pub use vmx:: { VmxExitInfo , VmxExitReason , VmxInterruptInfo , VmxIoExitInfo } ;
29+ pub use vmx:: invalid_ept;
2930
3031 pub use vender:: VmxArchVCpu ;
3132 pub use vender:: VmxArchPerCpuState ;
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ pub use self::percpu::VmxPerCpuState as VmxArchPerCpuState;
1313pub use self :: vcpu:: VmxVcpu as VmxArchVCpu ;
1414pub use self :: vmcs:: { VmxExitInfo , VmxInterruptInfo , VmxIoExitInfo } ;
1515
16+ pub use self :: vcpu:: invalid_ept;
17+
1618/// Return if current platform support virtualization extension.
1719pub fn has_hardware_support ( ) -> bool {
1820 if let Some ( feature) = raw_cpuid:: CpuId :: new ( ) . get_feature_info ( ) {
Original file line number Diff line number Diff line change @@ -482,6 +482,9 @@ impl<H: AxVCpuHal> VmxVcpu<H> {
482482 }
483483
484484 fn setup_vmcs_host ( & self ) -> AxResult {
485+ // warn!("Host IA32_PAT {:#x}", Msr::IA32_PAT.read());
486+ // warn!("Host IA32_EFER {:#x}", Msr::IA32_EFER.read());
487+
485488 VmcsHost64 :: IA32_PAT . write ( Msr :: IA32_PAT . read ( ) ) ?;
486489 VmcsHost64 :: IA32_EFER . write ( Msr :: IA32_EFER . read ( ) ) ?;
487490
@@ -1647,3 +1650,8 @@ impl<H: AxVCpuHal> AxVcpuAccessGuestState for VmxVcpu<H> {
16471650 warn ! ( "Dumping VmxVcpu {:#x?}" , self ) ;
16481651 }
16491652}
1653+
1654+ pub fn invalid_ept ( eptp : EPTPointer ) -> AxResult < ( ) > {
1655+ use super :: instructions:: { InvEptType , invept} ;
1656+ unsafe { invept ( InvEptType :: SingleContext , eptp. bits ( ) ) . map_err ( as_axerr) }
1657+ }
You can’t perform that action at this time.
0 commit comments