Skip to content

Commit

Permalink
kvm: vmx: Don't use INVVPID when EPT is enabled
Browse files Browse the repository at this point in the history
According to the Intel SDM, volume 3, section 28.3.2: Creating and
Using Cached Translation Information, "No linear mappings are used
while EPT is in use." INVEPT will invalidate both the guest-physical
mappings and the combined mappings in the TLBs and paging-structure
caches, so an INVVPID is superfluous.

Signed-off-by: Jim Mattson <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Signed-off-by: Radim Krčmář <[email protected]>
  • Loading branch information
jsmattsonjr authored and rkrcmar committed Apr 7, 2017
1 parent 715958f commit f0b98c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4017,11 +4017,12 @@ static void exit_lmode(struct kvm_vcpu *vcpu)

static inline void __vmx_flush_tlb(struct kvm_vcpu *vcpu, int vpid)
{
vpid_sync_context(vpid);
if (enable_ept) {
if (!VALID_PAGE(vcpu->arch.mmu.root_hpa))
return;
ept_sync_context(construct_eptp(vcpu->arch.mmu.root_hpa));
} else {
vpid_sync_context(vpid);
}
}

Expand Down

0 comments on commit f0b98c0

Please sign in to comment.