kvm: x86: Skip TLB flush on fast CR3 switch when indicated by guest
authorJunaid Shahid <junaids@google.com>
Wed, 27 Jun 2018 21:59:15 +0000 (14:59 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Aug 2018 15:58:58 +0000 (17:58 +0200)
commitade61e2824443a208bb3aaafd8b345ce878298cd
treeaae386f7ee3a83188f0d7e5b971763970019d490
parenteb4b248e152d3ecf189b9d32c04961360dbd938a
kvm: x86: Skip TLB flush on fast CR3 switch when indicated by guest

When PCIDs are enabled, the MSb of the source operand for a MOV-to-CR3
instruction indicates that the TLB doesn't need to be flushed.

This change enables this optimization for MOV-to-CR3s in the guest
that have been intercepted by KVM for shadow paging and are handled
within the fast CR3 switch path.

Signed-off-by: Junaid Shahid <junaids@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c