public inbox for linux-kselftest@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: David Matlack <dmatlack@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH] vfio: selftests: Drop IOMMU mapping size assertions for VFIO_TYPE1_IOMMU
Date: Mon, 19 Jan 2026 13:37:48 -0700	[thread overview]
Message-ID: <20260119133748.2eaf7996@shazbot.org> (raw)
In-Reply-To: <20260114211252.2581145-1-dmatlack@google.com>

On Wed, 14 Jan 2026 21:12:52 +0000
David Matlack <dmatlack@google.com> wrote:

> Drop the assertions about IOMMU mappings sizes for VFIO_TYPE1_IOMMU
> modes (both the VFIO mode and the iommufd compatibility mode). These
> assertions fail when CONFIG_IOMMUFD_VFIO_CONTAINER is enabled, since
> iommufd compatibility mode provides different huge page behavior than
> VFIO for VFIO_TYPE1_IOMMU. VFIO_TYPE1_IOMMU is an old enough interface
> that it's not worth changing the behavior of VFIO and iommufd to match
> nor care about the IOMMU mapping sizes.
> 
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Link: https://lore.kernel.org/kvm/20260109143830.176dc279@shazbot.org/
> Signed-off-by: David Matlack <dmatlack@google.com>
> ---
>  tools/testing/selftests/vfio/vfio_dma_mapping_test.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Applied to vfio next branch for v6.20/7.0.  Thanks,

Alex

> diff --git a/tools/testing/selftests/vfio/vfio_dma_mapping_test.c b/tools/testing/selftests/vfio/vfio_dma_mapping_test.c
> index 5397822c3dd4..ecadd0e6b61b 100644
> --- a/tools/testing/selftests/vfio/vfio_dma_mapping_test.c
> +++ b/tools/testing/selftests/vfio/vfio_dma_mapping_test.c
> @@ -162,12 +162,8 @@ TEST_F(vfio_dma_mapping_test, dma_map_unmap)
>  	if (rc == -EOPNOTSUPP)
>  		goto unmap;
>  
> -	/*
> -	 * IOMMUFD compatibility-mode does not support huge mappings when
> -	 * using VFIO_TYPE1_IOMMU.
> -	 */
> -	if (!strcmp(variant->iommu_mode, "iommufd_compat_type1"))
> -		mapping_size = SZ_4K;
> +	if (self->iommu->mode->iommu_type == VFIO_TYPE1_IOMMU)
> +		goto unmap;
>  
>  	ASSERT_EQ(0, rc);
>  	printf("Found IOMMU mappings for IOVA 0x%lx:\n", region.iova);
> 
> base-commit: d721f52e31553a848e0e9947ca15a49c5674aef3


      reply	other threads:[~2026-01-19 20:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 21:12 [PATCH] vfio: selftests: Drop IOMMU mapping size assertions for VFIO_TYPE1_IOMMU David Matlack
2026-01-19 20:37 ` Alex Williamson [this message]

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=20260119133748.2eaf7996@shazbot.org \
    --to=alex@shazbot.org \
    --cc=dmatlack@google.com \
    --cc=jgg@ziepe.ca \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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