KVM: VMX: align vmx->nested.nested_vmx_secondary_ctls_high to vmx->rdtscp_enabled
The SECONDARY_EXEC_RDTSCP must be available iff RDTSCP is enabled in the guest. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
+8
-3
@@ -8686,9 +8686,14 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
|
|||||||
exec_control);
|
exec_control);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nested && !vmx->rdtscp_enabled)
|
if (nested) {
|
||||||
vmx->nested.nested_vmx_secondary_ctls_high &=
|
if (vmx->rdtscp_enabled)
|
||||||
~SECONDARY_EXEC_RDTSCP;
|
vmx->nested.nested_vmx_secondary_ctls_high |=
|
||||||
|
SECONDARY_EXEC_RDTSCP;
|
||||||
|
else
|
||||||
|
vmx->nested.nested_vmx_secondary_ctls_high &=
|
||||||
|
~SECONDARY_EXEC_RDTSCP;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exposing INVPCID only when PCID is exposed */
|
/* Exposing INVPCID only when PCID is exposed */
|
||||||
|
|||||||
Reference in New Issue
Block a user