* [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.14-rc
@ 2025-02-11 0:55 Lu Baolu
2025-02-11 0:55 ` [PATCH 1/1] iommu/vt-d: Make intel_iommu_drain_pasid_prq() cover faults for RID Lu Baolu
2025-02-11 7:50 ` [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.14-rc Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Lu Baolu @ 2025-02-11 0:55 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
Hi Joerg,
The following fix has been queued for v6.14-rc:
- Add a missed check in intel_iommu_drain_pasid_prq()
It has been reviewed and tested. Can you please consider it?
Best regards,
baolu
Lu Baolu (1):
iommu/vt-d: Make intel_iommu_drain_pasid_prq() cover faults for RID
drivers/iommu/intel/prq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] iommu/vt-d: Make intel_iommu_drain_pasid_prq() cover faults for RID
2025-02-11 0:55 [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.14-rc Lu Baolu
@ 2025-02-11 0:55 ` Lu Baolu
2025-02-11 7:50 ` [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.14-rc Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Lu Baolu @ 2025-02-11 0:55 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
This driver supports page faults on PCI RID since commit <9f831c16c69e>
("iommu/vt-d: Remove the pasid present check in prq_event_thread") by
allowing the reporting of page faults with the pasid_present field cleared
to the upper layer for further handling. The fundamental assumption here
is that the detach or replace operations act as a fence for page faults.
This implies that all pending page faults associated with a specific RID
or PASID are flushed when a domain is detached or replaced from a device
RID or PASID.
However, the intel_iommu_drain_pasid_prq() helper does not correctly
handle faults for RID. This leads to faults potentially remaining pending
in the iommu hardware queue even after the domain is detached, thereby
violating the aforementioned assumption.
Fix this issue by extending intel_iommu_drain_pasid_prq() to cover faults
for RID.
Fixes: 9f831c16c69e ("iommu/vt-d: Remove the pasid present check in prq_event_thread")
Cc: stable@vger.kernel.org
Suggested-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20250121023150.815972-1-baolu.lu@linux.intel.com
---
drivers/iommu/intel/prq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/prq.c b/drivers/iommu/intel/prq.c
index c2d792db52c3..064194399b38 100644
--- a/drivers/iommu/intel/prq.c
+++ b/drivers/iommu/intel/prq.c
@@ -87,7 +87,9 @@ void intel_iommu_drain_pasid_prq(struct device *dev, u32 pasid)
struct page_req_dsc *req;
req = &iommu->prq[head / sizeof(*req)];
- if (!req->pasid_present || req->pasid != pasid) {
+ if (req->rid != sid ||
+ (req->pasid_present && pasid != req->pasid) ||
+ (!req->pasid_present && pasid != IOMMU_NO_PASID)) {
head = (head + sizeof(*req)) & PRQ_RING_MASK;
continue;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.14-rc
2025-02-11 0:55 [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.14-rc Lu Baolu
2025-02-11 0:55 ` [PATCH 1/1] iommu/vt-d: Make intel_iommu_drain_pasid_prq() cover faults for RID Lu Baolu
@ 2025-02-11 7:50 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2025-02-11 7:50 UTC (permalink / raw)
To: Lu Baolu; +Cc: iommu, linux-kernel
On Tue, Feb 11, 2025 at 08:55:11AM +0800, Lu Baolu wrote:
> Lu Baolu (1):
> iommu/vt-d: Make intel_iommu_drain_pasid_prq() cover faults for RID
Applied, thanks Baolu.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-11 7:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-11 0:55 [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.14-rc Lu Baolu
2025-02-11 0:55 ` [PATCH 1/1] iommu/vt-d: Make intel_iommu_drain_pasid_prq() cover faults for RID Lu Baolu
2025-02-11 7:50 ` [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.14-rc Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox