mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shivank Garg <shivankg@amd.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	David Hildenbrand <david@kernel.org>,
	Shuah Khan <shuah@kernel.org>, Jim Mattson <jmattson@google.com>,
	Peter Shier <pshier@google.com>,
	Ricardo Koller <ricarkol@google.com>,
	Ackerley Tng <ackerleytng@google.com>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	Steven Price <steven.price@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: <kvm@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Shivank Garg <shivankg@amd.com>
Subject: [PATCH RESEND v3 0/4] KVM: guest_memfd: fix NUMA selftests
Date: Fri, 20 Nov 2026 11:28:38 +0000	[thread overview]
Message-ID: <20261120-gmem-selftests-fix-v3-0-d94ffe17ead6@amd.com> (raw)

NUMA selftests in guest_memfd_test assumes that node 0 and 1 exist and
have memory. However, nodes can be sparse or memoryless which would
break this selftest.  Select the nodes from MPOL_F_MEMS_ALLOWED instead.

Based on kvm-x86/next.

Tested on bare metal and in QEMU. Without this series, the test fails
with EINVAL when node 0 or node 1 is not an allowed memory node. With it,
the test passes for any set of allowed NUMA nodes.

RESEND:
- Rebase on kvm-x86/next. No code changes.
- Link to v3: https://lore.kernel.org/r/20260907-gmem-selftests-fix-v3-0-7a4be5c1cc8a@amd.com

Changes in v3:
- Rebase on Sean's spin-off series [1] which picks up patch 1 and 2.
- Drop Patch 3 as version in [1] is better. (Sean)
- Split patch 4 of V2 into 4 patches. (Sean)
- Use MAXNODE_FOR_MASK() for maxnode value. (Sean)
- Link to v2: https://lore.kernel.org/r/20260901-gmem-selftests-fix-v2-0-5a273153354c@amd.com

Changes in V2:
- Split from unbind race fix. (Sean)
- Include <linux/bits.h> that defines BITS_PER_TYPE for self-containment. (Sashiko)
- Link to V1: https://lore.kernel.org/kvm/20260823-shivank-gmem-fix-split-v1-0-512a29fb8e86@amd.com

Signed-off-by: Shivank Garg <shivankg@amd.com>
---
Shivank Garg (4):
      KVM: selftests: Prepare guest_memfd_test for arbitrary NUMA nodes
      KVM: selftests: Use an allowed memory node in test_mbind()
      KVM: selftests: Use allowed memory nodes in test_numa_allocation()
      KVM: selftests: Drop unused sysfs NUMA helpers

 tools/testing/selftests/kvm/guest_memfd_test.c | 61 +++++++++++++++++---------
 tools/testing/selftests/kvm/include/numaif.h   | 52 ----------------------
 2 files changed, 40 insertions(+), 73 deletions(-)
---
base-commit: cbe54fc3462b3949ab27b9ae81fb9ddb509040c7
base-tree: https://github.com/kvm-x86/linux.git next
change-id: 20260901-gmem-selftests-fix-2a5e94192f79

Best regards,
--  
Shivank Garg <shivankg@amd.com>


             reply	other threads:[~2026-11-20 11:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 11:28 Shivank Garg [this message]
2026-11-20 11:28 ` [PATCH RESEND v3 1/4] KVM: selftests: Prepare guest_memfd_test for arbitrary NUMA nodes Shivank Garg
2026-11-20 11:28 ` [PATCH RESEND v3 2/4] KVM: selftests: Use an allowed memory node in test_mbind() Shivank Garg
2026-11-20 11:28 ` [PATCH RESEND v3 3/4] KVM: selftests: Use allowed memory nodes in test_numa_allocation() Shivank Garg
2026-11-20 11:28 ` [PATCH RESEND v3 4/4] KVM: selftests: Drop unused sysfs NUMA helpers Shivank Garg
2026-11-20 14:09 ` [PATCH RESEND v3 0/4] KVM: guest_memfd: fix NUMA selftests Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120-gmem-selftests-fix-v3-0-d94ffe17ead6@amd.com \
    --to=shivankg@amd.com \
    --cc=ackerleytng@google.com \
    --cc=david@kernel.org \
    --cc=fuad.tabba@linux.dev \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=pshier@google.com \
    --cc=ricarkol@google.com \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=steven.price@arm.com \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®