File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -6549,19 +6549,22 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
6549
6549
}
6550
6550
}
6551
6551
6552
- exec_control = vmcs_read32 (SECONDARY_VM_EXEC_CONTROL );
6553
6552
/* Exposing INVPCID only when PCID is exposed */
6554
6553
best = kvm_find_cpuid_entry (vcpu , 0x7 , 0 );
6555
6554
if (vmx_invpcid_supported () &&
6556
6555
best && (best -> ebx & bit (X86_FEATURE_INVPCID )) &&
6557
6556
guest_cpuid_has_pcid (vcpu )) {
6557
+ exec_control = vmcs_read32 (SECONDARY_VM_EXEC_CONTROL );
6558
6558
exec_control |= SECONDARY_EXEC_ENABLE_INVPCID ;
6559
6559
vmcs_write32 (SECONDARY_VM_EXEC_CONTROL ,
6560
6560
exec_control );
6561
6561
} else {
6562
- exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID ;
6563
- vmcs_write32 (SECONDARY_VM_EXEC_CONTROL ,
6564
- exec_control );
6562
+ if (cpu_has_secondary_exec_ctrls ()) {
6563
+ exec_control = vmcs_read32 (SECONDARY_VM_EXEC_CONTROL );
6564
+ exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID ;
6565
+ vmcs_write32 (SECONDARY_VM_EXEC_CONTROL ,
6566
+ exec_control );
6567
+ }
6565
6568
if (best )
6566
6569
best -> ebx &= ~bit (X86_FEATURE_INVPCID );
6567
6570
}
You can’t perform that action at this time.
0 commit comments