* [PATCH 0/2] KVM: arm64: Fix PMU counter overflows for non-protected guests in pKVM
@ 2026-12-04 10:49 Fuad Tabba
2026-12-04 10:49 ` [PATCH 1/2] KVM: arm64: Don't copy the PMU registers between the host and hyp vCPU Fuad Tabba
2026-12-04 10:49 ` [PATCH 2/2] KVM: arm64: selftests: Test PMU counter overflow in vpmu_counter_access Fuad Tabba
0 siblings, 2 replies; 5+ messages in thread
From: Fuad Tabba @ 2026-12-04 10:49 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton
Cc: kvmarm, linux-arm-kernel, kvm, linux-kselftest, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
Will Deacon, Mark Rutland, Vincent Donnefort, Paolo Bonzini,
Sean Christopherson, Shuah Khan, James Clark, Fuad Tabba
Hi folks,
A non-protected guest in pKVM loses PMU counter overflows. When a
counter overflows, the host sets the counter's bit in its copy of
PMOVSSET_EL0, and the next lazy state sync overwrites that copy with the
hyp vCPU's stale one. The guest then takes no overflow interrupt, or
takes it with the overflow bit clear. Patch 1 leaves the PMU registers
out of the sync.
I went through the other writes the host makes without first syncing
the guest's state, and they only touch the timer registers, which the
sync already skips.
Patch 2 adds a test case for counter overflow to vpmu_counter_access,
which fails in pKVM without the fix and passes with it in pKVM, nVHE,
VHE and NV. On a host with more than one PMU type, the test needs
James's fix [1].
Based on Linux 7.4-rc5 (fe6ff8d5d675c; also applies to kvmarm/fixes
012e4bc01e339).
Cheers,
/fuad
[1] https://lore.kernel.org/all/20261125-james-kvm-pin-pmu-test-v1-1-c3ce989233fb@linaro.org/
Fuad Tabba (2):
KVM: arm64: Don't copy the PMU registers between the host and hyp vCPU
KVM: arm64: selftests: Test PMU counter overflow in
vpmu_counter_access
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 12 +-
.../selftests/kvm/arm64/vpmu_counter_access.c | 214 +++++++++++++++++-
2 files changed, 224 insertions(+), 2 deletions(-)
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] KVM: arm64: Don't copy the PMU registers between the host and hyp vCPU
2026-12-04 10:49 [PATCH 0/2] KVM: arm64: Fix PMU counter overflows for non-protected guests in pKVM Fuad Tabba
@ 2026-12-04 10:49 ` Fuad Tabba
2026-12-04 10:49 ` [PATCH 2/2] KVM: arm64: selftests: Test PMU counter overflow in vpmu_counter_access Fuad Tabba
1 sibling, 0 replies; 5+ messages in thread
From: Fuad Tabba @ 2026-12-04 10:49 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton
Cc: kvmarm, linux-arm-kernel, kvm, linux-kselftest, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
Will Deacon, Mark Rutland, Vincent Donnefort, Paolo Bonzini,
Sean Christopherson, Shuah Khan, James Clark, Fuad Tabba
The host emulates the PMU of a non-protected guest in pKVM, and EL2
doesn't access the guest's PMU registers in the hyp vCPU. Lazy state
sync copies them anyway.
Since commit 8ee90ca40b10c ("KVM: arm64: Pass the PMU events to the hyp
vCPU of non-protected guests") the guest's counters count, and the perf
overflow handler sets an overflowing counter's bit in the host's copy of
PMOVSSET_EL0 before the host has synced the guest's state. The next sync
overwrites it with the hyp vCPU's stale copy, so the guest takes no
overflow interrupt, or takes it with the overflow bit clear.
Leave the PMU registers out of the copy, like we do for the timer
registers.
Fixes: 734dc8c01c838 ("KVM: arm64: Implement lazy vCPU state sync for non-protected guests")
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c
index 0c023ee0cf42a..2d0401a94246b 100644
--- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c
+++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c
@@ -627,7 +627,7 @@ static void __copy_vcpu_state(const struct kvm_vcpu *from_vcpu,
to_vcpu->arch.ctxt.fp_regs = from_vcpu->arch.ctxt.fp_regs;
/*
- * Copy the sysregs, but don't mess with the timer state which
+ * Copy the sysregs, but don't mess with the timer and PMU state which
* is directly handled by EL1 and is expected to be preserved.
* enum vcpu_sysreg is sparse: VNCR-mapped registers take values
* derived from their VNCR page offset, so the timer registers do
@@ -640,6 +640,16 @@ static void __copy_vcpu_state(const struct kvm_vcpu *from_vcpu,
case CNTV_CTL_EL0:
case CNTP_CVAL_EL0:
case CNTP_CTL_EL0:
+ case PMCR_EL0:
+ case PMSELR_EL0:
+ case PMEVCNTR0_EL0 ... PMEVCNTR30_EL0:
+ case PMCCNTR_EL0:
+ case PMEVTYPER0_EL0 ... PMEVTYPER30_EL0:
+ case PMCCFILTR_EL0:
+ case PMCNTENSET_EL0:
+ case PMINTENSET_EL1:
+ case PMOVSSET_EL0:
+ case PMUSERENR_EL0:
continue;
}
to_vcpu->arch.ctxt.sys_regs[i] = from_vcpu->arch.ctxt.sys_regs[i];
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] KVM: arm64: selftests: Test PMU counter overflow in vpmu_counter_access
2026-12-04 10:49 [PATCH 0/2] KVM: arm64: Fix PMU counter overflows for non-protected guests in pKVM Fuad Tabba
2026-12-04 10:49 ` [PATCH 1/2] KVM: arm64: Don't copy the PMU registers between the host and hyp vCPU Fuad Tabba
@ 2026-12-04 10:49 ` Fuad Tabba
2026-12-04 11:06 ` sashiko-bot
1 sibling, 1 reply; 5+ messages in thread
From: Fuad Tabba @ 2026-12-04 10:49 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton
Cc: kvmarm, linux-arm-kernel, kvm, linux-kselftest, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
Will Deacon, Mark Rutland, Vincent Donnefort, Paolo Bonzini,
Sean Christopherson, Shuah Khan, James Clark, Fuad Tabba
The vpmu_counter_access test accesses the guest's PMU registers, but
doesn't check what happens when a counter overflows.
Add a case where the guest lets its cycle counter overflow, and check
that it takes the PMU interrupt with the counter's bit set in
PMOVSSET_EL0, whether it waits without trapping or traps in a loop. Do
the same for a chained pair of event counters, where the high counter
must also go up by one. With the cycle counter's interrupt disabled,
check that the guest reads the bit as set and doesn't take the
interrupt.
Add a define for the PMU's interrupt number now that the guest uses it.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
.../selftests/kvm/arm64/vpmu_counter_access.c | 214 +++++++++++++++++-
1 file changed, 213 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c b/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
index 22223395969e0..57e2f39863767 100644
--- a/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
+++ b/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
@@ -10,14 +10,18 @@
* other counters.
* It also checks if the userspace accesses to the PMU regsisters honor the
* PMCR.N value that's set for the guest.
+ * Finally, it checks the overflow status and interrupt on a counter overflow.
* This test runs only when KVM_CAP_ARM_PMU_V3 is supported on the host.
*/
+#include <arch_timer.h>
+#include <gic.h>
#include <kvm_util.h>
#include <processor.h>
#include <test_util.h>
#include <vgic.h>
#include <perf/arm_pmuv3.h>
#include <linux/bitfield.h>
+#include <linux/psci.h>
/* The max number of the PMU event counters (excluding the cycle counter) */
#define ARMV8_PMU_MAX_GENERAL_COUNTERS (ARMV8_PMU_MAX_COUNTERS - 1)
@@ -25,6 +29,9 @@
/* The cycle counter bit position that's common among the PMU registers */
#define ARMV8_PMU_CYCLE_IDX 31
+/* The PPI that the PMU interrupt is delivered on */
+#define PMU_IRQ 23
+
struct vpmu_vm {
struct kvm_vm *vm;
struct kvm_vcpu *vcpu;
@@ -403,7 +410,7 @@ static void create_vpmu_vm(void *guest_code)
{
struct kvm_vcpu_init init;
u8 pmuver, ec;
- u64 dfr0, irq = 23;
+ u64 dfr0, irq = PMU_IRQ;
struct kvm_device_attr irq_attr = {
.group = KVM_ARM_VCPU_PMU_V3_CTRL,
.attr = KVM_ARM_VCPU_PMU_V3_IRQ,
@@ -596,6 +603,209 @@ static void run_error_test(u64 pmcr_n)
destroy_vpmu_vm();
}
+#define CYCLE_COUNTER BIT(ARMV8_PMU_CYCLE_IDX)
+#define CHAIN_LOW BIT(0)
+#define CHAIN_HIGH BIT(1)
+
+#define NR_OVERFLOWS 8
+#define CYCLES_TO_OVERFLOW 100000
+#define OVERFLOW_TIMEOUT_MS 2000
+
+enum overflow_wait {
+ /* The guest doesn't trap, so it exits on the overflow interrupt. */
+ WAIT_QUIET,
+ WAIT_TRAPPING,
+};
+
+static u64 irq_count, irq_ovs;
+
+static void guest_irq_handler(struct ex_regs *regs)
+{
+ unsigned int intid = gic_get_and_ack_irq();
+
+ if (intid == PMU_IRQ) {
+ WRITE_ONCE(irq_ovs, read_sysreg(pmovsclr_el0));
+ WRITE_ONCE(irq_count, READ_ONCE(irq_count) + 1);
+
+ write_sysreg(CYCLE_COUNTER | CHAIN_LOW | CHAIN_HIGH, pmovsclr_el0);
+ isb();
+ }
+
+ gic_set_eoi(intid);
+}
+
+static void overflow_stop(u64 counters)
+{
+ write_sysreg(counters, pmcntenclr_el0);
+ write_sysreg(counters, pmintenclr_el1);
+ write_sysreg(counters, pmovsclr_el0);
+ isb();
+}
+
+static void overflow_start(u64 counters, u64 irq_counter)
+{
+ WRITE_ONCE(irq_count, 0);
+ WRITE_ONCE(irq_ovs, 0);
+
+ write_sysreg(irq_counter, pmintenset_el1);
+ write_sysreg(counters, pmcntenset_el0);
+ isb();
+}
+
+static void wait_for_overflow(enum overflow_wait wait, u64 counter)
+{
+ u64 deadline = timer_get_cntct(VIRTUAL) + msec_to_cycles(OVERFLOW_TIMEOUT_MS);
+ struct arm_smccc_res res;
+
+ while (!READ_ONCE(irq_count) && timer_get_cntct(VIRTUAL) < deadline) {
+ if (wait == WAIT_TRAPPING)
+ do_smccc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
+ }
+
+ __GUEST_ASSERT(READ_ONCE(irq_count),
+ "No interrupt for the overflow of counter 0x%lx", counter);
+ __GUEST_ASSERT(READ_ONCE(irq_ovs) & counter,
+ "Overflow interrupt for counter 0x%lx with PMOVSCLR_EL0 = 0x%lx",
+ counter, READ_ONCE(irq_ovs));
+}
+
+static void test_cycle_counter_overflow(enum overflow_wait wait)
+{
+ int i;
+
+ for (i = 0; i < NR_OVERFLOWS; i++) {
+ overflow_stop(CYCLE_COUNTER);
+ write_sysreg(-CYCLES_TO_OVERFLOW, pmccntr_el0);
+ overflow_start(CYCLE_COUNTER, CYCLE_COUNTER);
+
+ wait_for_overflow(wait, CYCLE_COUNTER);
+ }
+
+ overflow_stop(CYCLE_COUNTER);
+}
+
+static void test_overflow_irq_disabled(void)
+{
+ u64 deadline, ovs;
+ int i;
+
+ for (i = 0; i < NR_OVERFLOWS; i++) {
+ overflow_stop(CYCLE_COUNTER);
+ write_sysreg(-CYCLES_TO_OVERFLOW, pmccntr_el0);
+ overflow_start(CYCLE_COUNTER, 0);
+
+ deadline = timer_get_cntct(VIRTUAL) + msec_to_cycles(OVERFLOW_TIMEOUT_MS);
+ do {
+ ovs = read_sysreg(pmovsclr_el0);
+ } while (!(ovs & CYCLE_COUNTER) && timer_get_cntct(VIRTUAL) < deadline);
+
+ /* The handler clears the status bit, so check for an interrupt first. */
+ __GUEST_ASSERT(!READ_ONCE(irq_count),
+ "Overflow interrupt for the cycle counter with its interrupt disabled");
+ __GUEST_ASSERT(ovs & CYCLE_COUNTER,
+ "No overflow status for the cycle counter with its interrupt disabled");
+ }
+
+ overflow_stop(CYCLE_COUNTER);
+}
+
+static void test_chained_counter_overflow(enum overflow_wait wait)
+{
+ u64 high;
+ int i;
+
+ write_pmevtypern(0, ARMV8_PMU_INCLUDE_EL2 | ARMV8_PMUV3_PERFCTR_CPU_CYCLES);
+ write_pmevtypern(1, ARMV8_PMUV3_PERFCTR_CHAIN);
+
+ for (i = 0; i < NR_OVERFLOWS; i++) {
+ overflow_stop(CHAIN_LOW | CHAIN_HIGH);
+ write_pmevcntrn(0, (u32)-CYCLES_TO_OVERFLOW);
+ write_pmevcntrn(1, 0);
+ overflow_start(CHAIN_LOW | CHAIN_HIGH, CHAIN_LOW);
+
+ wait_for_overflow(wait, CHAIN_LOW);
+
+ write_sysreg(CHAIN_LOW | CHAIN_HIGH, pmcntenclr_el0);
+ isb();
+ high = read_pmevcntrn(1);
+ __GUEST_ASSERT(high == 1,
+ "Chained counter at %lu after one overflow of the counter below it",
+ high);
+ }
+
+ overflow_stop(CHAIN_LOW | CHAIN_HIGH);
+}
+
+static void guest_overflow_code(void)
+{
+ local_irq_disable();
+ gic_init(GIC_V3, 1);
+ gic_irq_enable(PMU_IRQ);
+
+ /* The bits for implemented counters are reset to UNKNOWN. */
+ write_sysreg(~0ul, pmcntenclr_el0);
+ write_sysreg(~0ul, pmintenclr_el1);
+ write_sysreg(~0ul, pmovsclr_el0);
+
+ /* On a host with NV, the guest runs at EL2, where a counter doesn't count by default. */
+ write_sysreg(ARMV8_PMU_INCLUDE_EL2, pmccfiltr_el0);
+
+ /* Leave PMCR_EL0.LP clear, since a counter chains only if it overflows at 32 bits. */
+ write_sysreg(ARMV8_PMU_PMCR_E | ARMV8_PMU_PMCR_LC, pmcr_el0);
+ isb();
+ local_irq_enable();
+
+ test_cycle_counter_overflow(WAIT_QUIET);
+ test_cycle_counter_overflow(WAIT_TRAPPING);
+ test_overflow_irq_disabled();
+
+ if (get_pmcr_n(read_sysreg(pmcr_el0)) >= 2 &&
+ (read_sysreg(pmceid0_el0) & BIT(ARMV8_PMUV3_PERFCTR_CPU_CYCLES))) {
+ test_chained_counter_overflow(WAIT_QUIET);
+ test_chained_counter_overflow(WAIT_TRAPPING);
+ } else {
+ /* Tell the host that the chained counters weren't tested. */
+ GUEST_SYNC(0);
+ }
+
+ GUEST_DONE();
+}
+
+/*
+ * Create a guest with one vCPU, and check that it sees the overflow status for
+ * each counter overflow, and takes the PMU interrupt only if it's enabled.
+ */
+static void run_overflow_test(void)
+{
+ struct kvm_vcpu *vcpu;
+ struct ucall uc;
+
+ create_vpmu_vm(guest_overflow_code);
+ vcpu = vpmu_vm.vcpu;
+ vm_install_exception_handler(vpmu_vm.vm, VECTOR_IRQ_CURRENT, guest_irq_handler);
+ vcpu_device_attr_set(vcpu, KVM_ARM_VCPU_PMU_V3_CTRL, KVM_ARM_VCPU_PMU_V3_INIT, NULL);
+
+ do {
+ vcpu_run(vcpu);
+
+ switch (get_ucall(vcpu, &uc)) {
+ case UCALL_ABORT:
+ REPORT_GUEST_ASSERT(uc);
+ break;
+ case UCALL_SYNC:
+ pr_info("Chained counter overflow not tested: needs two event counters and CPU_CYCLES\n");
+ break;
+ case UCALL_DONE:
+ break;
+ default:
+ TEST_FAIL("Unknown ucall %lu", uc.cmd);
+ break;
+ }
+ } while (uc.cmd != UCALL_DONE);
+
+ destroy_vpmu_vm();
+}
+
/*
* Return the default number of implemented PMU event counters excluding
* the cycle counter (i.e. PMCR_EL0.N value) for the guest.
@@ -639,5 +849,7 @@ int main(void)
for (i = pmcr_n + 1; i < ARMV8_PMU_MAX_COUNTERS; i++)
run_error_test(i);
+ run_overflow_test();
+
return 0;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] KVM: arm64: selftests: Test PMU counter overflow in vpmu_counter_access
2026-12-04 10:49 ` [PATCH 2/2] KVM: arm64: selftests: Test PMU counter overflow in vpmu_counter_access Fuad Tabba
@ 2026-12-04 11:06 ` sashiko-bot
2026-12-04 11:55 ` Fuad Tabba
0 siblings, 1 reply; 5+ messages in thread
From: sashiko-bot @ 2026-12-04 11:06 UTC (permalink / raw)
To: Fuad Tabba; +Cc: kvmarm, kvm, Oliver Upton, Marc Zyngier
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] kvm/arm64: missing CPU pinning in run_overflow_test() breaks
big.LITTLE
- [Low] KVM: arm64: selftests: missing ARMV8_PMU_INCLUDE_EL2 on CHAIN
counter
--
commit edb981028c9723f221e3d9e0fdc640b53ad0edc4
Author: Fuad Tabba <fuad.tabba@linux.dev>
KVM: arm64: selftests: Test PMU counter overflow in vpmu_counter_access
This commit extends vpmu_counter_access to test PMU cycle counter and chained
event counter overflows, checking overflow status and interrupt delivery both
when the guest waits quietly and when it traps in a loop.
> diff --git a/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c b/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
> index 22223395969e0..57e2f39863767 100644
> --- a/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
> +++ b/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
[ ... ]
> @@ -596,6 +603,209 @@ static void run_error_test(u64 pmcr_n)
[ ... ]
> +static void test_chained_counter_overflow(enum overflow_wait wait)
> +{
> + u64 high;
> + int i;
> +
> + write_pmevtypern(0, ARMV8_PMU_INCLUDE_EL2 | ARMV8_PMUV3_PERFCTR_CPU_CYCLES);
> + write_pmevtypern(1, ARMV8_PMUV3_PERFCTR_CHAIN);
[Severity: Low]
Should PMEVTYPER1_EL0 also include ARMV8_PMU_INCLUDE_EL2 for the CHAIN event?
On NV-capable hosts the guest runs at EL2, where ARMv8 PMUv3 applies the
PMEVTYPER<n>_EL0 filtering bits (including NSH) to chained odd counters too.
drivers/perf/arm_pmuv3.c:armv8pmu_write_event_type() sets
ARMV8_PMUV3_PERFCTR_CHAIN | ARMV8_PMU_INCLUDE_EL2 for this reason.
This only passes today because kvm_pmu_counter_increment() skips EL filtering
on CHAIN events, so the test will fail if KVM enforces architectural filtering
or backs the counter directly in hardware.
[ ... ]
> +static void run_overflow_test(void)
> +{
> + struct kvm_vcpu *vcpu;
> + struct ucall uc;
> +
> + create_vpmu_vm(guest_overflow_code);
> + vcpu = vpmu_vm.vcpu;
> + vm_install_exception_handler(vpmu_vm.vm, VECTOR_IRQ_CURRENT, guest_irq_handler);
> + vcpu_device_attr_set(vcpu, KVM_ARM_VCPU_PMU_V3_CTRL, KVM_ARM_VCPU_PMU_V3_INIT, NULL);
[Severity: Medium]
Can run_overflow_test() fail with a timeout on heterogeneous (big.LITTLE)
arm64 hosts when the vCPU thread migrates across PMU clusters?
create_vpmu_vm() relies on kvm_arm_set_default_pmu() ->
kvm_pmu_probe_armpmu(), which binds the VM to whichever arm_pmu covers the
current CPU at vCPU init time without restricting kvm->arch.supported_cpus.
If the scheduler later migrates the spinning vCPU thread to a CPU outside that
PMU's supported_cpus mask, armpmu_filter() and armpmu_add() stop scheduling
the guest's perf event, so the counter stops advancing and wait_for_overflow()
times out.
Pinning the thread with pin_self_to_any_cpu() before create_vpmu_vm() (or
configuring KVM_ARM_VCPU_PMU_V3_SET_PMU with matching CPU affinity) keeps the
vCPU on the bound PMU's cluster.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204104911.2797512-1-fuad.tabba@linux.dev?part=2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] KVM: arm64: selftests: Test PMU counter overflow in vpmu_counter_access
2026-12-04 11:06 ` sashiko-bot
@ 2026-12-04 11:55 ` Fuad Tabba
0 siblings, 0 replies; 5+ messages in thread
From: Fuad Tabba @ 2026-12-04 11:55 UTC (permalink / raw)
To: sashiko-bot; +Cc: kvmarm, kvm, Oliver Upton, Marc Zyngier, Fuad Tabba
On Fri, 04 Dec 2026 11:06:30 +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [Medium] kvm/arm64: missing CPU pinning in run_overflow_test() breaks
> big.LITTLE
Known issue, James's patch [1] fixes it.
> - [Low] KVM: arm64: selftests: missing ARMV8_PMU_INCLUDE_EL2 on CHAIN
> counter
The count is UNPREDICTABLE without it. The fix below (tested) applies on
top of this patch. I'll include it if I respin, or feel free to fold it
in when applying (whichever is easier).
diff --git a/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c b/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
index 57e2f39863767..7d1cd4acdcb9b 100644
--- a/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
+++ b/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
@@ -715,7 +715,7 @@ static void test_chained_counter_overflow(enum overflow_wait wait)
int i;
write_pmevtypern(0, ARMV8_PMU_INCLUDE_EL2 | ARMV8_PMUV3_PERFCTR_CPU_CYCLES);
- write_pmevtypern(1, ARMV8_PMUV3_PERFCTR_CHAIN);
+ write_pmevtypern(1, ARMV8_PMU_INCLUDE_EL2 | ARMV8_PMUV3_PERFCTR_CHAIN);
for (i = 0; i < NR_OVERFLOWS; i++) {
overflow_stop(CHAIN_LOW | CHAIN_HIGH);
Cheers,
/fuad
[1] https://lore.kernel.org/all/20261125-james-kvm-pin-pmu-test-v1-1-c3ce989233fb@linaro.org/
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-12-04 11:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 10:49 [PATCH 0/2] KVM: arm64: Fix PMU counter overflows for non-protected guests in pKVM Fuad Tabba
2026-12-04 10:49 ` [PATCH 1/2] KVM: arm64: Don't copy the PMU registers between the host and hyp vCPU Fuad Tabba
2026-12-04 10:49 ` [PATCH 2/2] KVM: arm64: selftests: Test PMU counter overflow in vpmu_counter_access Fuad Tabba
2026-12-04 11:06 ` sashiko-bot
2026-12-04 11:55 ` Fuad Tabba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox