KVM: PPC: Pass through program interrupts
authorAlexander Graf <agraf@suse.de>
Sun, 10 Jan 2010 02:27:32 +0000 (03:27 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:35:49 +0000 (12:35 -0300)
When we get a program interrupt in guest kernel mode, we try to emulate the
instruction.

If that doesn't fail, we report to the user and try again - at the exact same
instruction pointer. So if the guest kernel really does trigger an invalid
instruction, we loop forever.

So let's better go and forward program exceptions to the guest when we don't
know the instruction we're supposed to emulate.

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

index 8b0ba0b69c2a1c475d1a87d3ab86e301a98c190d..b905623735bd2da35fca9536939a97a45ab0b0c5 100644 (file)
@@ -476,6 +476,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
                        advance = 0;
                        printk(KERN_ERR "Couldn't emulate instruction 0x%08x "
                               "(op %d xop %d)\n", inst, get_op(inst), get_xop(inst));
+                       kvmppc_core_queue_program(vcpu, 0);
                }
        }