aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-04-19 20:49:47 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:18:57 -0400
commit7fdaec997cc8ef77e8da7ed70f3d9f074b61c31f (patch)
treeaa72586e8eb24d32353c54158a51470e9245122d /arch/powerpc/kvm
parentaf7b4d104b36e782a5a97dd55958c3c63964e088 (diff)
KVM: PPC: Make Performance Counters work
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>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/book3s.c3
-rw-r--r--arch/powerpc/kvm/book3s_interrupts.S2
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 6ee9c5e1ffe2..f66de7e518f7 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -873,6 +873,9 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
873 vcpu->stat.ext_intr_exits++; 873 vcpu->stat.ext_intr_exits++;
874 r = RESUME_GUEST; 874 r = RESUME_GUEST;
875 break; 875 break;
876 case BOOK3S_INTERRUPT_PERFMON:
877 r = RESUME_GUEST;
878 break;
876 case BOOK3S_INTERRUPT_PROGRAM: 879 case BOOK3S_INTERRUPT_PROGRAM:
877 { 880 {
878 enum emulation_result er; 881 enum emulation_result er;
diff --git a/arch/powerpc/kvm/book3s_interrupts.S b/arch/powerpc/kvm/book3s_interrupts.S
index a1b50280dc47..2f0bc928b08a 100644
--- a/arch/powerpc/kvm/book3s_interrupts.S
+++ b/arch/powerpc/kvm/book3s_interrupts.S
@@ -228,6 +228,8 @@ no_dcbz32_off:
228 beq call_linux_handler 228 beq call_linux_handler
229 cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER 229 cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER
230 beq call_linux_handler 230 beq call_linux_handler
231 cmpwi r12, BOOK3S_INTERRUPT_PERFMON
232 beq call_linux_handler
231 233
232 /* Back to EE=1 */ 234 /* Back to EE=1 */
233 mtmsr r6 235 mtmsr r6