KVM: nVMX: Clear segment cache after switching between L1 and L2
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 23 Feb 2013 21:35:37 +0000 (22:35 +0100)
committerGleb Natapov <gleb@redhat.com>
Wed, 27 Feb 2013 13:41:09 +0000 (15:41 +0200)
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>
arch/x86/kvm/vmx.c

index 329836a..3a58c1b 100644 (file)
@@ -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);