[GIT PULL] KVM: x86: guest_memfd changes for 7.2
From: Sean Christopherson
Date: Thu Jun 11 2026 - 20:49:04 EST
Fix a few bugs found by AI (mostly by Sashiko pointing out pre-existing bugs).
The following changes since commit b7fbe9a1bf9ee6c967ef77d366ca58c35fcf1887:
Merge branch 'kvm-apx-prepare' into HEAD (2026-05-13 12:38:31 -0400)
are available in the Git repository at:
https://github.com/kvm-x86/linux.git tags/kvm-x86-gmem-7.2
for you to fetch changes up to 48dbe473219832788c3940c84faa7f1df4375d5d:
KVM: guest_memfd: fix NUMA interleave index double-counting (2026-06-08 09:15:43 -0700)
----------------------------------------------------------------
KVM guest_memfd changes for 7.2
- Return -EEXIST instead of -EINVAL if userspace attempts to bind a gmem
range to multiple memslots, and fix the test that was supposed to ensure
KVM returns -EEXIST.
- Treat memslot binding offsets and sizes as unsigned values to fix a bug
where KVM interprets a large "offset + size" as a negative value and allows
a nonsensical offset.
- Use the inode number instead of the page offset for the NUMA interleaving
index to fix a bug where the effective index would jump by two for
consecutive pages (the caller also adds in the page offset).
----------------------------------------------------------------
Michael S. Tsirkin (1):
KVM: guest_memfd: fix NUMA interleave index double-counting
Sean Christopherson (4):
KVM: selftests: Remove unnecessary "%s" formatting of a constant string
KVM: guest_memfd: Treat memslot binding offset+size as unsigned values
KVM: selftests: Expand the guest_memfd test macros to allow passing the VM
KVM: selftests: Add guest_memfd regression test signed offset+size bug
Zongyao Chen (2):
KVM: guest_memfd: Return -EEXIST for overlapping bindings
KVM: selftests: Test guest_memfd binding overlap without GPA overlap
tools/testing/selftests/kvm/guest_memfd_test.c | 24 +++++++++++++++--
.../testing/selftests/kvm/set_memory_region_test.c | 31 +++++++++++++++++++---
virt/kvm/guest_memfd.c | 16 ++++++-----
virt/kvm/kvm_mm.h | 7 +++--
4 files changed, 63 insertions(+), 15 deletions(-)