File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -6584,19 +6584,22 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
6584
6584
}
6585
6585
}
6586
6586
6587
- exec_control = vmcs_read32 (SECONDARY_VM_EXEC_CONTROL );
6588
6587
/* Exposing INVPCID only when PCID is exposed */
6589
6588
best = kvm_find_cpuid_entry (vcpu , 0x7 , 0 );
6590
6589
if (vmx_invpcid_supported () &&
6591
6590
best && (best -> ebx & bit (X86_FEATURE_INVPCID )) &&
6592
6591
guest_cpuid_has_pcid (vcpu )) {
6592
+ exec_control = vmcs_read32 (SECONDARY_VM_EXEC_CONTROL );
6593
6593
exec_control |= SECONDARY_EXEC_ENABLE_INVPCID ;
6594
6594
vmcs_write32 (SECONDARY_VM_EXEC_CONTROL ,
6595
6595
exec_control );
6596
6596
} else {
6597
- exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID ;
6598
- vmcs_write32 (SECONDARY_VM_EXEC_CONTROL ,
6599
- exec_control );
6597
+ if (cpu_has_secondary_exec_ctrls ()) {
6598
+ exec_control = vmcs_read32 (SECONDARY_VM_EXEC_CONTROL );
6599
+ exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID ;
6600
+ vmcs_write32 (SECONDARY_VM_EXEC_CONTROL ,
6601
+ exec_control );
6602
+ }
6600
6603
if (best )
6601
6604
best -> ebx &= ~bit (X86_FEATURE_INVPCID );
6602
6605
}
You can’t perform that action at this time.
0 commit comments