MIPS: KVM: Allow ULRI to restrict UserLocal register
authorJames Hogan <james.hogan@imgtec.com>
Wed, 15 Jun 2016 18:29:54 +0000 (19:29 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Jun 2016 21:58:35 +0000 (23:58 +0200)
commitcef061d086b1de75445cba63af5306f98fb52f4b
tree2d3f2f8d40bf0c4eb49111c8a6fa205166007ad6
parentb937ff628fa76b242a74cb9087df972d5f1cecbb
MIPS: KVM: Allow ULRI to restrict UserLocal register

The ULRI bit in Config3 specifies whether the UserLocal register is
implemented, but it is assumed to always be set. Now that the Config
registers can be modified by userland, allow Config3.ULRI to be cleared
and check ULRI before allowing the corresponding bit to be set in
HWREna.

In fact any HWREna bits corresponding to unimplemented RDHWR registers
should read as zero and be ignored on write, so we actually prevent
other unimplemented bits being set 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>
arch/mips/kvm/emulate.c