File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -677,25 +677,30 @@ impl<H: AxVCpuHal> VmxVcpu<H> {
677
677
678
678
// Enable EPT, RDTSCP, INVPCID, and unrestricted guest.
679
679
use SecondaryControls as CpuCtrl2 ;
680
- let mut val = CpuCtrl2 :: ENABLE_EPT
681
- | CpuCtrl2 :: UNRESTRICTED_GUEST
682
- | CpuCtrl2 :: ENABLE_USER_WAIT_PAUSE
683
- | CpuCtrl2 :: ENABLE_VM_FUNCTIONS ;
680
+ let mut val =
681
+ CpuCtrl2 :: ENABLE_EPT | CpuCtrl2 :: UNRESTRICTED_GUEST | CpuCtrl2 :: ENABLE_VM_FUNCTIONS ;
682
+
684
683
if let Some ( features) = raw_cpuid. get_extended_processor_and_feature_identifiers ( ) {
685
684
if features. has_rdtscp ( ) {
686
685
val |= CpuCtrl2 :: ENABLE_RDTSCP ;
687
686
}
688
687
}
688
+
689
689
if let Some ( features) = raw_cpuid. get_extended_feature_info ( ) {
690
690
if features. has_invpcid ( ) {
691
691
val |= CpuCtrl2 :: ENABLE_INVPCID ;
692
692
}
693
+ if features. has_waitpkg ( ) {
694
+ val |= CpuCtrl2 :: ENABLE_USER_WAIT_PAUSE ;
695
+ }
693
696
}
697
+
694
698
if let Some ( features) = raw_cpuid. get_extended_state_info ( ) {
695
699
if features. has_xsaves_xrstors ( ) {
696
700
val |= CpuCtrl2 :: ENABLE_XSAVES_XRSTORS ;
697
701
}
698
702
}
703
+
699
704
vmcs:: set_control (
700
705
VmcsControl32 :: SECONDARY_PROCBASED_EXEC_CONTROLS ,
701
706
Msr :: IA32_VMX_PROCBASED_CTLS2 ,
You can’t perform that action at this time.
0 commit comments