summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorPaolo Bonzini2015-09-15 17:34:42 +0200
committerPaolo Bonzini2015-10-01 15:06:38 +0200
commit8b97265a1516819d54c2d24b3874489a52f269d4 (patch)
treeca9d95e974cc16472de502d5e5c8deda530c0d69 /arch/x86
parentKVM: VMX: simplify invpcid handling in vmx_cpuid_update() (diff)
downloadkernel-qcow2-linux-8b97265a1516819d54c2d24b3874489a52f269d4.tar.gz
kernel-qcow2-linux-8b97265a1516819d54c2d24b3874489a52f269d4.tar.xz
kernel-qcow2-linux-8b97265a1516819d54c2d24b3874489a52f269d4.zip
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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/vmx.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a5b26a940df2..dad471f8ca57 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -8686,9 +8686,14 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
exec_control);
}
- if (nested && !vmx->rdtscp_enabled)
- vmx->nested.nested_vmx_secondary_ctls_high &=
- ~SECONDARY_EXEC_RDTSCP;
+ if (nested) {
+ if (vmx->rdtscp_enabled)
+ 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 */