KVM: MIPS: Implement HYPCALL emulation
authorJames Hogan <james.hogan@imgtec.com>
Tue, 14 Mar 2017 10:15:14 +0000 (10:15 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Tue, 28 Mar 2017 13:53:33 +0000 (14:53 +0100)
commit955d8dc3ee555e9320fabbeab0969f9cf7660f9d
treeb6a2787a9b99078a7387c90a2f8ddaee63840830
parenta6c09b9f9d1c3b1daf8e24e5556d73b9303843ef
KVM: MIPS: Implement HYPCALL emulation

Emulate the HYPCALL instruction added in the VZ ASE and used by the MIPS
paravirtualised guest support that is already merged. The new hypcall.c
handles arguments and the return value. No actual hypercalls are yet
supported, but this still allows us to safely step over hypercalls and
set an error code in the return value for forward compatibility.

Non-zero HYPCALL codes are not handled.

We also document the hypercall ABI which asm/kvm_para.h uses.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
Cc: David Daney <david.daney@cavium.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Documentation/virtual/kvm/hypercalls.txt
arch/mips/include/asm/kvm_host.h
arch/mips/include/uapi/asm/inst.h
arch/mips/kvm/Makefile
arch/mips/kvm/emulate.c
arch/mips/kvm/hypcall.c [new file with mode: 0644]
arch/mips/kvm/trap_emul.c