]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: PPC: Make Performance Counters work
authorAlexander Graf <agraf@suse.de>
Tue, 20 Apr 2010 00:49:47 +0000 (02:49 +0200)
committerAvi Kivity <avi@redhat.com>
Mon, 17 May 2010 09:18:57 +0000 (12:18 +0300)
When we get a performance counter interrupt we need to route it on to the
Linux handler after we got out of the guest context. We also need to tell
our handling code that this particular interrupt doesn't need treatment.

So let's add those two bits in, making perf work while having a KVM guest
running.

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

index 6ee9c5e1ffe2e7f8f4ad66b7689cf2eca2f7b76c..f66de7e518f7b8ec53b1b040f39a51b2fc835cf8 100644 (file)
@@ -873,6 +873,9 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
                vcpu->stat.ext_intr_exits++;
                r = RESUME_GUEST;
                break;
+       case BOOK3S_INTERRUPT_PERFMON:
+               r = RESUME_GUEST;
+               break;
        case BOOK3S_INTERRUPT_PROGRAM:
        {
                enum emulation_result er;
index a1b50280dc4749100893c226e4834058ffa1a35f..2f0bc928b08a0ff8499dd75052e2a61a7d19a330 100644 (file)
@@ -228,6 +228,8 @@ no_dcbz32_off:
        beq     call_linux_handler
        cmpwi   r12, BOOK3S_INTERRUPT_DECREMENTER
        beq     call_linux_handler
+       cmpwi   r12, BOOK3S_INTERRUPT_PERFMON
+       beq     call_linux_handler
 
        /* Back to EE=1 */
        mtmsr   r6