]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: KVM: Don't hardcode restored HWREna
authorJames Hogan <james.hogan@imgtec.com>
Wed, 15 Jun 2016 18:29:53 +0000 (19:29 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Jun 2016 21:58:31 +0000 (23:58 +0200)
commit621f75f152b9055257c8915e240537073dcca7e5
tree9d49eb854596a321fb38b70d6d79a81609188c86
parent48906b0703fcfd8b87e54db3aacc21a8d92bc59e
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>
arch/mips/include/asm/setup.h
arch/mips/kernel/traps.c
arch/mips/kvm/locore.S