[PATCH] KVM: arm64: selftests: Pin vpmu_counter_access to one CPU

Leo Yan leo.yan at arm.com
Fri Dec 4 04:20:35 PST 2026


On Wed, Nov 25, 2026 at 03:36:03PM +0000, James Clark wrote:
> The vpmu_counter_access test reads the maximum PMCR_EL0.N from one VM
> and then creates new VMs for each number of counters up to that limit.
> If the test migrates between CPU types the limit may not be valid for
> the new VM which causes:
> 
>   ==== Test Assertion Failure ====
>     arm64/vpmu_counter_access.c:483: !ret
>     pid=9165 tid=9165 errno=22 - Invalid argument
>   ...
>     KVM_SET_DEVICE_ATTR failed, rc: -1 errno: 22 (Invalid argument)
> 
> For example on a Radxa Orion O6 with 20 counters on the big cores and 6
> on the little cores, this happens on most runs.
> 
> Fix it by pinning the test to the CPU that it starts on before any VMs
> are created.

It seems pinning the test thread is sufficient here. The same thread
calls vcpu_run(), so the guest also runs on that CPU.

> Signed-off-by: James Clark <james.clark at linaro.org>

Reviewed-by: Leo Yan <leo.yan at arm.com>



More information about the linux-arm-kernel mailing list