public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] iommu/vt-d: Ensure atomicity in context and PASID entry updates
@ 2026-01-13  3:00 Lu Baolu
  2026-01-13  3:00 ` [PATCH 1/3] iommu/vt-d: Use 128-bit atomic updates for context entries Lu Baolu
                   ` (2 more replies)
  0 siblings, 3 replies; 39+ messages in thread
From: Lu Baolu @ 2026-01-13  3:00 UTC (permalink / raw)
  To: Joerg Roedel, Will Deacon, Robin Murphy, Kevin Tian,
	Jason Gunthorpe
  Cc: Dmytro Maluka, Samiullah Khawaja, iommu, linux-kernel, Lu Baolu

This is a follow-up from recent discussions in the iommu community
mailing list [1] [2] regarding potential race conditions in table 
entry updates.

The Intel VT-d hardware fetches translation table entries (context
entries and PASID entries) in 128-bit (16-byte) chunks. Currently, the
Linux driver often updates these entries using multiple 64-bit writes.
This creates a race condition where the IOMMU hardware may fetch a
"torn" entry — a mixture of old and new data — during a CPU update. This
can lead to unpredictable hardware behavior, spurious faults, or system
instability.

This addresses these atomicity issues by implementing 128-bit atomic
updates where possible and following the VT-d specification's ownership
handshake protocol for larger structures.

[1] https://lore.kernel.org/linux-iommu/20251227175728.4358-1-dmaluka@chromium.org/
[2] https://lore.kernel.org/linux-iommu/20260107201800.2486137-1-skhawaja@google.com/

Lu Baolu (3):
  iommu/vt-d: Use 128-bit atomic updates for context entries
  iommu/vt-d: Clear Present bit before tearing down PASID entry
  iommu/vt-d: Rework hitless PASID entry replacement

 drivers/iommu/intel/Kconfig |  2 +-
 drivers/iommu/intel/iommu.h | 22 ++++++++--
 drivers/iommu/intel/pasid.h | 38 ++++++++++++++++-
 drivers/iommu/intel/iommu.c | 30 ++++++-------
 drivers/iommu/intel/pasid.c | 84 ++++++++++++++++++++++++++++++-------
 5 files changed, 140 insertions(+), 36 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-01-20 13:49 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13  3:00 [PATCH 0/3] iommu/vt-d: Ensure atomicity in context and PASID entry updates Lu Baolu
2026-01-13  3:00 ` [PATCH 1/3] iommu/vt-d: Use 128-bit atomic updates for context entries Lu Baolu
2026-01-13 19:27   ` Dmytro Maluka
2026-01-14  5:14     ` Baolu Lu
2026-01-14 10:55       ` Dmytro Maluka
2026-01-15  2:26         ` Baolu Lu
2026-01-15 13:12           ` Jason Gunthorpe
2026-01-14  7:54   ` Tian, Kevin
2026-01-15  3:26     ` Baolu Lu
2026-01-15  5:59       ` Tian, Kevin
2026-01-15 13:23         ` Jason Gunthorpe
2026-01-16  5:19           ` Tian, Kevin
2026-01-16 14:33             ` Jason Gunthorpe
2026-01-13  3:00 ` [PATCH 2/3] iommu/vt-d: Clear Present bit before tearing down PASID entry Lu Baolu
2026-01-13 19:34   ` Dmytro Maluka
2026-01-14  5:38     ` Baolu Lu
2026-01-14 11:12       ` Dmytro Maluka
2026-01-15  2:45         ` Baolu Lu
2026-01-15 21:35           ` Dmytro Maluka
2026-01-16  6:06             ` Baolu Lu
2026-01-20 13:49               ` Dmytro Maluka
2026-01-14  7:32   ` Tian, Kevin
2026-01-14  8:27     ` Baolu Lu
2026-01-15  5:49       ` Tian, Kevin
2026-01-13  3:00 ` [PATCH 3/3] iommu/vt-d: Rework hitless PASID entry replacement Lu Baolu
2026-01-13 15:05   ` Jason Gunthorpe
2026-01-14  6:03     ` Baolu Lu
2026-01-13 19:27   ` Samiullah Khawaja
2026-01-13 20:56     ` Jason Gunthorpe
2026-01-14  5:45     ` Baolu Lu
2026-01-14  7:26       ` Tian, Kevin
2026-01-14 13:17         ` Jason Gunthorpe
2026-01-14 18:51           ` Samiullah Khawaja
2026-01-14 19:07             ` Jason Gunthorpe
2026-01-15  5:44           ` Tian, Kevin
2026-01-15 13:28             ` Jason Gunthorpe
2026-01-16  6:16               ` Tian, Kevin
2026-01-13 19:39   ` Dmytro Maluka
2026-01-13 20:06     ` Dmytro Maluka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox