diff options
author | James Hogan | 2016-06-23 18:34:45 +0200 |
---|---|---|
committer | Paolo Bonzini | 2016-07-05 16:08:54 +0200 |
commit | 1e5217f54251ddd339e00a0b30f126589737d467 (patch) | |
tree | 3e3b80abbf3ff14434c8e2225db39c7dceb29572 /arch/mips/kvm/mips.c | |
parent | MIPS: KVM: Drop redundant restore of DDATA_LO (diff) | |
download | kernel-qcow2-linux-1e5217f54251ddd339e00a0b30f126589737d467.tar.gz kernel-qcow2-linux-1e5217f54251ddd339e00a0b30f126589737d467.tar.xz kernel-qcow2-linux-1e5217f54251ddd339e00a0b30f126589737d467.zip |
MIPS: KVM: Dynamically choose scratch registers
Scratch cop0 registers are needed by KVM to be able to save/restore all
the GPRs, including k0/k1, and for storing the VCPU pointer. However no
registers are universally suitable for these purposes, so the decision
should be made at runtime.
Until now, we've used DDATA_LO to store the VCPU pointer, and ErrorEPC
as a temporary. It could be argued that this is abuse of those
registers, and DDATA_LO is known not to be usable on certain
implementations (Cavium Octeon). If KScratch registers are present, use
them instead.
We save & restore the temporary register in addition to the VCPU pointer
register when using a KScratch register for it, as it may be used for
normal host TLB handling 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
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/kvm/mips.c')
-rw-r--r-- | arch/mips/kvm/mips.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c index 9f36dcb3c580..26cc0b93c565 100644 --- a/arch/mips/kvm/mips.c +++ b/arch/mips/kvm/mips.c @@ -1775,6 +1775,10 @@ static int __init kvm_mips_init(void) { int ret; + ret = kvm_mips_entry_setup(); + if (ret) + return ret; + ret = kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); if (ret) |