summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorJan Kiszka2013-02-23 22:35:37 +0100
committerGleb Natapov2013-02-27 14:41:09 +0100
commit36c3cc422b7c5d3cd84cbac769758b197e08f221 (patch)
treecea394cbfda87279e37bc8dd1145ae147dc0f2b4 /arch/x86/kvm/vmx.c
parentKVM: nVMX: Advertise PAUSE and WBINVD exiting support (diff)
downloadkernel-qcow2-linux-36c3cc422b7c5d3cd84cbac769758b197e08f221.tar.gz
kernel-qcow2-linux-36c3cc422b7c5d3cd84cbac769758b197e08f221.tar.xz
kernel-qcow2-linux-36c3cc422b7c5d3cd84cbac769758b197e08f221.zip
KVM: nVMX: Clear segment cache after switching between L1 and L2
Switching the VMCS obviously invalidates what may have been cached about the guest segments. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 329836af3240..3a58c1b8764e 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7271,6 +7271,8 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
vcpu->cpu = cpu;
put_cpu();
+ vmx_segment_cache_clear(vmx);
+
vmcs12->launch_state = 1;
prepare_vmcs02(vcpu, vmcs12);
@@ -7517,6 +7519,8 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu)
vcpu->cpu = cpu;
put_cpu();
+ vmx_segment_cache_clear(vmx);
+
/* if no vmcs02 cache requested, remove the one we used */
if (VMCS02_POOL_SIZE == 0)
nested_free_vmcs02(vmx, vmx->nested.current_vmptr);