aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kvm/kvm_mips.c
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2014-05-29 05:16:31 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-05-30 07:01:03 -0400
commit16fd5c1de4f00c7887e4c715dd46872a97e30e25 (patch)
treeb0f8c2c644ea12fb68fea7e6e33e4813d873bfc0 /arch/mips/kvm/kvm_mips.c
parent7767b7d2f7c4d81f8c6710af1f5cb3fc038fa7be (diff)
MIPS: KVM: Add CP0_HWREna KVM register access
Implement KVM_{GET,SET}_ONE_REG ioctl based access to the guest CP0 HWREna register. This is so that userland can save and restore its value so that RDHWR instructions don't have to be emulated by the guest. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Gleb Natapov <gleb@kernel.org> Cc: kvm@vger.kernel.org Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Cc: David Daney <david.daney@cavium.com> Cc: Sanjay Lal <sanjayl@kymasys.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/kvm/kvm_mips.c')
-rw-r--r--arch/mips/kvm/kvm_mips.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/mips/kvm/kvm_mips.c b/arch/mips/kvm/kvm_mips.c
index 26f10fb8dcba..e4cb7cff9a28 100644
--- a/arch/mips/kvm/kvm_mips.c
+++ b/arch/mips/kvm/kvm_mips.c
@@ -529,6 +529,7 @@ static u64 kvm_mips_get_one_regs[] = {
529 KVM_REG_MIPS_CP0_USERLOCAL, 529 KVM_REG_MIPS_CP0_USERLOCAL,
530 KVM_REG_MIPS_CP0_PAGEMASK, 530 KVM_REG_MIPS_CP0_PAGEMASK,
531 KVM_REG_MIPS_CP0_WIRED, 531 KVM_REG_MIPS_CP0_WIRED,
532 KVM_REG_MIPS_CP0_HWRENA,
532 KVM_REG_MIPS_CP0_BADVADDR, 533 KVM_REG_MIPS_CP0_BADVADDR,
533 KVM_REG_MIPS_CP0_COUNT, 534 KVM_REG_MIPS_CP0_COUNT,
534 KVM_REG_MIPS_CP0_ENTRYHI, 535 KVM_REG_MIPS_CP0_ENTRYHI,
@@ -580,6 +581,9 @@ static int kvm_mips_get_reg(struct kvm_vcpu *vcpu,
580 case KVM_REG_MIPS_CP0_WIRED: 581 case KVM_REG_MIPS_CP0_WIRED:
581 v = (long)kvm_read_c0_guest_wired(cop0); 582 v = (long)kvm_read_c0_guest_wired(cop0);
582 break; 583 break;
584 case KVM_REG_MIPS_CP0_HWRENA:
585 v = (long)kvm_read_c0_guest_hwrena(cop0);
586 break;
583 case KVM_REG_MIPS_CP0_BADVADDR: 587 case KVM_REG_MIPS_CP0_BADVADDR:
584 v = (long)kvm_read_c0_guest_badvaddr(cop0); 588 v = (long)kvm_read_c0_guest_badvaddr(cop0);
585 break; 589 break;
@@ -691,6 +695,9 @@ static int kvm_mips_set_reg(struct kvm_vcpu *vcpu,
691 case KVM_REG_MIPS_CP0_WIRED: 695 case KVM_REG_MIPS_CP0_WIRED:
692 kvm_write_c0_guest_wired(cop0, v); 696 kvm_write_c0_guest_wired(cop0, v);
693 break; 697 break;
698 case KVM_REG_MIPS_CP0_HWRENA:
699 kvm_write_c0_guest_hwrena(cop0, v);
700 break;
694 case KVM_REG_MIPS_CP0_BADVADDR: 701 case KVM_REG_MIPS_CP0_BADVADDR:
695 kvm_write_c0_guest_badvaddr(cop0, v); 702 kvm_write_c0_guest_badvaddr(cop0, v);
696 break; 703 break;