• James Hogan's avatar
    KVM: MIPS/T&E: Reduce stale ASID checks · 91737ea2
    James Hogan authored
    The stale ASID checks taking place on VCPU load can be reduced:
    
    - Now that we check for a stale ASID on guest re-entry, there is no need
      to do so when loading the VCPU outside of guest context, since it will
      happen before entering the guest. Note that a lot of KVM VCPU ioctls
      will cause the VCPU to be loaded but guest context won't be entered.
    
    - There is no need to check for a stale kernel_mm ASID when the guest is
      in user mode and vice versa. In fact doing so can potentially be
      problematic since the user_mm ASID regeneration may trigger a new ASID
      cycle, which would cause the kern_mm ASID to become stale after it has
      been checked for staleness.
    
    Therefore only check the ASID for the mm corresponding to the current
    guest mode, and only if we're already in guest context. We drop some of
    the related kvm_debug() calls here too.
    Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: "Radim Krčmář" <rkrcmar@redhat.com>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    91737ea2
trap_emul.c 25 KB