Skip to contentSkip to conversation

iommu/vt-d: Remove iommu cap audit

PATCH In review Lu Baolu 2 participants 3 messages Dec 16, 2024 – Jan 2, 2025

Subsystems (2)
lore
Share & tools
lore

Lu Baolu

author maintainer
#0 lore raw

PATCH 1/1 iommu/vt-d: Remove iommu cap audit

The capability audit code was introduced by commit <ad3d19029979> "iommu/vt-d: Audit IOMMU Capabilities and add helper functions", aiming to verify the consistency of capabilities across all IOMMUs for supported features.

Nowadays, all the kAPIs of the iommu subsystem have evolved to be device oriented, in preparation for supporting heterogeneous IOMMU architectures. There is no longer a need to require capability consistence among IOMMUs for any feature.

Remove the iommu cap audit code to make the driver align with the design in the iommu core.

---
 drivers/iommu/intel/Makefile        |   2 +-
 drivers/iommu/intel/cap_audit.c     | 217 ----------------------------
 drivers/iommu/intel/cap_audit.h     | 131 -----------------
 drivers/iommu/intel/iommu.c         |   9 --
 drivers/iommu/intel/irq_remapping.c |   8 -
 5 files changed, 1 insertion(+), 366 deletions(-)
 delete mode 100644 drivers/iommu/intel/cap_audit.c
 delete mode 100644 drivers/iommu/intel/cap_audit.h
drivers/iommu/intel/Makefile +1 -1
index d3bb0798092d..6c7528130cf9 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DMAR_TABLE) += dmar.o
 obj-$(CONFIG_INTEL_IOMMU) += iommu.o pasid.o nested.o cache.o prq.o
-obj-$(CONFIG_DMAR_TABLE) += trace.o cap_audit.o
+obj-$(CONFIG_DMAR_TABLE) += trace.o
 obj-$(CONFIG_DMAR_PERF) += perf.o
 obj-$(CONFIG_INTEL_IOMMU_DEBUGFS) += debugfs.o
 obj-$(CONFIG_INTEL_IOMMU_SVM) += svm.o
drivers/iommu/intel/cap_audit.c deleted +0 -217

217 lines not on this page · raw message

drivers/iommu/intel/cap_audit.h deleted +0 -131

131 lines not on this page · raw message

drivers/iommu/intel/iommu.c +0 -9
index 79e0da9eb626..479f8dd74c9d 100644
@@ -29,7 +29,6 @@
 #include "../irq_remapping.h"
 #include "../iommu-pages.h"
 #include "pasid.h"
-#include "cap_audit.h"
 #include "perfmon.h"
 
 #define ROOT_SIZE		VTD_PAGE_SIZE
@@ -2118,10 +2117,6 @@ static int __init init_dmars(void)
 	struct intel_iommu *iommu;
 	int ret;
 
-	ret = intel_cap_audit(CAP_AUDIT_STATIC_DMAR, NULL);
-	if (ret)
-		goto free_iommu;
-
 	for_each_iommu(iommu, drhd) {
 		if (drhd->ignored) {
 			iommu_disable_translation(iommu);
@@ -2617,10 +2612,6 @@ static int intel_iommu_add(struct dmar_drhd_unit *dmaru)
 	struct intel_iommu *iommu = dmaru->iommu;
 	int ret;
 
-	ret = intel_cap_audit(CAP_AUDIT_HOTPLUG_DMAR, iommu);
-	if (ret)
-		goto out;
-
 	/*
 	 * Disable translation if already enabled prior to OS handover.
 	 */
drivers/iommu/intel/irq_remapping.c +0 -8
index 466c1412dd45..4431543bcfe3 100644
@@ -24,7 +24,6 @@
 #include "iommu.h"
 #include "../irq_remapping.h"
 #include "../iommu-pages.h"
-#include "cap_audit.h"
 
 enum irq_mode {
 	IRQ_REMAPPING,
@@ -727,9 +726,6 @@ static int __init intel_prepare_irq_remapping(void)
 	if (dmar_table_init() < 0)
 		return -ENODEV;
 
-	if (intel_cap_audit(CAP_AUDIT_STATIC_IRQR, NULL))
-		return -ENODEV;
-
 	if (!dmar_ir_support())
 		return -ENODEV;
 
@@ -1534,10 +1530,6 @@ static int dmar_ir_add(struct dmar_drhd_unit *dmaru, struct intel_iommu *iommu)
 	int ret;
 	int eim = x2apic_enabled();
 
-	ret = intel_cap_audit(CAP_AUDIT_HOTPLUG_IRQR, iommu);
-	if (ret)
-		return ret;
-
 	if (eim && !ecap_eim_support(iommu->ecap)) {
 		pr_info("DRHD %Lx: EIM not supported by DRHD, ecap %Lx\n",
 			iommu->reg_phys, iommu->ecap);
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines

From: Lu Baolu <[email protected]>
Sent: Monday, December 16, 2024 3:18 PM

The capability audit code was introduced by commit <ad3d19029979> "iommu/vt-d: Audit IOMMU Capabilities and add helper functions", aiming to verify the consistency of capabilities across all IOMMUs for supported features.

Nowadays, all the kAPIs of the iommu subsystem have evolved to be device oriented, in preparation for supporting heterogeneous IOMMU architectures. There is no longer a need to require capability consistence among IOMMUs for any feature.

Quoted 4 lines

Remove the iommu cap audit code to make the driver align with the design in the iommu core.

author maintainer
#2 lore raw
In reply to Lu Baolu
Quoted 21 lines · Lu Baolu

The capability audit code was introduced by commit <ad3d19029979> "iommu/vt-d: Audit IOMMU Capabilities and add helper functions", aiming to verify the consistency of capabilities across all IOMMUs for supported features.

Nowadays, all the kAPIs of the iommu subsystem have evolved to be device oriented, in preparation for supporting heterogeneous IOMMU architectures. There is no longer a need to require capability consistence among IOMMUs for any feature.

Remove the iommu cap audit code to make the driver align with the design in the iommu core.

---
  drivers/iommu/intel/Makefile        |   2 +-
  drivers/iommu/intel/cap_audit.c     | 217 ----------------------------
  drivers/iommu/intel/cap_audit.h     | 131 -----------------
  drivers/iommu/intel/iommu.c         |   9 --
  drivers/iommu/intel/irq_remapping.c |   8 -
  5 files changed, 1 insertion(+), 366 deletions(-)
Quoted 2 lines

delete mode 100644 drivers/iommu/intel/cap_audit.c delete mode 100644 drivers/iommu/intel/cap_audit.h

Queued for v6.14.