]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Don't flush TLB when vmcs12 uses VPID
authorLiran Alon <liran.alon@oracle.com>
Tue, 22 May 2018 14:16:14 +0000 (17:16 +0300)
committerRadim Krčmář <rkrcmar@redhat.com>
Thu, 24 May 2018 17:45:40 +0000 (19:45 +0200)
commit039613c4896b930e34f2668afc1e6d8cd9ec02a7
treef2b4c817386ca7c85867ccde7023dd8bf32d84d6
parent72b71d31f565e999b983c6115eb27ca7ab059ce4
KVM: nVMX: Don't flush TLB when vmcs12 uses VPID

Since commit f68557d26e2f ("KVM: nVMX: nested VPID emulation"),
vmcs01 and vmcs02 don't share the same VPID. vmcs01 uses vmx->vpid
while vmcs02 uses vmx->nested.vpid02. This was done such that TLB
flush could be avoided when switching between L1 and L2.

However, the above mentioned commit only changed L2 VMEntry logic to
not flush TLB when switching from L1 to L2. It forgot to also remove
the TLB flush which is done when simulating a VMExit from L2 to L1.

To fix this issue, on VMExit from L2 to L1 we flush TLB only in case
vmcs01 enables VPID and vmcs01->vpid==vmcs02->vpid. This happens when
vmcs01 enables VPID and vmcs12 does not.

Fixes: f68557d26e2f ("KVM: nVMX: nested VPID emulation")
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c