Skip to content

iommu/vt-d: Hitless PASID updates via entry_sync

Lu Baolu linux-iommu lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 27 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8iommu: Lift and generalize the STE/CD update code from SMMUv3drivers/iommu/Kconfig drivers/iommu/Makefile drivers/iommu/entry_sync.c +2 more+292 -015 replies
2/8iommu/vt-d: Add entry_sync support for PASID entry updatesdrivers/iommu/intel/Kconfig drivers/iommu/intel/pasid.c+175 -010 replies
3/8iommu/vt-d: Require CMPXCHG16B for PASID supportdrivers/iommu/intel/Kconfig drivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h+7 -22 replies
4/8iommu/vt-d: Add trace events for PASID entry sync updatesdrivers/iommu/intel/pasid.c drivers/iommu/intel/trace.h+117 -10 replies
5/8iommu/vt-d: Use intel_pasid_write() for first-stage setupdrivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h drivers/iommu/intel/pasid.c +1 more+14 -480 replies
6/8iommu/vt-d: Use intel_pasid_write() for second-stage setupdrivers/iommu/intel/iommu.c drivers/iommu/intel/pasid.c+8 -370 replies
7/8iommu/vt-d: Use intel_pasid_write() for pass-through setupdrivers/iommu/intel/iommu.c drivers/iommu/intel/pasid.c+5 -330 replies
8/8iommu/vt-d: Use intel_pasid_write() for nested setupdrivers/iommu/intel/nested.c drivers/iommu/intel/pasid.c+6 -340 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] iommu/vt-d: Hitless PASID updates via entry_sync

This is a follow-up to recent discussions on the iommu community mailing list [1] [2] regarding potential race conditions in table entry updates. After addressing atomicity in context and PASID entry updates [3], this series modernizes Intel IOMMU driver by introducing a "hitless" update mechanism.

The core of this series lifts the synchronization logic originally found in the ARM SMMUv3 driver into a generic IOMMU library (entry_sync) and plumbs it into the Intel IOMMU driver.

Traditionally, updating a PASID table entry while the hardware is performing DMA required a disruptive "clear-then-update" sequence. By analyzing "used bits" and enforcing 128-bit atomicity via CMPXCHG16B, this library allows the driver to transition between translation modes hitlessly whenever possible.

[1] https://lore.kernel.org/linux-iommu/[email protected]/
[2] https://lore.kernel.org/linux-iommu/[email protected]/
[3] https://lore.kernel.org/linux-iommu/[email protected]/

This series is also available on github:
[4] https://github.com/LuBaolu/intel-iommu/commits/pasid-entry-sync-v1

Best regards,
baolu

Jason Gunthorpe (1):
iommu: Lift and generalize the STE/CD update code from SMMUv3

Lu Baolu (7):
iommu/vt-d: Add entry_sync support for PASID entry updates iommu/vt-d: Require CMPXCHG16B for PASID support iommu/vt-d: Add trace events for PASID entry sync updates iommu/vt-d: Use intel_pasid_write() for first-stage setup iommu/vt-d: Use intel_pasid_write() for second-stage setup iommu/vt-d: Use intel_pasid_write() for pass-through setup iommu/vt-d: Use intel_pasid_write() for nested setup

 drivers/iommu/Kconfig               |  14 ++
 drivers/iommu/intel/Kconfig         |   4 +-
 drivers/iommu/Makefile              |   1 +
 drivers/iommu/entry_sync.h          |  66 +++++++
 drivers/iommu/entry_sync_template.h | 143 ++++++++++++++
 drivers/iommu/intel/iommu.h         |   8 +-
 drivers/iommu/intel/trace.h         | 107 ++++++++++
 drivers/iommu/entry_sync.c          |  68 +++++++
 drivers/iommu/intel/iommu.c         |  51 ++---
 drivers/iommu/intel/nested.c        |  13 +-
 drivers/iommu/intel/pasid.c         | 291 +++++++++++++++++++---------
 drivers/iommu/intel/svm.c           |   5 +-
 12 files changed, 620 insertions(+), 151 deletions(-)
 create mode 100644 drivers/iommu/entry_sync.h
 create mode 100644 drivers/iommu/entry_sync_template.h
 create mode 100644 drivers/iommu/entry_sync.c
Signature · 1 line
2.43.0