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

Sean Christopherson posted 7 patches 3 weeks, 2 days ago
.../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(-)
[PATCH 0/7] KVM: selftests: Fix maxnodes bugs and cleanup related code
Posted by Sean Christopherson 3 weeks, 2 days ago
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@amd.com

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
Re: [PATCH 0/7] KVM: selftests: Fix maxnodes bugs and cleanup related code
Posted by Sean Christopherson 4 days, 17 hours ago
On Wed, 02 Sep 2026 17:16:18 -0700, Sean Christopherson wrote:
> 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.
> 
> [...]

Applied to kvm-x86 selftests, thanks!

[1/7] KVM: selftests: Account for kernel's off-by-one bug in NUMA node syscalls
      https://github.com/kvm-x86/linux/commit/be3c6888e1ab
[2/7] KVM: selftests: Fix maxnode argument to migrate_pages() in xapic_ipi_test
      https://github.com/kvm-x86/linux/commit/8883d2410c45
[3/7] KVM: selftests: use BITS_PER_TYPE() for NUMA masks
      https://github.com/kvm-x86/linux/commit/d2dde5c387fc
[4/7] KVM: selftests: Compute node masks on-demand in xAPIC IPI test
      https://github.com/kvm-x86/linux/commit/3a2a37d2d48e
[5/7] KVM: selftests: Add common helper to get mask+number of usable memory NUMA nodes
      https://github.com/kvm-x86/linux/commit/0be096bbc9cc
[6/7] KVM: selftests: Automatically run xAPIC IPI migration test when possible
      https://github.com/kvm-x86/linux/commit/92ed4d5c78fd
[7/7] KVM: selftests: Skip xAPIC IPI migration test when forced but unsupported
      https://github.com/kvm-x86/linux/commit/d5aa06fbfec2

--
https://github.com/kvm-x86/linux/tree/next