Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH 0/1] iommu/vt-d: Fixes for v5.18-rc4
@ 2022-04-23  8:23 Lu Baolu
  2022-04-23  8:23 ` [PATCH 1/1] iommu/vt-d: Drop stop marker messages Lu Baolu
  2022-04-28  9:02 ` [PATCH 0/1] iommu/vt-d: Fixes for v5.18-rc4 Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Lu Baolu @ 2022-04-23  8:23 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: Kevin Tian, iommu

Hi Joerg,

One fix is queued for v5.18. It aims to fix:

 - Handle PCI stop marker messages in IOMMU driver to meet the
   requirement of I/O page fault handling framework.

Please consider it for the iommu/fix branch.

Best regards,
Lu Baolu

Lu Baolu (1):
  iommu/vt-d: Drop stop marker messages

 drivers/iommu/intel/svm.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.25.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* [PATCH 1/1] iommu/vt-d: Drop stop marker messages
  2022-04-23  8:23 [PATCH 0/1] iommu/vt-d: Fixes for v5.18-rc4 Lu Baolu
@ 2022-04-23  8:23 ` Lu Baolu
  2022-04-28  9:02 ` [PATCH 0/1] iommu/vt-d: Fixes for v5.18-rc4 Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Lu Baolu @ 2022-04-23  8:23 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: Kevin Tian, iommu

The page fault handling framework in the IOMMU core explicitly states
that it doesn't handle PCI PASID Stop Marker and the IOMMU drivers must
discard them before reporting faults. This handles Stop Marker messages
in prq_event_thread() before reporting events to the core.

The VT-d driver explicitly drains the pending page requests when a CPU
page table (represented by a mm struct) is unbound from a PASID according
to the procedures defined in the VT-d spec. The Stop Marker messages do
not need a response. Hence, it is safe to drop the Stop Marker messages
silently if any of them is found in the page request queue.

Fixes: d5b9e4bfe0d88 ("iommu/vt-d: Report prq to io-pgfault framework")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20220421113558.3504874-1-baolu.lu@linux.intel.com
---
 drivers/iommu/intel/svm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
index 23a38763c1d1..7ee37d996e15 100644
--- a/drivers/iommu/intel/svm.c
+++ b/drivers/iommu/intel/svm.c
@@ -757,6 +757,10 @@ static irqreturn_t prq_event_thread(int irq, void *d)
 			goto bad_req;
 		}
 
+		/* Drop Stop Marker message. No need for a response. */
+		if (unlikely(req->lpig && !req->rd_req && !req->wr_req))
+			goto prq_advance;
+
 		if (!svm || svm->pasid != req->pasid) {
 			/*
 			 * It can't go away, because the driver is not permitted
-- 
2.25.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 0/1] iommu/vt-d: Fixes for v5.18-rc4
  2022-04-23  8:23 [PATCH 0/1] iommu/vt-d: Fixes for v5.18-rc4 Lu Baolu
  2022-04-23  8:23 ` [PATCH 1/1] iommu/vt-d: Drop stop marker messages Lu Baolu
@ 2022-04-28  9:02 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2022-04-28  9:02 UTC (permalink / raw)
  To: Lu Baolu; +Cc: Kevin Tian, iommu

On Sat, Apr 23, 2022 at 04:23:29PM +0800, Lu Baolu wrote:
> Hi Joerg,
> 
> One fix is queued for v5.18. It aims to fix:
> 
>  - Handle PCI stop marker messages in IOMMU driver to meet the
>    requirement of I/O page fault handling framework.
> 
> Please consider it for the iommu/fix branch.
> 
> Best regards,
> Lu Baolu
> 
> Lu Baolu (1):
>   iommu/vt-d: Drop stop marker messages
> 
>  drivers/iommu/intel/svm.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied to iommu/fixes, thanks.

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2022-04-28  9:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-23  8:23 [PATCH 0/1] iommu/vt-d: Fixes for v5.18-rc4 Lu Baolu
2022-04-23  8:23 ` [PATCH 1/1] iommu/vt-d: Drop stop marker messages Lu Baolu
2022-04-28  9:02 ` [PATCH 0/1] iommu/vt-d: Fixes for v5.18-rc4 Joerg Roedel

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