KVM: PPC: booke: Readd debug abort code for machine check
authorAlexander Graf <agraf@suse.de>
Mon, 20 Feb 2012 11:21:18 +0000 (12:21 +0100)
committerAvi Kivity <avi@redhat.com>
Sun, 8 Apr 2012 09:55:17 +0000 (12:55 +0300)
When during guest execution we get a machine check interrupt, we don't
know how to handle it yet. So let's add the error printing code back
again that we dropped accidently earlier and tell user space that something
went really wrong.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/booke.c

index 11b06251e42e7dc4705a3889e671d1dd24deb1d5..af02d9dbd9510f4c281d14a37dea2724a3dbe268 100644 (file)
@@ -634,7 +634,12 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
 
        switch (exit_nr) {
        case BOOKE_INTERRUPT_MACHINE_CHECK:
-               r = RESUME_GUEST;
+               printk("MACHINE CHECK: %lx\n", mfspr(SPRN_MCSR));
+               kvmppc_dump_vcpu(vcpu);
+               /* For debugging, send invalid exit reason to user space */
+               run->hw.hardware_exit_reason = ~1ULL << 32;
+               run->hw.hardware_exit_reason |= mfspr(SPRN_MCSR);
+               r = RESUME_HOST;
                break;
 
        case BOOKE_INTERRUPT_EXTERNAL: