[PATCH 0/5] KVM: guest_memfd: fix unbind race and NUMA selftests

Shivank Garg posted 5 patches 1 month ago
tools/testing/selftests/kvm/guest_memfd_test.c   | 86 ++++++++++++++++--------
tools/testing/selftests/kvm/include/numaif.h     | 52 ++------------
tools/testing/selftests/kvm/x86/xapic_ipi_test.c | 14 ++--
virt/kvm/guest_memfd.c                           | 23 ++++---
4 files changed, 84 insertions(+), 91 deletions(-)
[PATCH 0/5] KVM: guest_memfd: fix unbind race and NUMA selftests
Posted by Shivank Garg 1 month ago
Split out the guest_memfd folio migration series [1], where migration part
needs more discussion. These fixes, reported by Sashiko bot [2][3], are
independent of it and can be reviewed on their own.

[1] https://lore.kernel.org/all/20260805-shivank-gmem-migrate-v3-0-00d8bdec4e1d@amd.com 
[2] https://lore.kernel.org/all/20260728092027.225CF1F000E9@smtp.kernel.org
[3] https://lore.kernel.org/all/20260728091945.EA6C31F000E9@smtp.kernel.org

Signed-off-by: Shivank Garg <shivankg@amd.com>
---
Shivank Garg (5):
      KVM: guest_memfd: take the invalidate lock when unbinding a dying file
      KVM: selftests: fix maxnode arguments in xapic_ipi_test
      KVM: selftests: use BITS_PER_TYPE() for NUMA masks
      KVM: selftests: add get_numa_mem_nodes()
      KVM: selftests: use allowed NUMA nodes in guest_memfd_test

 tools/testing/selftests/kvm/guest_memfd_test.c   | 86 ++++++++++++++++--------
 tools/testing/selftests/kvm/include/numaif.h     | 52 ++------------
 tools/testing/selftests/kvm/x86/xapic_ipi_test.c | 14 ++--
 virt/kvm/guest_memfd.c                           | 23 ++++---
 4 files changed, 84 insertions(+), 91 deletions(-)
---
base-commit: 2709dd5ae32f0828f386327c76bba9f39f63a1c6
change-id: 20260822-shivank-gmem-fix-split-b8a9057cf987

Best regards,
-- 
Shivank Garg <shivankg@amd.com>
Re: [PATCH 0/5] KVM: guest_memfd: fix unbind race and NUMA selftests
Posted by Garg, Shivank 4 weeks ago
On Sun, 2026-08-23 at 13:36 +0000, Shivank Garg wrote:
> Split out the guest_memfd folio migration series [1], where migration part
> needs more discussion. These fixes, reported by Sashiko bot [2][3], are
> independent of it and can be reviewed on their own.
> 
> [1] https://lore.kernel.org/all/20260805-shivank-gmem-migrate-v3-0-00d8bdec4e1d@amd.com 
> [2] https://lore.kernel.org/all/20260728092027.225CF1F000E9@smtp.kernel.org
> [3] https://lore.kernel.org/all/20260728091945.EA6C31F000E9@smtp.kernel.org
> 
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
> Shivank Garg (5):
>       KVM: guest_memfd: take the invalidate lock when unbinding a dying file
>       KVM: selftests: fix maxnode arguments in xapic_ipi_test
>       KVM: selftests: use BITS_PER_TYPE() for NUMA masks
>       KVM: selftests: add get_numa_mem_nodes()
>       KVM: selftests: use allowed NUMA nodes in guest_memfd_test
> 
>  tools/testing/selftests/kvm/guest_memfd_test.c   | 86 ++++++++++++++++--------
>  tools/testing/selftests/kvm/include/numaif.h     | 52 ++------------
>  tools/testing/selftests/kvm/x86/xapic_ipi_test.c | 14 ++--
>  virt/kvm/guest_memfd.c                           | 23 ++++---
>  4 files changed, 84 insertions(+), 91 deletions(-)
> ---
> base-commit: 2709dd5ae32f0828f386327c76bba9f39f63a1c6
> change-id: 20260822-shivank-gmem-fix-split-b8a9057cf987
> 
> Best regards,

Hi Sean, Paolo,

Would you consider queuing this for next (7.4)?

Thanks,
Shivank
Re: [PATCH 0/5] KVM: guest_memfd: fix unbind race and NUMA selftests
Posted by Sean Christopherson 3 weeks, 6 days ago
On Mon, Aug 31, 2026, Shivank Garg wrote:
> On Sun, 2026-08-23 at 13:36 +0000, Shivank Garg wrote:
> > Split out the guest_memfd folio migration series [1], where migration part
> > needs more discussion. These fixes, reported by Sashiko bot [2][3], are
> > independent of it and can be reviewed on their own.
> > 
> > [1] https://lore.kernel.org/all/20260805-shivank-gmem-migrate-v3-0-00d8bdec4e1d@amd.com 
> > [2] https://lore.kernel.org/all/20260728092027.225CF1F000E9@smtp.kernel.org
> > [3] https://lore.kernel.org/all/20260728091945.EA6C31F000E9@smtp.kernel.org
> > 
> > Signed-off-by: Shivank Garg <shivankg@amd.com>
> > ---
> > Shivank Garg (5):
> >       KVM: guest_memfd: take the invalidate lock when unbinding a dying file
> >       KVM: selftests: fix maxnode arguments in xapic_ipi_test
> >       KVM: selftests: use BITS_PER_TYPE() for NUMA masks
> >       KVM: selftests: add get_numa_mem_nodes()
> >       KVM: selftests: use allowed NUMA nodes in guest_memfd_test
> > 
> >  tools/testing/selftests/kvm/guest_memfd_test.c   | 86 ++++++++++++++++--------
> >  tools/testing/selftests/kvm/include/numaif.h     | 52 ++------------
> >  tools/testing/selftests/kvm/x86/xapic_ipi_test.c | 14 ++--
> >  virt/kvm/guest_memfd.c                           | 23 ++++---
> >  4 files changed, 84 insertions(+), 91 deletions(-)
> > ---
> > base-commit: 2709dd5ae32f0828f386327c76bba9f39f63a1c6
> > change-id: 20260822-shivank-gmem-fix-split-b8a9057cf987
> > 
> > Best regards,
> 
> Hi Sean, Paolo,
> 
> Would you consider queuing this for next (7.4)?

No, I'm expecting a new version based on the discussion in patch 1.

I also don't understand why the selftests changes are bundled in with what appears
to be a completely unrelated bug fix.
Re: [PATCH 0/5] KVM: guest_memfd: fix unbind race and NUMA selftests
Posted by Garg, Shivank 3 weeks, 6 days ago
On Mon, 2026-08-31 at 06:34 -0700, Sean Christopherson wrote:
> On Mon, Aug 31, 2026, Shivank Garg wrote:
> > On Sun, 2026-08-23 at 13:36 +0000, Shivank Garg wrote:
> > > Split out the guest_memfd folio migration series [1], where migration part
> > > needs more discussion. These fixes, reported by Sashiko bot [2][3], are
> > > independent of it and can be reviewed on their own.
> > > 
> > > [1] https://lore.kernel.org/all/20260805-shivank-gmem-migrate-v3-0-00d8bdec4e1d@amd.com 
> > > [2] https://lore.kernel.org/all/20260728092027.225CF1F000E9@smtp.kernel.org
> > > [3] https://lore.kernel.org/all/20260728091945.EA6C31F000E9@smtp.kernel.org
> > > 
> > > Signed-off-by: Shivank Garg <shivankg@amd.com>
> > > ---
> > > Shivank Garg (5):
> > >       KVM: guest_memfd: take the invalidate lock when unbinding a dying file
> > >       KVM: selftests: fix maxnode arguments in xapic_ipi_test
> > >       KVM: selftests: use BITS_PER_TYPE() for NUMA masks
> > >       KVM: selftests: add get_numa_mem_nodes()
> > >       KVM: selftests: use allowed NUMA nodes in guest_memfd_test
> > > 
> > >  tools/testing/selftests/kvm/guest_memfd_test.c   | 86 ++++++++++++++++--------
> > >  tools/testing/selftests/kvm/include/numaif.h     | 52 ++------------
> > >  tools/testing/selftests/kvm/x86/xapic_ipi_test.c | 14 ++--
> > >  virt/kvm/guest_memfd.c                           | 23 ++++---
> > >  4 files changed, 84 insertions(+), 91 deletions(-)
> > > ---
> > > base-commit: 2709dd5ae32f0828f386327c76bba9f39f63a1c6
> > > change-id: 20260822-shivank-gmem-fix-split-b8a9057cf987
> > > 
> > > Best regards,
> > 
> > Hi Sean, Paolo,
> > 
> > Would you consider queuing this for next (7.4)?
> 
> No, I'm expecting a new version based on the discussion in patch 1.
> 
> I also don't understand why the selftests changes are bundled in with what appears
> to be a completely unrelated bug fix.

Hi Sean,

I'll send the unbind fix as a standalone v2, and separate the selftests fixes.
I thought of bundling them as they all came out from migration series.

Thanks,
Shivank