From: Jason Gunthorpe <jgg@nvidia.com>
To: sashiko-reviews@lists.linux.dev, David Matlack <dmatlack@google.com>
Cc: kvm@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH v6 06/10] vfio: selftests: Allow drivers to specify required region size
Date: Fri, 18 Sep 2026 08:52:17 -0300 [thread overview]
Message-ID: <20260918115217.GA11142@nvidia.com> (raw)
In-Reply-To: <20260917235245.CAAE41F00898@smtp.kernel.org>
On Thu, Sep 17, 2026 at 11:52:45PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] selftests: kvm/irq_test overwrites dynamic driver region size
> --
>
> commit 97ad8ed7fec97be65848236fd1c8afab2ff66a54
> Author: Jason Gunthorpe <jgg@ziepe.ca>
>
> vfio: selftests: Allow drivers to specify required region size
>
> This commit adds a region_size field to struct vfio_pci_driver_ops to let
> drivers declare their required DMA-mapped region size. It updates the core
> driver probe and the vfio_pci_driver_test to use this dynamically probed
> size instead of hardcoding 2MB.
>
> > diff --git a/tools/testing/selftests/vfio/vfio_pci_driver_test.c b/tools/testing/selftests/vfio/vfio_pci_driver_test.c
> > index 761bf117d624f..2bd949aafd731 100644
> > --- a/tools/testing/selftests/vfio/vfio_pci_driver_test.c
> > +++ b/tools/testing/selftests/vfio/vfio_pci_driver_test.c
> > @@ -87,7 +87,8 @@ FIXTURE_SETUP(vfio_pci_driver_test)
> > driver = &self->device->driver;
> >
> > region_setup(self->iommu, self->iova_allocator, &self->memcpy_region, SZ_1G);
> > - region_setup(self->iommu, self->iova_allocator, &driver->region, SZ_2M);
> > + region_setup(self->iommu, self->iova_allocator, &driver->region,
> > + driver->region.size);
>
> [Severity: Medium]
> Since this changes the vfio test to use the dynamic driver->region.size
> instead of SZ_2M, should tools/testing/selftests/kvm/irq_test.c be updated
> as well?
>
> It looks like vfio_setup_msi() in kvm/irq_test.c still forcefully overwrites
> the dynamically probed size back to 2MB:
>
> tools/testing/selftests/kvm/irq_test.c:vfio_setup_msi() {
> ...
> region = &device->driver.region;
> region->size = SZ_2M;
> region->iova = iova_allocator_alloc(allocator, region->size);
> ...
> }
>
> Will this cause the KVM irq_test to fail with a VFIO_ASSERT_GE during driver
> initialization via vfio_pci_driver_init() when tested with a driver that
> requires a larger region, such as the mlx5 driver mentioned in the commit
> message?
I have no idea, Dave? Did kvm start using this stuff?
Jason
next prev parent reply other threads:[~2026-09-18 11:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 23:49 [PATCH v6 00/10] mlx5 support for VFIO self test Jason Gunthorpe
2026-09-16 23:49 ` [PATCH v6 01/10] net/mlx5: Add IFC structures for CQE and WQE Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-16 23:49 ` [PATCH v6 02/10] net/mlx5: Move HW constant groups from device.h/cq.h to mlx5_ifc.h Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-16 23:49 ` [PATCH v6 03/10] net/mlx5: Extract MLX5_SET/GET macros into mlx5_ifc_macros.h Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-16 23:49 ` [PATCH v6 04/10] net/mlx5: Add ONCE and MMIO accessor variants to mlx5_ifc_macros.h Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-16 23:49 ` [PATCH v6 05/10] selftests: Add additional kernel functions to tools/include/ Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-16 23:49 ` [PATCH v6 06/10] vfio: selftests: Allow drivers to specify required region size Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-18 11:52 ` Jason Gunthorpe [this message]
2026-09-18 14:58 ` David Matlack
2026-09-18 20:00 ` Jason Gunthorpe
2026-09-21 20:48 ` David Matlack
2026-09-21 22:38 ` Jason Gunthorpe
2026-09-16 23:49 ` [PATCH v6 07/10] vfio: selftests: Add dev_dbg Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-16 23:49 ` [PATCH v6 08/10] vfio: selftests: Add mlx5 driver - HW init and command interface Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-16 23:49 ` [PATCH v6 09/10] vfio: selftests: Add mlx5 driver - data path and memcpy ops Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
2026-09-16 23:49 ` [PATCH v6 10/10] vfio: selftests: mlx5 driver - add send_msi support Jason Gunthorpe
2026-09-17 23:52 ` sashiko-bot
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=20260918115217.GA11142@nvidia.com \
--to=jgg@nvidia.com \
--cc=dmatlack@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.