Re: [PATCH 3/3] iommu/vt-d: Rework hitless PASID entry replacement
From: Baolu Lu
Date: Wed Jan 14 2026 - 00:45:15 EST
On 1/14/26 03:27, Samiullah Khawaja wrote:
On Mon, Jan 12, 2026 at 7:03 PM Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx> wrote:
The Intel VT-d PASID table entry is 512 bits (64 bytes). Because theLooking at the specs, the DID is part of the first 128 bits (chunk 0),
hardware may fetch this entry in multiple 128-bit chunks, updating the
entire entry while it is active (P=1) risks a "torn" read where the
hardware observes an inconsistent state.
However, certain updates (e.g., changing page table pointers while
keeping the translation type and domain ID the same) can be performed
hitlessly. This is possible if the update is limited to a single
128-bit chunk while the other chunks remains stable.
Introduce a hitless replacement mechanism for PASID entries:
- Update 'struct pasid_entry' with a union to support 128-bit
access via the newly added val128[4] array.
- Add pasid_support_hitless_replace() to determine if a transition
between an old and new entry is safe to perform atomically.
- For First-level/Nested translations: The first 128 bits (chunk 0)
must remain identical; chunk 1 is updated atomically.
so I guess for the first level the hitless replacement would not be
supported since each domain will have a different DID?
It's not necessarily true that each domain will have a different DID. On
Intel IOMMU, all SVA domains can share a single DID. Similarly, multiple
nested domains sitting on top of the same second-stage page table can
also share a DID.
Thanks,
baolu