Skip to contentSkip to conversation

iommu/vt-d: Remove unnecessary SVA data accesses in page fault path

PATCH In review Lu Baolu 2 participants 2 messages Sep 14, 2022 – Sep 15, 2022

Subsystems (2)
lore
Share & tools
lore

Lu Baolu

author maintainer
#0 lore raw

PATCH v2 1/1 iommu/vt-d: Remove unnecessary SVA data accesses in page fault path

The existing I/O page fault handling code accesses the per-PASID SVA data structures. This is unnecessary and makes the fault handling code only suitable for SVA scenarios. This removes the SVA data accesses from the I/O page fault reporting and responding code, so that the fault handling code could be generic.

---
 drivers/iommu/intel/iommu.h |  2 +-
 drivers/iommu/intel/svm.c   | 60 +++++--------------------------------
 2 files changed, 8 insertions(+), 54 deletions(-)

Change log:
v2:
- Move prq_seq_number to per-iommu data struct.
- Add back the comments that were accidentally deleted.
- Rephrased the commit message.

v1: https://lore.kernel.org/linux-iommu/[email protected]/

drivers/iommu/intel/iommu.h +1 -1
index 08618d94fbac..352f05e92f6f 100644
@@ -584,6 +584,7 @@ struct intel_iommu {
 #ifdef CONFIG_INTEL_IOMMU_SVM
 	struct page_req_dsc *prq;
 	unsigned char prq_name[16];    /* Name for PRQ interrupt */
+	unsigned long prq_seq_number;
 	struct completion prq_complete;
 	struct ioasid_allocator_ops pasid_allocator; /* Custom allocator for PASIDs */
 #endif
@@ -757,7 +758,6 @@ struct intel_svm_dev {
 	struct device *dev;
 	struct intel_iommu *iommu;
 	struct iommu_sva sva;
-	unsigned long prq_seq_number;
 	u32 pasid;
 	int users;
 	u16 did;
drivers/iommu/intel/svm.c +7 -53

118 lines not on this page · raw message

Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines

From: Lu Baolu <[email protected]>
Sent: Wednesday, September 14, 2022 9:18 AM

The existing I/O page fault handling code accesses the per-PASID SVA data structures. This is unnecessary and makes the fault handling code only suitable for SVA scenarios. This removes the SVA data accesses from the I/O page fault reporting and responding code, so that the fault handling code could be generic.