selftests: KVM: Free the GIC FD when cleaning up in arch_timer
authorOliver Upton <oupton@google.com>
Wed, 6 Apr 2022 23:56:15 +0000 (23:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Apr 2022 12:41:07 +0000 (14:41 +0200)
commitf828c2d4f07872cbbef0b4c13ee67bb588a2da8f
treea65fb1e62b21f1742414605ae6cce6ae0dc71383
parent4fb89f384b9a385cbff15215846304b8fc505810
selftests: KVM: Free the GIC FD when cleaning up in arch_timer

[ Upstream commit 21db83846683d3987666505a3ec38f367708199a ]

In order to correctly destroy a VM, all references to the VM must be
freed. The arch_timer selftest creates a VGIC for the guest, which
itself holds a reference to the VM.

Close the GIC FD when cleaning up a VM.

Signed-off-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220406235615.1447180-4-oupton@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/kvm/aarch64/arch_timer.c