]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Do not flush TLB on L1<->L2 transitions if L1 uses VPID and EPT
authorLiran Alon <liran.alon@oracle.com>
Mon, 8 Oct 2018 20:42:20 +0000 (23:42 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 13 Oct 2018 10:00:55 +0000 (12:00 +0200)
commit216b2cef4455e05291c353a53047661f80048343
treeb560ba2cdb3edc1a9f6f4fe5d27a80ada2f42af4
parent7166a2598c2b0eba011a0f708bec64c08d7bc57c
KVM: nVMX: Do not flush TLB on L1<->L2 transitions if L1 uses VPID and EPT

If L1 uses VPID, it expects TLB to not be flushed on L1<->L2
transitions. However, code currently flushes TLB nonetheless if we
didn't allocate a vpid02 for L2. As in this case,
vmcs02->vpid == vmcs01->vpid == vmx->vpid.

But, if L1 uses EPT, TLB entires populated by L2 are tagged with EPTP02
while TLB entries populated by L1 are tagged with EPTP01.
Therefore, we can also avoid TLB flush if L1 uses VPID and EPT.

Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c