Thread (43 messages) 43 messages, 5 authors, 2026-01-15

Re: [PATCH v5 20/24] perf: arm_pmuv3: Handle IRQs for Partitioned PMU guest counters

From: Oliver Upton <oupton@kernel.org>
Date: 2025-12-09 22:45:58
Also in: kvm, kvmarm, linux-doc, linux-kselftest, linux-perf-users, lkml

On Tue, Dec 09, 2025 at 08:51:17PM +0000, Colton Lewis wrote:
Because ARM hardware is not yet capable of direct interrupt injection
PPI injection, it can do LPIs just fine.
quoted hunk ↗ jump to hunk
@@ -961,6 +964,12 @@ static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *cpu_pmu)
 		 */
 		perf_event_overflow(event, &data, regs);
 	}
+
+	govf = pmovsr & kvm_pmu_guest_counter_mask(cpu_pmu);
+
+	if (kvm_pmu_is_partitioned(cpu_pmu) && govf)
+		kvm_pmu_handle_guest_irq(govf);
+
The state ownership of this whole interaction is very odd. I would much
rather that KVM have full ownership of the range of counters while the
guest is loaded. By that I mean the PMUv3 driver only clears overflows
on PMCs that it owns and KVM will do the same on the back of the IRQ.

Similarly, KVM should be leaving the "guest" range of counters in a
non-overflow condition at vcpu_put().

Thanks,
Oliver
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help