OSDN Git Service

KVM: arm64: selftests: arch_timer: Support vCPU migration
authorRaghavendra Rao Ananta <rananta@google.com>
Thu, 7 Oct 2021 23:34:39 +0000 (23:34 +0000)
committerMarc Zyngier <maz@kernel.org>
Sun, 17 Oct 2021 10:17:22 +0000 (11:17 +0100)
commit61f6fadbf9bd6694c72e40d9fa186ceff730ef33
tree72005ee287b330ef66b56b6326693697ff602b74
parent4959d8650e9f4095a5df6e578377d850f1b94d2f
KVM: arm64: selftests: arch_timer: Support vCPU migration

Since the timer stack (hardware and KVM) is per-CPU, there
are potential chances for races to occur when the scheduler
decides to migrate a vCPU thread to a different physical CPU.
Hence, include an option to stress-test this part as well by
forcing the vCPUs to migrate across physical CPUs in the
system at a particular rate.

Originally, the bug for the fix with commit 3134cc8beb69d0d
("KVM: arm64: vgic: Resample HW pending state on deactivation")
was discovered using arch_timer test with vCPU migrations and
can be easily reproduced.

Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211007233439.1826892-16-rananta@google.com
tools/testing/selftests/kvm/aarch64/arch_timer.c