KVM: PPC: BookE: Add MCSR SPR support
authorAlexander Graf <agraf@suse.de>
Mon, 13 Aug 2012 12:50:54 +0000 (14:50 +0200)
committerAlexander Graf <agraf@suse.de>
Fri, 5 Oct 2012 21:38:48 +0000 (23:38 +0200)
Add support for the MCSR SPR. This only implements the SPR storage
bits, not actual machine checks.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/booke_emulate.c

index cc99a0b3d202bdb33003f10ef8ad6aab46e4bc4f..514790f41abafa9c752ebdaa90bde9f1e961423f 100644 (file)
@@ -237,6 +237,9 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)
        case SPRN_IVOR15:
                vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG] = spr_val;
                break;
+       case SPRN_MCSR:
+               vcpu->arch.mcsr &= ~spr_val;
+               break;
 
        default:
                emulated = EMULATE_FAIL;
@@ -329,6 +332,9 @@ int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val)
        case SPRN_IVOR15:
                *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG];
                break;
+       case SPRN_MCSR:
+               *spr_val = vcpu->arch.mcsr;
+               break;
 
        default:
                emulated = EMULATE_FAIL;