summaryrefslogtreecommitdiffstats
path: root/arch/mips/kvm
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-06-15 19:29:53 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2016-06-15 23:58:31 +0200
commitb937ff628fa76b242a74cb9087df972d5f1cecbb (patch)
tree9d49eb854596a321fb38b70d6d79a81609188c86 /arch/mips/kvm
parentaff565aab961d3cab3299a7008af6cdef88b79a0 (diff)
downloadblackbird-obmc-linux-b937ff628fa76b242a74cb9087df972d5f1cecbb.tar.gz
blackbird-obmc-linux-b937ff628fa76b242a74cb9087df972d5f1cecbb.zip
MIPS: KVM: Don't hardcode restored HWREna
KVM modifies CP0_HWREna during guest execution so it can trap and emulate RDHWR instructions, however it always restores the hardcoded value 0x2000000F. This assumes the presence of the UserLocal register, and the absence of any implementation dependent or future HW registers. Fix by exporting the value that traps.c write into CP0_HWREna, and loading from there instead of hard coding. 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: linux-mips@linux-mips.org Cc: kvm@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/kvm')
-rw-r--r--arch/mips/kvm/locore.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/kvm/locore.S b/arch/mips/kvm/locore.S
index f87bec546366..698286c0f732 100644
--- a/arch/mips/kvm/locore.S
+++ b/arch/mips/kvm/locore.S
@@ -381,7 +381,7 @@ NESTED (MIPSX(GuestException), CALLFRAME_SIZ, ra)
mtc0 k0, CP0_DDATA_LO
/* Restore RDHWR access */
- PTR_LI k0, 0x2000000F
+ INT_L k0, hwrena
mtc0 k0, CP0_HWRENA
/* Jump to handler */
@@ -553,7 +553,7 @@ __kvm_mips_return_to_host:
mtlo k0
/* Restore RDHWR access */
- PTR_LI k0, 0x2000000F
+ INT_L k0, hwrena
mtc0 k0, CP0_HWRENA
/* Restore RA, which is the address we will return to */
OpenPOWER on IntegriCloud