Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 386ba265 authored by Oliver Upton's avatar Oliver Upton Committed by Marc Zyngier
Browse files

selftests: KVM: Don't leak GIC FD across dirty log test iterations

dirty_log_perf_test instantiates a VGICv3 for the guest (if supported by
hardware) to reduce the overhead of guest exits. However, the test does
not actually close the GIC fd when cleaning up the VM between test
iterations, meaning that the VM is never actually destroyed in the
kernel.

While this is generally a bad idea, the bug was detected from the kernel
spewing about duplicate debugfs entries as subsequent VMs happen to
reuse the same FD even though the debugfs directory is still present.

Abstract away the notion of setup/cleanup of the GIC FD from the test
by creating arch-specific helpers for test setup/cleanup. Close the GIC
FD on VM cleanup and do nothing for the other architectures.

Fixes: c340f789

 ("KVM: selftests: Add vgic initialization for dirty log perf test for ARM")
Reviewed-by: default avatarJing Zhang <jingzhangos@google.com>
Signed-off-by: default avatarOliver Upton <oupton@google.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220406235615.1447180-3-oupton@google.com
parent a44a4cc1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment