KVM: PPC: BOOKE: Add one reg interface for DBSR
authorBharat Bhushan <Bharat.Bhushan@freescale.com>
Wed, 6 Aug 2014 06:38:56 +0000 (12:08 +0530)
committerAlexander Graf <agraf@suse.de>
Mon, 22 Sep 2014 08:11:30 +0000 (10:11 +0200)
Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/uapi/asm/kvm.h
arch/powerpc/kvm/booke.c

index e0e49dbb145de5d0601aac18099eea223a2e919d..3ca357a7a26a9b1071694eae50a37eb50bad9192 100644 (file)
@@ -557,6 +557,7 @@ struct kvm_get_htab_header {
 #define KVM_REG_PPC_DABRX      (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8)
 #define KVM_REG_PPC_WORT       (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9)
 #define KVM_REG_PPC_SPRG9      (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba)
+#define KVM_REG_PPC_DBSR       (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbb)
 
 /* Transactional Memory checkpointed state:
  * This is all GPRs, all VSX regs and a subset of SPRs
index e47de01b0dbbd0aeeaf149fd9586b6939154f4cd..074b7fc795b78fd30add335c223c30583bbaf957 100644 (file)
@@ -1494,6 +1494,9 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)
        case KVM_REG_PPC_DAC2:
                val = get_reg_val(reg->id, vcpu->arch.dbg_reg.dac2);
                break;
+       case KVM_REG_PPC_DBSR:
+               val = get_reg_val(reg->id, vcpu->arch.dbsr);
+               break;
        case KVM_REG_PPC_EPR: {
                u32 epr = kvmppc_get_epr(vcpu);
                val = get_reg_val(reg->id, epr);
@@ -1564,6 +1567,9 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)
        case KVM_REG_PPC_DAC2:
                vcpu->arch.dbg_reg.dac2 = set_reg_val(reg->id, val);
                break;
+       case KVM_REG_PPC_DBSR:
+               vcpu->arch.dbsr = set_reg_val(reg->id, val);
+               break;
        case KVM_REG_PPC_EPR: {
                u32 new_epr = set_reg_val(reg->id, val);
                kvmppc_set_epr(vcpu, new_epr);