[PATCH 0/7] KVM: selftests: Fix maxnodes bugs and cleanup related code

From: Sean Christopherson

Date: Wed Sep 02 2026 - 20:18:29 EST


This is a spin-off of Shivank's series[*] to fix "flaws" in KVM selftests
handling of @maxnode in various sycalls. In quote because the flaw is that
KVM selftests followed the docs, and the kernel has a longstanding, poorly
documented off-by-one bug.

Along the way, massage the xAPIC IPI test to automatically run its page
migration testcases when possible, because that's the entire reason the
test exists.

I didn't included the guest_memfd changes that were the focus of Shivank's
series, as they are bigger and more involved (I'll let Shivank tackle those).

[*] https://lore.kernel.org/all/20260901-gmem-selftests-fix-v2-0-5a273153354c@xxxxxxx

Sean Christopherson (5):
KVM: selftests: Account for kernel's off-by-one bug in NUMA node
syscalls
KVM: selftests: Compute node masks on-demand in xAPIC IPI test
KVM: selftests: Add common helper to get mask+number of usable memory
NUMA nodes
KVM: selftests: Automatically run xAPIC IPI migration test when
possible
KVM: selftests: Skip xAPIC IPI migration test when forced but
unsupported

Shivank Garg (2):
KVM: selftests: Fix maxnode argument to migrate_pages() in
xapic_ipi_test
KVM: selftests: use BITS_PER_TYPE() for NUMA masks

.../testing/selftests/kvm/guest_memfd_test.c | 2 +-
tools/testing/selftests/kvm/include/numaif.h | 43 ++++++++++
.../selftests/kvm/x86/xapic_ipi_test.c | 78 +++++++++----------
3 files changed, 83 insertions(+), 40 deletions(-)


base-commit: 76671054f9a1ff6abb976583cd8da37650acdc97
--
2.55.0.970.g62bdec98f9-goog