linux/arch/x86/kvm/svm
Sean Christopherson eeeb4f67a6 KVM: x86: Introduce KVM_REQ_TLB_FLUSH_CURRENT to flush current ASID
Add KVM_REQ_TLB_FLUSH_CURRENT to allow optimized TLB flushing of VMX's
EPTP/VPID contexts[*] from the KVM MMU and/or in a deferred manner, e.g.
to flush L2's context during nested VM-Enter.

Convert KVM_REQ_TLB_FLUSH to KVM_REQ_TLB_FLUSH_CURRENT in flows where
the flush is directly associated with vCPU-scoped instruction emulation,
i.e. MOV CR3 and INVPCID.

Add a comment in vmx_vcpu_load_vmcs() above its KVM_REQ_TLB_FLUSH to
make it clear that it deliberately requests a flush of all contexts.

Service any pending flush request on nested VM-Exit as it's possible a
nested VM-Exit could occur after requesting a flush for L2.  Add the
same logic for nested VM-Enter even though it's _extremely_ unlikely
for flush to be pending on nested VM-Enter, but theoretically possible
(in the future) due to RSM (SMM) emulation.

[*] Intel also has an Address Space Identifier (ASID) concept, e.g.
    EPTP+VPID+PCID == ASID, it's just not documented in the SDM because
    the rules of invalidation are different based on which piece of the
    ASID is being changed, i.e. whether the EPTP, VPID, or PCID context
    must be invalidated.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200320212833.3507-25-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-04-21 09:12:53 -04:00
..
avic.c KVM: SVM: Move AVIC code to separate file 2020-04-03 10:53:56 -04:00
nested.c KVM: x86: Drop @invalidate_gpa param from kvm_x86_ops' tlb_flush() 2020-04-21 09:12:49 -04:00
pmu.c
sev.c KVM: SVM: Fix build error due to missing release_pages() include 2020-04-15 12:08:37 -04:00
svm.c KVM: x86: Introduce KVM_REQ_TLB_FLUSH_CURRENT to flush current ASID 2020-04-21 09:12:53 -04:00
svm.h KVM: x86: Drop @invalidate_gpa param from kvm_x86_ops' tlb_flush() 2020-04-21 09:12:49 -04:00
vmenter.S KVM: SVM: Do not setup frame pointer in __svm_vcpu_run 2020-04-15 12:08:38 -04:00