patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/10] Convert Intel VT-d to use the generic iommu page table
@ 2025-10-23 18:22 Jason Gunthorpe
  2025-10-23 18:22 ` [PATCH v3 01/10] iommu/pages: Add support for incoherent IOMMU page table walkers Jason Gunthorpe
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Jason Gunthorpe @ 2025-10-23 18:22 UTC (permalink / raw)
  To: David Woodhouse, iommu, Joerg Roedel, Robin Murphy, Will Deacon
  Cc: Lu Baolu, Kevin Tian, patches, Tina Zhang, Wei Wang

Replace the VT-d iommu_domain implementation of the VT-d second stage and
first stage page tables with the iommupt VTDSS and x86_64
pagetables. x86_64 is shared with the AMD driver.

VT-d has HW that requires an incoherent page table walker, the majority of
the patches are adding generic support for the required cache flushing to
iommupt. This is modeled after the existing ARM64 version and is intended
to be re-used there.

Applies on top of the AMD conversion:
  https://patch.msgid.link/r/0-v2-5c26bde5c22d+58b-iommu_pt_jgg@nvidia.com

This is on github: https://github.com/jgunthorpe/linux/commits/iommu_pt_vtd

v3:
 - Rebase on v6.18-rc2 and latest iommu_pt series along with renames from there
 - Text and kdoc updates
 - Drop a missed IS_ENABLED(CONFIG_X86)
 - Add iommu_pages_free_incoherent() and fix an error flow in pt_iommu_new_table()
   where of incoherent memory was happening
 - Rename ALLOC_KEEP_INCOHERENT -> ALLOC_DEFER_COHERENT_FLUSH
v2: https://patch.msgid.link/r/0-v2-44d4d9e727e7+18ad8-iommu_pt_vtd_jgg@nvidia.com
 - s/!IS_ENABLED(CONFIG_X86)/IOMMU_PAGES_USE_DMA_API/
 - Update comments
 - Update ignored bits for VTDSS
 - Fix PT_FEAT_VTDSS_FORCE_WRITEABLE
 - New patch to reflow how PT_FEAT_DMA_INCOHERENT reaches the PASID entry
v1: https://patch.msgid.link/r/0-v1-bdb01ffac49c+be-iommu_pt_vtd_jgg@nvidia.com

Cc: Wei Wang <wei.w.wang@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Jason Gunthorpe (10):
  iommu/pages: Add support for incoherent IOMMU page table walkers
  iommupt: Add basic support for SW bits in the page table
  iommupt: Use the incoherent start/stop functions for
    PT_FEAT_DMA_INCOHERENT
  iommupt: Flush the CPU cache after any writes to the page table
  iommupt: Add the Intel VT-d second stage page table format
  iommupt/x86: Set the dirty bit only for writable PTEs
  iommupt/x86: Support SW bits and permit PT_FEAT_DMA_INCOHERENT
  iommu/vt-d: Use the generic iommu page table
  iommu/vt-d: Follow PT_FEAT_DMA_INCOHERENT into the PASID entry
  iommupt: Add a kunit test for the SW bits

 drivers/iommu/generic_pt/.kunitconfig       |   1 +
 drivers/iommu/generic_pt/Kconfig            |  11 +
 drivers/iommu/generic_pt/fmt/Makefile       |   2 +
 drivers/iommu/generic_pt/fmt/defs_vtdss.h   |  21 +
 drivers/iommu/generic_pt/fmt/iommu_vtdss.c  |  10 +
 drivers/iommu/generic_pt/fmt/iommu_x86_64.c |   2 +-
 drivers/iommu/generic_pt/fmt/vtdss.h        | 292 +++++++
 drivers/iommu/generic_pt/fmt/x86_64.h       |  31 +-
 drivers/iommu/generic_pt/iommu_pt.h         | 154 +++-
 drivers/iommu/generic_pt/kunit_generic_pt.h | 110 +++
 drivers/iommu/generic_pt/kunit_iommu.h      |   1 +
 drivers/iommu/generic_pt/pt_common.h        |  29 +
 drivers/iommu/generic_pt/pt_defs.h          |   5 +-
 drivers/iommu/generic_pt/pt_fmt_defaults.h  |  62 ++
 drivers/iommu/intel/Kconfig                 |   4 +
 drivers/iommu/intel/iommu.c                 | 905 ++++----------------
 drivers/iommu/intel/iommu.h                 |  97 +--
 drivers/iommu/intel/nested.c                |   5 -
 drivers/iommu/intel/pasid.c                 |  44 +-
 drivers/iommu/intel/pasid.h                 |   1 +
 drivers/iommu/intel/svm.c                   |   1 +
 drivers/iommu/iommu-pages.c                 | 134 +++
 drivers/iommu/iommu-pages.h                 |  51 +-
 include/linux/generic_pt/common.h           |  24 +
 include/linux/generic_pt/iommu.h            |  18 +
 25 files changed, 1116 insertions(+), 899 deletions(-)
 create mode 100644 drivers/iommu/generic_pt/fmt/defs_vtdss.h
 create mode 100644 drivers/iommu/generic_pt/fmt/iommu_vtdss.c
 create mode 100644 drivers/iommu/generic_pt/fmt/vtdss.h


base-commit: 214059b054b42e854854c4555e4d7c9b95e7f2ca
-- 
2.43.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-11-08  0:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23 18:22 [PATCH v3 00/10] Convert Intel VT-d to use the generic iommu page table Jason Gunthorpe
2025-10-23 18:22 ` [PATCH v3 01/10] iommu/pages: Add support for incoherent IOMMU page table walkers Jason Gunthorpe
2025-10-23 18:22 ` [PATCH v3 02/10] iommupt: Add basic support for SW bits in the page table Jason Gunthorpe
2025-10-28  1:18   ` Tian, Kevin
2025-10-23 18:22 ` [PATCH v3 03/10] iommupt: Use the incoherent start/stop functions for PT_FEAT_DMA_INCOHERENT Jason Gunthorpe
2025-10-23 18:22 ` [PATCH v3 04/10] iommupt: Flush the CPU cache after any writes to the page table Jason Gunthorpe
2025-10-23 18:22 ` [PATCH v3 05/10] iommupt: Add the Intel VT-d second stage page table format Jason Gunthorpe
2025-10-23 18:22 ` [PATCH v3 06/10] iommupt/x86: Set the dirty bit only for writable PTEs Jason Gunthorpe
2025-10-23 18:22 ` [PATCH v3 07/10] iommupt/x86: Support SW bits and permit PT_FEAT_DMA_INCOHERENT Jason Gunthorpe
2025-10-23 18:22 ` [PATCH v3 08/10] iommu/vt-d: Use the generic iommu page table Jason Gunthorpe
2025-10-23 18:22 ` [PATCH v3 09/10] iommu/vt-d: Follow PT_FEAT_DMA_INCOHERENT into the PASID entry Jason Gunthorpe
2025-10-28  1:20   ` Tian, Kevin
2025-10-23 18:22 ` [PATCH v3 10/10] iommupt: Add a kunit test for the SW bits Jason Gunthorpe
2025-11-08  0:28 ` [PATCH v3 00/10] Convert Intel VT-d to use the generic iommu page table David Matlack
2025-11-08  0:48   ` Jason Gunthorpe

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).