KVM: selftests: Fixes for guest_memfd_test and FD double-close
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 10 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | KVM: selftests: Fix MADV_COLLAPSE build failure on older toolchainstools/ | +4 | 1 reply | |
| 2/2 | KVM: selftests: Fix FD double-close in kvm_vm_release()tools/ | +8 | 9 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] KVM: selftests: Fixes for guest_memfd_test and FD double-close
Hi folks,
Two more patches, standalone KVM selftests fixes that I'd like to land before posting a pKVM selftests series, a follow-up to Will's pKVM infrastructure series [1].
The first patch fixes a build failure I ran into on Debian Bookworm (glibc 2.36): guest_memfd_test.c uses MADV_COLLAPSE unconditionally, but the constant was only exposed in glibc 2.37. The fix follows the established selftest idiom of providing a compile-time fallback to the kernel-ABI value when the libc header does not define it.
The second patch fixes an FD double-close in kvm_vm_release(). kvm_vm_free() calls kvm_vm_release() internally, so a test that calls kvm_vm_release() and then kvm_vm_free() without reopening the VM in between double-closes vmp->fd and vmp->kvm_fd. Existing in-tree callers reopen via vm_recreate_with_one_vcpu() and do not hit this today. The double-close becomes a hard test failure for the pKVM selftests I will submit, which release the VM and then inspect host-mapped memory before freeing.
Based on Linux 7.1-rc3.
Cheers,
/fuad
[1] https://lore.kernel.org/all/[email protected]/
Fuad Tabba (2):
KVM: selftests: Fix MADV_COLLAPSE build failure on older toolchains
KVM: selftests: Fix FD double-close in kvm_vm_release()
tools/testing/selftests/kvm/guest_memfd_test.c | 4 ++++ tools/testing/selftests/kvm/lib/kvm_util.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-)
Signature · 1 line
2.54.0.563.g4f69b47b94-goog