diff options
author | 2018-10-08 23:42:17 +0300 | |
---|---|---|
committer | 2018-10-13 12:00:53 +0200 | |
commit | 1438921c6dc1bbdce800bfc7db04bd15cb260fc0 (patch) | |
tree | 946aa91da25432305550deeb279c02c6e8e99703 /tools/testing/selftests/kvm/include/sparsebit.h | |
parent | KVM: vmx: rename KVM_GUEST_CR0_MASK tp KVM_VM_CR0_ALWAYS_OFF (diff) | |
download | linux-dev-1438921c6dc1bbdce800bfc7db04bd15cb260fc0.tar.xz linux-dev-1438921c6dc1bbdce800bfc7db04bd15cb260fc0.zip |
KVM: nVMX: Flush TLB entries tagged by dest EPTP on L1<->L2 transitions
If L1 and L2 share VPID (because L1 don't use VPID or we haven't allocated
a vpid02), we need to flush TLB on L1<->L2 transitions.
Before this patch, this TLB flushing was done by vmx_flush_tlb().
If L0 use EPT, this will translate into INVEPT(active_eptp);
However, if L1 use EPT, in L1->L2 VMEntry, active EPTP is EPTP01 but
TLB entries populated by L2 are tagged with EPTP02.
Therefore we should delay vmx_flush_tlb() until active_eptp is EPTP02.
To achieve this, instead of directly calling vmx_flush_tlb() we request
it to be called by KVM_REQ_TLB_FLUSH which is evaluated after
KVM_REQ_LOAD_CR3 which sets the active_eptp to EPTP02 as required.
Similarly, on L2->L1 VMExit, active EPTP is EPTP02 but TLB entries
populated by L1 are tagged with EPTP01 and therefore we should delay
vmx_flush_tlb() until active_eptp is EPTP01.
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>
Diffstat (limited to 'tools/testing/selftests/kvm/include/sparsebit.h')
0 files changed, 0 insertions, 0 deletions