Skip to contentSkip to conversation

KVM: PPC: Make Performance Counters work

PATCH In review Alexander Graf 2 participants 3 messages Apr 16, 2010 – Apr 19, 2010 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 arch/powerpc/kvm/book3s.c            |    3 +++
 arch/powerpc/kvm/book3s_interrupts.S |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
arch/powerpc/kvm/book3s.c +3 -0
index a7de709..a03163b 100644
@@ -872,6 +872,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;
arch/powerpc/kvm/book3s_interrupts.S +2 -0
index f5b3358..e486193 100644
@@ -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
Signature · 1 line
1.6.0.2
#2 lore raw
In reply to a message not in the archive
Quoted 8 lines · Alexander Graf

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.

Doesn't apply - does it depend on another patchset?

Signature · 1 line
error compiling committee.c: too many arguments to function
#4 lore raw
In reply to a message not in the archive
Quoted 11 lines · Avi Kivity
Quoted 8 lines · Alexander Graf

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.

Doesn't apply - does it depend on another patchset?

This patch is deprecated by the "Post-PPC32" patchset. I only noted that in the cover letter of the Post-PPC32 patchset, not in a reply to this patch. Sorry.

Alex