]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: MIPS/T&E: Reduce stale ASID checks
authorJames Hogan <james.hogan@imgtec.com>
Fri, 2 Dec 2016 23:40:52 +0000 (23:40 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 3 Feb 2017 15:21:10 +0000 (15:21 +0000)
commit91737ea205856c41183c2530fdb6b407ceeb3836
tree0a408ea37537015db8c09407788bca9954e6f245
parentb29e115ae451a67a8c044dffb3aa02b19d4570a0
KVM: MIPS/T&E: Reduce stale ASID checks

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: James 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
arch/mips/kvm/trap_emul.c