]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: MIPS/T&E: Add lockless GVA access helpers
authorJames Hogan <james.hogan@imgtec.com>
Mon, 28 Nov 2016 23:04:52 +0000 (23:04 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 3 Feb 2017 15:21:11 +0000 (15:21 +0000)
commit1880afd6057f34586919715e8ffe9c5858f4a326
tree25fff058093cb8d7efddefe0b31558b15c7f3374
parent91737ea205856c41183c2530fdb6b407ceeb3836
KVM: MIPS/T&E: Add lockless GVA access helpers

Add helpers to allow for lockless direct access to the GVA space, by
changing the VCPU mode to READING_SHADOW_PAGE_TABLES for the duration of
the access. This allows asynchronous TLB flush requests in future
patches to safely trigger either a TLB flush before the direct GVA space
access, or a delay until the in-progress lockless direct access is
complete.

The kvm_trap_emul_gva_lockless_begin() and
kvm_trap_emul_gva_lockless_end() helpers take care of guarding the
direct GVA accesses, and kvm_trap_emul_gva_fault() tries to handle a
uaccess fault resulting from a flush having taken place.

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/include/asm/kvm_host.h
arch/mips/kvm/mmu.c
arch/mips/kvm/trap_emul.c