From: David Matlack <dmatlack@google.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Aaron Lewis <aaronlewis@google.com>,
Adhemerval Zanella <adhemerval.zanella@linaro.org>,
Adithya Jayachandran <ajayachandra@nvidia.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Dan Williams <dan.j.williams@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
David Matlack <dmatlack@google.com>,
dmaengine@vger.kernel.org, Jason Gunthorpe <jgg@nvidia.com>,
Joel Granados <joel.granados@kernel.org>,
Josh Hilke <jrhilke@google.com>,
Kevin Tian <kevin.tian@intel.com>,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Sean Christopherson <seanjc@google.com>,
Shuah Khan <shuah@kernel.org>,
Vinicius Costa Gomes <vinicius.gomes@intel.com>,
Vipin Sharma <vipinsh@google.com>,
"Yury Norov [NVIDIA]" <yury.norov@gmail.com>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: [PATCH v2 26/30] vfio: selftests: Add vfio_type1v2_mode
Date: Fri, 22 Aug 2025 21:25:13 +0000 [thread overview]
Message-ID: <20250822212518.4156428-27-dmatlack@google.com> (raw)
In-Reply-To: <20250822212518.4156428-1-dmatlack@google.com>
Add a new IOMMU mode for using VFIO_TYPE1v2_IOMMU.
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: David Matlack <dmatlack@google.com>
---
tools/testing/selftests/vfio/lib/include/vfio_util.h | 3 ++-
tools/testing/selftests/vfio/lib/vfio_pci_device.c | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vfio/lib/include/vfio_util.h b/tools/testing/selftests/vfio/lib/include/vfio_util.h
index bf0b636a9c0c..981ddc9a52a9 100644
--- a/tools/testing/selftests/vfio/lib/include/vfio_util.h
+++ b/tools/testing/selftests/vfio/lib/include/vfio_util.h
@@ -59,7 +59,8 @@ struct vfio_iommu_mode {
* which should then use FIXTURE_VARIANT_ADD() to create the variant.
*/
#define FIXTURE_VARIANT_ADD_ALL_IOMMU_MODES(...) \
-FIXTURE_VARIANT_ADD_IOMMU_MODE(vfio_type1_iommu, ##__VA_ARGS__)
+FIXTURE_VARIANT_ADD_IOMMU_MODE(vfio_type1_iommu, ##__VA_ARGS__); \
+FIXTURE_VARIANT_ADD_IOMMU_MODE(vfio_type1v2_iommu, ##__VA_ARGS__)
struct vfio_pci_bar {
struct vfio_region_info info;
diff --git a/tools/testing/selftests/vfio/lib/vfio_pci_device.c b/tools/testing/selftests/vfio/lib/vfio_pci_device.c
index 5c4d008f2a25..cc1b732dd8ba 100644
--- a/tools/testing/selftests/vfio/lib/vfio_pci_device.c
+++ b/tools/testing/selftests/vfio/lib/vfio_pci_device.c
@@ -371,6 +371,11 @@ static const struct vfio_iommu_mode iommu_modes[] = {
.container_path = "/dev/vfio/vfio",
.iommu_type = VFIO_TYPE1_IOMMU,
},
+ {
+ .name = "vfio_type1v2_iommu",
+ .container_path = "/dev/vfio/vfio",
+ .iommu_type = VFIO_TYPE1v2_IOMMU,
+ },
};
const char *default_iommu_mode = "vfio_type1_iommu";
--
2.51.0.rc2.233.g662b1ed5c5-goog
next prev parent reply other threads:[~2025-08-22 21:26 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 21:24 [PATCH v2 00/30] vfio: Introduce selftests for VFIO David Matlack
2025-08-22 21:24 ` [PATCH v2 01/30] selftests: Create tools/testing/selftests/vfio David Matlack
2025-08-22 21:24 ` [PATCH v2 02/30] vfio: selftests: Add a helper library for VFIO selftests David Matlack
2025-08-22 21:24 ` [PATCH v2 03/30] vfio: selftests: Introduce vfio_pci_device_test David Matlack
2025-08-22 21:24 ` [PATCH v2 04/30] vfio: selftests: Test basic VFIO and IOMMUFD integration David Matlack
2025-08-22 21:24 ` [PATCH v2 05/30] vfio: selftests: Move vfio dma mapping test to their own file David Matlack
2025-08-22 21:24 ` [PATCH v2 06/30] vfio: selftests: Add test to reset vfio device David Matlack
2025-08-22 21:24 ` [PATCH v2 07/30] vfio: selftests: Add DMA mapping tests for 2M and 1G HugeTLB David Matlack
2025-08-22 21:24 ` [PATCH v2 08/30] vfio: selftests: Validate 2M/1G HugeTLB are mapped as 2M/1G in IOMMU David Matlack
2025-08-22 21:24 ` [PATCH v2 09/30] vfio: selftests: Keep track of DMA regions mapped into the device David Matlack
2025-08-22 21:24 ` [PATCH v2 10/30] vfio: selftests: Enable asserting MSI eventfds not firing David Matlack
2025-08-22 21:24 ` [PATCH v2 11/30] vfio: selftests: Add a helper for matching vendor+device IDs David Matlack
2025-08-22 21:24 ` [PATCH v2 12/30] vfio: selftests: Add driver framework David Matlack
2025-08-22 21:25 ` [PATCH v2 13/30] vfio: sefltests: Add vfio_pci_driver_test David Matlack
2025-08-22 21:25 ` [PATCH v2 14/30] tools headers: Add stub definition for __iomem David Matlack
2025-08-22 21:25 ` [PATCH v2 15/30] tools headers: Import asm-generic MMIO helpers David Matlack
2025-08-22 21:25 ` [PATCH v2 16/30] tools headers: Import x86 MMIO helper overrides David Matlack
2025-08-22 21:25 ` [PATCH v2 17/30] tools headers: Add symlink to linux/pci_ids.h David Matlack
2025-08-22 21:25 ` [PATCH v2 18/30] dmaengine: ioat: Move system_has_dca_enabled() to dma.h David Matlack
2025-08-22 21:25 ` [PATCH v2 19/30] vfio: selftests: Add driver for Intel CBDMA David Matlack
2025-08-22 21:25 ` [PATCH v2 20/30] tools headers: Import iosubmit_cmds512() David Matlack
2025-08-22 21:25 ` [PATCH v2 21/30] dmaengine: idxd: Allow registers.h to be included from tools/ David Matlack
2025-08-22 21:25 ` [PATCH v2 22/30] vfio: selftests: Add driver for Intel DSA David Matlack
2025-08-22 21:25 ` [PATCH v2 23/30] vfio: selftests: Move helper to get cdev path to libvfio David Matlack
2025-08-22 21:25 ` [PATCH v2 24/30] vfio: selftests: Encapsulate IOMMU mode David Matlack
2025-08-22 21:25 ` [PATCH v2 25/30] vfio: selftests: Replicate tests across all iommu_modes David Matlack
2025-08-22 21:25 ` David Matlack [this message]
2025-08-22 21:25 ` [PATCH v2 27/30] vfio: selftests: Add iommufd_compat_type1{,v2} modes David Matlack
2025-08-22 21:25 ` [PATCH v2 28/30] vfio: selftests: Add iommufd mode David Matlack
2025-08-22 21:25 ` [PATCH v2 29/30] vfio: selftests: Make iommufd the default iommu_mode David Matlack
2025-08-22 21:25 ` [PATCH v2 30/30] vfio: selftests: Add a script to help with running VFIO selftests David Matlack
2025-08-27 18:55 ` [PATCH v2 00/30] vfio: Introduce selftests for VFIO Alex Williamson
2025-08-27 20:20 ` David Matlack
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=20250822212518.4156428-27-dmatlack@google.com \
--to=dmatlack@google.com \
--cc=aaronlewis@google.com \
--cc=acme@redhat.com \
--cc=adhemerval.zanella@linaro.org \
--cc=ajayachandra@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=jgg@nvidia.com \
--cc=joel.granados@kernel.org \
--cc=jrhilke@google.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=pbonzini@redhat.com \
--cc=saeedm@nvidia.com \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=vinicius.gomes@intel.com \
--cc=vipinsh@google.com \
--cc=yury.norov@gmail.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;
as well as URLs for NNTP newsgroup(s).