]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Assume TLB entries of L1 and L2 are tagged differently if L0 use EPT
authorLiran Alon <liran.alon@oracle.com>
Wed, 20 Nov 2019 12:24:52 +0000 (14:24 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Nov 2019 13:23:27 +0000 (14:23 +0100)
commit82d68ee9ff55ab6d97fc2031f27bb9e0a091ca6b
treeca2aaabd383fee2e52e7f3ff90eed6998f31d4ac
parent46eca39a4f9bd31efabd31bcbe10af534c526f99
KVM: nVMX: Assume TLB entries of L1 and L2 are tagged differently if L0 use EPT

Since commit 7cbfd23bd5d3 ("kvm: mmu: Add guest_mode to kvm_mmu_page_role"),
guest_mode was added to mmu-role and therefore if L0 use EPT, it will
always run L1 and L2 with different EPTP. i.e. EPTP01!=EPTP02.

Because TLB entries are tagged with EP4TA, KVM can assume
TLB entries populated while running L2 are tagged differently
than TLB entries populated while running L1.

Therefore, update nested_has_guest_tlb_tag() to consider if
L0 use EPT instead of if L1 use EPT.

Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c