]> git.baikalelectronics.ru Git - kernel.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)
commit711f5fe9d228d12c42e9fc75edc07d04a1b70c2f
tree0a408ea37537015db8c09407788bca9954e6f245
parentf4854c2fed5a99c64d29975d65214051e1217f9d
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