]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: MIPS/T&E: Restore host asid on return to host
authorJames Hogan <james.hogan@imgtec.com>
Fri, 18 Nov 2016 13:25:24 +0000 (13:25 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 3 Feb 2017 15:20:47 +0000 (15:20 +0000)
commit91cdee5710d5fe8f81915307b5ff38d364fbde33
treed53768eb9f21961659e0909bcf3b868d4ef85049
parenta2c046e40ff16ef6c20d534b0d77d526bc02a684
KVM: MIPS/T&E: Restore host asid on return to host

We only need the guest ASID loaded while in guest context, i.e. while
running guest code and while handling guest exits. We load the guest
ASID when entering the guest, however we restore the host ASID later
than necessary, when the VCPU state is saved i.e. vcpu_put() or slightly
earlier if preempted after returning to the host.

This mismatch is both unpleasant and causes redundant host ASID restores
in kvm_trap_emul_vcpu_put(). Lets explicitly restore the host ASID when
returning to the host, and don't bother restoring the host ASID on
context switch in unless we're already in guest context.

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