Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: David Matlack <dmatlack@google.com>
Cc: sashiko-reviews@lists.linux.dev, kvm@vger.kernel.org,
	linux-rdma@vger.kernel.org,
	Sean Christopherson <seanjc@google.com>
Subject: Re: [PATCH v6 06/10] vfio: selftests: Allow drivers to specify required region size
Date: Fri, 18 Sep 2026 17:00:00 -0300	[thread overview]
Message-ID: <20260918200000.GB11142@nvidia.com> (raw)
In-Reply-To: <CALzav=f4NTb4Csn2BoK5kk=MckFRvbVnOdO9yiCz8MLXdRMPOg@mail.gmail.com>

On Fri, Sep 18, 2026 at 07:58:58AM -0700, David Matlack wrote:
> > >
> > > [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?
> 
> Yes, KVM started linking in the VFIO selftests library in 7.3 and
> irq_test.c is the first test using it.

Okay, so I think this is all that is needed:

@@ -101,7 +100,6 @@ static int vfio_setup_msi(struct vfio_pci_device *device)
        allocator = iova_allocator_init(device->iommu);
 
        region = &device->driver.region;
-       region->size = SZ_2M;
        region->iova = iova_allocator_alloc(allocator, region->size);
        region->vaddr = kvm_mmap(region->size, prot, flags, -1);
        TEST_ASSERT(region->vaddr != MAP_FAILED, "mmap() failed\n");

> Looks like that is also causing the dma_rmb/wmb() redefinition
> compiler warning from the kernel-test-robot.

Yeah, for some reason kvm defined them in its private headers instead
of putting them in the right place :(

I think I can just delete the kvm definitions.

I don't have an arm system or userspace cross compiler to test it with
though..

Are we good on everything else, can Alex pick it up after I fix this?

Jason

  reply	other threads:[~2026-09-18 20:00 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
2026-09-18 14:58       ` David Matlack
2026-09-18 20:00         ` Jason Gunthorpe [this message]
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=20260918200000.GB11142@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 \
    --cc=seanjc@google.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