]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MIPS: Use uaccess to read/modify guest instructions
authorJames Hogan <james.hogan@imgtec.com>
Fri, 19 Aug 2016 14:27:22 +0000 (15:27 +0100)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 3 Feb 2017 15:21:01 +0000 (15:21 +0000)
commit6d215e7edba4a915cdbcbd85b3c2a9fbd2abecdd
tree2f48a1a472f67bd244d70a08fffc56e3770e66eb
parentcf56d48a6104d85185b49b32520627dc19373496
KVM: MIPS: Use uaccess to read/modify guest instructions

Now that we have GVA page tables, use standard user accesses with page
faults disabled to read & modify guest instructions. This should be more
robust (than the rather dodgy method of accessing guest mapped segments
by just directly addressing them) and will also work with Enhanced
Virtual Addressing (EVA) host kernel configurations where dedicated
instructions are needed for accessing user mode memory.

For simplicity and speed we do this regardless of the guest segment the
address resides in, rather than handling guest KSeg0 specially with
kmap_atomic() as before.

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/dyntrans.c
arch/mips/kvm/mmu.c
arch/mips/kvm/trap_emul.c