All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private
@ 2022-05-14  1:43 ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

Hi folks,

The include/linux/intel-iommu.h should be private to the Intel IOMMU
driver. Other drivers or components should interact with the IOMMU
drivers through the kAPIs provided by the iommu core.

This series cleanups all includes of intel-iommu.h outside of the Intel
IOMMU driver and move this header from include/linux to
drivers/iommu/intel/.

No functional changes intended. Please help to review and suggest.

Best regards,
baolu

Lu Baolu (7):
  iommu/vt-d: Move trace/events/intel_iommu.h under iommu
  agp/intel: Use per device iommu check
  iommu/vt-d: Remove unnecessary exported symbol
  drm/i915: Remove unnecessary include
  KVM: x86: Remove unnecessary include
  x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
  iommu/vt-d: Move include/linux/intel_iommu.h under iommu

 include/linux/tboot.h                         |  2 --
 drivers/gpu/drm/i915/i915_drv.h               |  1 -
 .../iommu/intel/iommu.h                       |  1 -
 .../iommu/intel/trace.h                       |  7 +++++-
 arch/x86/kernel/tboot.c                       | 15 -------------
 arch/x86/kvm/x86.c                            |  1 -
 drivers/char/agp/intel-gtt.c                  | 17 ++++++--------
 drivers/gpu/drm/i915/display/intel_display.c  |  1 -
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |  1 -
 drivers/iommu/intel/cap_audit.c               |  2 +-
 drivers/iommu/intel/debugfs.c                 |  2 +-
 drivers/iommu/intel/dmar.c                    |  4 ++--
 drivers/iommu/intel/iommu.c                   | 22 +++++++++++++------
 drivers/iommu/intel/irq_remapping.c           |  2 +-
 drivers/iommu/intel/pasid.c                   |  2 +-
 drivers/iommu/intel/perf.c                    |  2 +-
 drivers/iommu/intel/svm.c                     |  4 ++--
 drivers/iommu/intel/trace.c                   |  2 +-
 MAINTAINERS                                   |  1 -
 19 files changed, 38 insertions(+), 51 deletions(-)
 rename include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h (99%)
 rename include/trace/events/intel_iommu.h => drivers/iommu/intel/trace.h (93%)

-- 
2.25.1

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

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

* [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private
@ 2022-05-14  1:43 ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

Hi folks,

The include/linux/intel-iommu.h should be private to the Intel IOMMU
driver. Other drivers or components should interact with the IOMMU
drivers through the kAPIs provided by the iommu core.

This series cleanups all includes of intel-iommu.h outside of the Intel
IOMMU driver and move this header from include/linux to
drivers/iommu/intel/.

No functional changes intended. Please help to review and suggest.

Best regards,
baolu

Lu Baolu (7):
  iommu/vt-d: Move trace/events/intel_iommu.h under iommu
  agp/intel: Use per device iommu check
  iommu/vt-d: Remove unnecessary exported symbol
  drm/i915: Remove unnecessary include
  KVM: x86: Remove unnecessary include
  x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
  iommu/vt-d: Move include/linux/intel_iommu.h under iommu

 include/linux/tboot.h                         |  2 --
 drivers/gpu/drm/i915/i915_drv.h               |  1 -
 .../iommu/intel/iommu.h                       |  1 -
 .../iommu/intel/trace.h                       |  7 +++++-
 arch/x86/kernel/tboot.c                       | 15 -------------
 arch/x86/kvm/x86.c                            |  1 -
 drivers/char/agp/intel-gtt.c                  | 17 ++++++--------
 drivers/gpu/drm/i915/display/intel_display.c  |  1 -
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |  1 -
 drivers/iommu/intel/cap_audit.c               |  2 +-
 drivers/iommu/intel/debugfs.c                 |  2 +-
 drivers/iommu/intel/dmar.c                    |  4 ++--
 drivers/iommu/intel/iommu.c                   | 22 +++++++++++++------
 drivers/iommu/intel/irq_remapping.c           |  2 +-
 drivers/iommu/intel/pasid.c                   |  2 +-
 drivers/iommu/intel/perf.c                    |  2 +-
 drivers/iommu/intel/svm.c                     |  4 ++--
 drivers/iommu/intel/trace.c                   |  2 +-
 MAINTAINERS                                   |  1 -
 19 files changed, 38 insertions(+), 51 deletions(-)
 rename include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h (99%)
 rename include/trace/events/intel_iommu.h => drivers/iommu/intel/trace.h (93%)

-- 
2.25.1


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

* [PATCH 1/7] iommu/vt-d: Move trace/events/intel_iommu.h under iommu
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-14  1:43   ` Lu Baolu
  -1 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

This header file is private to the Intel IOMMU driver. Move it to the
driver folder.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 .../trace/events/intel_iommu.h => drivers/iommu/intel/trace.h | 4 ++++
 drivers/iommu/intel/dmar.c                                    | 2 +-
 drivers/iommu/intel/svm.c                                     | 2 +-
 drivers/iommu/intel/trace.c                                   | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)
 rename include/trace/events/intel_iommu.h => drivers/iommu/intel/trace.h (94%)

diff --git a/include/trace/events/intel_iommu.h b/drivers/iommu/intel/trace.h
similarity index 94%
rename from include/trace/events/intel_iommu.h
rename to drivers/iommu/intel/trace.h
index e5c1ca6d16ee..25cb7f88e1a2 100644
--- a/include/trace/events/intel_iommu.h
+++ b/drivers/iommu/intel/trace.h
@@ -91,4 +91,8 @@ TRACE_EVENT(prq_report,
 #endif /* _TRACE_INTEL_IOMMU_H */
 
 /* This part must be outside protection */
+#undef TRACE_INCLUDE_PATH
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_PATH ../../drivers/iommu/intel/
+#define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 4de960834a1b..b02d72097a8c 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -31,10 +31,10 @@
 #include <linux/limits.h>
 #include <asm/irq_remapping.h>
 #include <asm/iommu_table.h>
-#include <trace/events/intel_iommu.h>
 
 #include "../irq_remapping.h"
 #include "perf.h"
+#include "trace.h"
 
 typedef int (*dmar_res_handler_t)(struct acpi_dmar_header *, void *);
 struct dmar_res_callback {
diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
index 7ee37d996e15..70b40d007a52 100644
--- a/drivers/iommu/intel/svm.c
+++ b/drivers/iommu/intel/svm.c
@@ -21,11 +21,11 @@
 #include <linux/ioasid.h>
 #include <asm/page.h>
 #include <asm/fpu/api.h>
-#include <trace/events/intel_iommu.h>
 
 #include "pasid.h"
 #include "perf.h"
 #include "../iommu-sva-lib.h"
+#include "trace.h"
 
 static irqreturn_t prq_event_thread(int irq, void *d);
 static void intel_svm_drain_prq(struct device *dev, u32 pasid);
diff --git a/drivers/iommu/intel/trace.c b/drivers/iommu/intel/trace.c
index bfb6a6e37a88..117e626e3ea9 100644
--- a/drivers/iommu/intel/trace.c
+++ b/drivers/iommu/intel/trace.c
@@ -11,4 +11,4 @@
 #include <linux/types.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/intel_iommu.h>
+#include "trace.h"
-- 
2.25.1

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

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

* [PATCH 1/7] iommu/vt-d: Move trace/events/intel_iommu.h under iommu
@ 2022-05-14  1:43   ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

This header file is private to the Intel IOMMU driver. Move it to the
driver folder.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 .../trace/events/intel_iommu.h => drivers/iommu/intel/trace.h | 4 ++++
 drivers/iommu/intel/dmar.c                                    | 2 +-
 drivers/iommu/intel/svm.c                                     | 2 +-
 drivers/iommu/intel/trace.c                                   | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)
 rename include/trace/events/intel_iommu.h => drivers/iommu/intel/trace.h (94%)

diff --git a/include/trace/events/intel_iommu.h b/drivers/iommu/intel/trace.h
similarity index 94%
rename from include/trace/events/intel_iommu.h
rename to drivers/iommu/intel/trace.h
index e5c1ca6d16ee..25cb7f88e1a2 100644
--- a/include/trace/events/intel_iommu.h
+++ b/drivers/iommu/intel/trace.h
@@ -91,4 +91,8 @@ TRACE_EVENT(prq_report,
 #endif /* _TRACE_INTEL_IOMMU_H */
 
 /* This part must be outside protection */
+#undef TRACE_INCLUDE_PATH
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_PATH ../../drivers/iommu/intel/
+#define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 4de960834a1b..b02d72097a8c 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -31,10 +31,10 @@
 #include <linux/limits.h>
 #include <asm/irq_remapping.h>
 #include <asm/iommu_table.h>
-#include <trace/events/intel_iommu.h>
 
 #include "../irq_remapping.h"
 #include "perf.h"
+#include "trace.h"
 
 typedef int (*dmar_res_handler_t)(struct acpi_dmar_header *, void *);
 struct dmar_res_callback {
diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
index 7ee37d996e15..70b40d007a52 100644
--- a/drivers/iommu/intel/svm.c
+++ b/drivers/iommu/intel/svm.c
@@ -21,11 +21,11 @@
 #include <linux/ioasid.h>
 #include <asm/page.h>
 #include <asm/fpu/api.h>
-#include <trace/events/intel_iommu.h>
 
 #include "pasid.h"
 #include "perf.h"
 #include "../iommu-sva-lib.h"
+#include "trace.h"
 
 static irqreturn_t prq_event_thread(int irq, void *d);
 static void intel_svm_drain_prq(struct device *dev, u32 pasid);
diff --git a/drivers/iommu/intel/trace.c b/drivers/iommu/intel/trace.c
index bfb6a6e37a88..117e626e3ea9 100644
--- a/drivers/iommu/intel/trace.c
+++ b/drivers/iommu/intel/trace.c
@@ -11,4 +11,4 @@
 #include <linux/types.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/intel_iommu.h>
+#include "trace.h"
-- 
2.25.1


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

* [PATCH 2/7] agp/intel: Use per device iommu check
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-14  1:43   ` Lu Baolu
  -1 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

The IOMMU subsystem has already provided an interface to query whether
the IOMMU hardware is enabled for a specific device. This changes the
check from Intel specific intel_iommu_gfx_mapped (globally exported by
the Intel IOMMU driver) to probing the presence of IOMMU on a specific
device using the generic device_iommu_mapped().

This follows commit cca084692394a ("drm/i915: Use per device iommu check")
which converted drm/i915 driver to use device_iommu_mapped().

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/char/agp/intel-gtt.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 79a1b65527c2..cfcb450e9b59 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -20,7 +20,7 @@
 #include <linux/kernel.h>
 #include <linux/pagemap.h>
 #include <linux/agp_backend.h>
-#include <linux/intel-iommu.h>
+#include <linux/iommu.h>
 #include <linux/delay.h>
 #include <asm/smp.h>
 #include "agp.h"
@@ -573,18 +573,15 @@ static void intel_gtt_cleanup(void)
  */
 static inline int needs_ilk_vtd_wa(void)
 {
-#ifdef CONFIG_INTEL_IOMMU
 	const unsigned short gpu_devid = intel_private.pcidev->device;
 
-	/* Query intel_iommu to see if we need the workaround. Presumably that
-	 * was loaded first.
+	/*
+	 * Query iommu subsystem to see if we need the workaround. Presumably
+	 * that was loaded first.
 	 */
-	if ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG ||
-	     gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
-	     intel_iommu_gfx_mapped)
-		return 1;
-#endif
-	return 0;
+	return ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG ||
+		 gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
+		device_iommu_mapped(&intel_private.pcidev->dev));
 }
 
 static bool intel_gtt_can_wc(void)
-- 
2.25.1

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

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

* [PATCH 2/7] agp/intel: Use per device iommu check
@ 2022-05-14  1:43   ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

The IOMMU subsystem has already provided an interface to query whether
the IOMMU hardware is enabled for a specific device. This changes the
check from Intel specific intel_iommu_gfx_mapped (globally exported by
the Intel IOMMU driver) to probing the presence of IOMMU on a specific
device using the generic device_iommu_mapped().

This follows commit cca084692394a ("drm/i915: Use per device iommu check")
which converted drm/i915 driver to use device_iommu_mapped().

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/char/agp/intel-gtt.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 79a1b65527c2..cfcb450e9b59 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -20,7 +20,7 @@
 #include <linux/kernel.h>
 #include <linux/pagemap.h>
 #include <linux/agp_backend.h>
-#include <linux/intel-iommu.h>
+#include <linux/iommu.h>
 #include <linux/delay.h>
 #include <asm/smp.h>
 #include "agp.h"
@@ -573,18 +573,15 @@ static void intel_gtt_cleanup(void)
  */
 static inline int needs_ilk_vtd_wa(void)
 {
-#ifdef CONFIG_INTEL_IOMMU
 	const unsigned short gpu_devid = intel_private.pcidev->device;
 
-	/* Query intel_iommu to see if we need the workaround. Presumably that
-	 * was loaded first.
+	/*
+	 * Query iommu subsystem to see if we need the workaround. Presumably
+	 * that was loaded first.
 	 */
-	if ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG ||
-	     gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
-	     intel_iommu_gfx_mapped)
-		return 1;
-#endif
-	return 0;
+	return ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG ||
+		 gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
+		device_iommu_mapped(&intel_private.pcidev->dev));
 }
 
 static bool intel_gtt_can_wc(void)
-- 
2.25.1


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

* [PATCH 3/7] iommu/vt-d: Remove unnecessary exported symbol
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-14  1:43   ` Lu Baolu
  -1 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

The exported symbol intel_iommu_gfx_mapped is not used anywhere in the
tree. Remove it to avoid dead code.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 include/linux/intel-iommu.h | 1 -
 drivers/iommu/intel/iommu.c | 6 ------
 2 files changed, 7 deletions(-)

diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 4f29139bbfc3..0f9df5a19ef7 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -790,7 +790,6 @@ extern int iommu_calculate_agaw(struct intel_iommu *iommu);
 extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
 extern int dmar_disabled;
 extern int intel_iommu_enabled;
-extern int intel_iommu_gfx_mapped;
 #else
 static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
 {
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index e56b3a4b6998..744af407d0da 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -314,9 +314,6 @@ static int iommu_skip_te_disable;
 #define IDENTMAP_GFX		2
 #define IDENTMAP_AZALIA		4
 
-int intel_iommu_gfx_mapped;
-EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);
-
 DEFINE_SPINLOCK(device_domain_lock);
 static LIST_HEAD(device_domain_list);
 
@@ -4117,9 +4114,6 @@ int __init intel_iommu_init(void)
 	if (list_empty(&dmar_satc_units))
 		pr_info("No SATC found\n");
 
-	if (dmar_map_gfx)
-		intel_iommu_gfx_mapped = 1;
-
 	init_no_remapping_devices();
 
 	ret = init_dmars();
-- 
2.25.1

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

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

* [PATCH 3/7] iommu/vt-d: Remove unnecessary exported symbol
@ 2022-05-14  1:43   ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

The exported symbol intel_iommu_gfx_mapped is not used anywhere in the
tree. Remove it to avoid dead code.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 include/linux/intel-iommu.h | 1 -
 drivers/iommu/intel/iommu.c | 6 ------
 2 files changed, 7 deletions(-)

diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 4f29139bbfc3..0f9df5a19ef7 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -790,7 +790,6 @@ extern int iommu_calculate_agaw(struct intel_iommu *iommu);
 extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
 extern int dmar_disabled;
 extern int intel_iommu_enabled;
-extern int intel_iommu_gfx_mapped;
 #else
 static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
 {
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index e56b3a4b6998..744af407d0da 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -314,9 +314,6 @@ static int iommu_skip_te_disable;
 #define IDENTMAP_GFX		2
 #define IDENTMAP_AZALIA		4
 
-int intel_iommu_gfx_mapped;
-EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);
-
 DEFINE_SPINLOCK(device_domain_lock);
 static LIST_HEAD(device_domain_list);
 
@@ -4117,9 +4114,6 @@ int __init intel_iommu_init(void)
 	if (list_empty(&dmar_satc_units))
 		pr_info("No SATC found\n");
 
-	if (dmar_map_gfx)
-		intel_iommu_gfx_mapped = 1;
-
 	init_no_remapping_devices();
 
 	ret = init_dmars();
-- 
2.25.1


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

* [PATCH 4/7] drm/i915: Remove unnecessary include
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-14  1:43   ` Lu Baolu
  -1 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

intel-iommu.h is not needed in drm/i915 anymore. Remove its include.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h                | 1 -
 drivers/gpu/drm/i915/display/intel_display.c   | 1 -
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 -
 3 files changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index fa14da84362e..f2a6982c3bef 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -36,7 +36,6 @@
 
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
-#include <linux/intel-iommu.h>
 #include <linux/pm_qos.h>
 
 #include <drm/drm_connector.h>
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 7dfeb458aa65..686ddbeebadc 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -27,7 +27,6 @@
 #include <acpi/video.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
-#include <linux/intel-iommu.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/dma-resv.h>
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index d42f437149c9..c9823528ea94 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -4,7 +4,6 @@
  * Copyright © 2008,2010 Intel Corporation
  */
 
-#include <linux/intel-iommu.h>
 #include <linux/dma-resv.h>
 #include <linux/sync_file.h>
 #include <linux/uaccess.h>
-- 
2.25.1

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

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

* [PATCH 4/7] drm/i915: Remove unnecessary include
@ 2022-05-14  1:43   ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

intel-iommu.h is not needed in drm/i915 anymore. Remove its include.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h                | 1 -
 drivers/gpu/drm/i915/display/intel_display.c   | 1 -
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 -
 3 files changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index fa14da84362e..f2a6982c3bef 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -36,7 +36,6 @@
 
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
-#include <linux/intel-iommu.h>
 #include <linux/pm_qos.h>
 
 #include <drm/drm_connector.h>
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 7dfeb458aa65..686ddbeebadc 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -27,7 +27,6 @@
 #include <acpi/video.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
-#include <linux/intel-iommu.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/dma-resv.h>
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index d42f437149c9..c9823528ea94 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -4,7 +4,6 @@
  * Copyright © 2008,2010 Intel Corporation
  */
 
-#include <linux/intel-iommu.h>
 #include <linux/dma-resv.h>
 #include <linux/sync_file.h>
 #include <linux/uaccess.h>
-- 
2.25.1


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

* [PATCH 5/7] KVM: x86: Remove unnecessary include
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-14  1:43   ` Lu Baolu
  -1 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

intel-iommu.h is not needed in kvm/x86 anymore. Remove its include.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 arch/x86/kvm/x86.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4790f0d7d40b..fdf6ce5855d9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -41,7 +41,6 @@
 #include <linux/mman.h>
 #include <linux/highmem.h>
 #include <linux/iommu.h>
-#include <linux/intel-iommu.h>
 #include <linux/cpufreq.h>
 #include <linux/user-return-notifier.h>
 #include <linux/srcu.h>
-- 
2.25.1

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

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

* [PATCH 5/7] KVM: x86: Remove unnecessary include
@ 2022-05-14  1:43   ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

intel-iommu.h is not needed in kvm/x86 anymore. Remove its include.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 arch/x86/kvm/x86.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4790f0d7d40b..fdf6ce5855d9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -41,7 +41,6 @@
 #include <linux/mman.h>
 #include <linux/highmem.h>
 #include <linux/iommu.h>
-#include <linux/intel-iommu.h>
 #include <linux/cpufreq.h>
 #include <linux/user-return-notifier.h>
 #include <linux/srcu.h>
-- 
2.25.1


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

* [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-14  1:43   ` Lu Baolu
  -1 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

tboot_force_iommu() is only called by the Intel IOMMU driver. Move the
helper into that driver. No functional change intended.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 include/linux/tboot.h       |  2 --
 arch/x86/kernel/tboot.c     | 15 ---------------
 drivers/iommu/intel/iommu.c | 14 ++++++++++++++
 3 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/include/linux/tboot.h b/include/linux/tboot.h
index 5146d2574e85..d2279160ef39 100644
--- a/include/linux/tboot.h
+++ b/include/linux/tboot.h
@@ -126,7 +126,6 @@ extern void tboot_probe(void);
 extern void tboot_shutdown(u32 shutdown_type);
 extern struct acpi_table_header *tboot_get_dmar_table(
 				      struct acpi_table_header *dmar_tbl);
-extern int tboot_force_iommu(void);
 
 #else
 
@@ -136,7 +135,6 @@ extern int tboot_force_iommu(void);
 #define tboot_sleep(sleep_state, pm1a_control, pm1b_control)	\
 					do { } while (0)
 #define tboot_get_dmar_table(dmar_tbl)	(dmar_tbl)
-#define tboot_force_iommu()		0
 
 #endif /* !CONFIG_INTEL_TXT */
 
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index f9af561c3cd4..6eb9c4146f17 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -6,7 +6,6 @@
  * Copyright (c) 2006-2009, Intel Corporation
  */
 
-#include <linux/intel-iommu.h>
 #include <linux/init_task.h>
 #include <linux/spinlock.h>
 #include <linux/export.h>
@@ -517,17 +516,3 @@ struct acpi_table_header *tboot_get_dmar_table(struct acpi_table_header *dmar_tb
 
 	return dmar_tbl;
 }
-
-int tboot_force_iommu(void)
-{
-	if (!tboot_enabled())
-		return 0;
-
-	if (no_iommu || dmar_disabled)
-		pr_warn("Forcing Intel-IOMMU to enabled\n");
-
-	dmar_disabled = 0;
-	no_iommu = 0;
-
-	return 1;
-}
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 744af407d0da..ea1c3bcd38d5 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -4043,6 +4043,20 @@ static int __init probe_acpi_namespace_devices(void)
 	return 0;
 }
 
+static __init int tboot_force_iommu(void)
+{
+	if (!tboot_enabled())
+		return 0;
+
+	if (no_iommu || dmar_disabled)
+		pr_warn("Forcing Intel-IOMMU to enabled\n");
+
+	dmar_disabled = 0;
+	no_iommu = 0;
+
+	return 1;
+}
+
 int __init intel_iommu_init(void)
 {
 	int ret = -ENODEV;
-- 
2.25.1

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

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

* [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
@ 2022-05-14  1:43   ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

tboot_force_iommu() is only called by the Intel IOMMU driver. Move the
helper into that driver. No functional change intended.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 include/linux/tboot.h       |  2 --
 arch/x86/kernel/tboot.c     | 15 ---------------
 drivers/iommu/intel/iommu.c | 14 ++++++++++++++
 3 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/include/linux/tboot.h b/include/linux/tboot.h
index 5146d2574e85..d2279160ef39 100644
--- a/include/linux/tboot.h
+++ b/include/linux/tboot.h
@@ -126,7 +126,6 @@ extern void tboot_probe(void);
 extern void tboot_shutdown(u32 shutdown_type);
 extern struct acpi_table_header *tboot_get_dmar_table(
 				      struct acpi_table_header *dmar_tbl);
-extern int tboot_force_iommu(void);
 
 #else
 
@@ -136,7 +135,6 @@ extern int tboot_force_iommu(void);
 #define tboot_sleep(sleep_state, pm1a_control, pm1b_control)	\
 					do { } while (0)
 #define tboot_get_dmar_table(dmar_tbl)	(dmar_tbl)
-#define tboot_force_iommu()		0
 
 #endif /* !CONFIG_INTEL_TXT */
 
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index f9af561c3cd4..6eb9c4146f17 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -6,7 +6,6 @@
  * Copyright (c) 2006-2009, Intel Corporation
  */
 
-#include <linux/intel-iommu.h>
 #include <linux/init_task.h>
 #include <linux/spinlock.h>
 #include <linux/export.h>
@@ -517,17 +516,3 @@ struct acpi_table_header *tboot_get_dmar_table(struct acpi_table_header *dmar_tb
 
 	return dmar_tbl;
 }
-
-int tboot_force_iommu(void)
-{
-	if (!tboot_enabled())
-		return 0;
-
-	if (no_iommu || dmar_disabled)
-		pr_warn("Forcing Intel-IOMMU to enabled\n");
-
-	dmar_disabled = 0;
-	no_iommu = 0;
-
-	return 1;
-}
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 744af407d0da..ea1c3bcd38d5 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -4043,6 +4043,20 @@ static int __init probe_acpi_namespace_devices(void)
 	return 0;
 }
 
+static __init int tboot_force_iommu(void)
+{
+	if (!tboot_enabled())
+		return 0;
+
+	if (no_iommu || dmar_disabled)
+		pr_warn("Forcing Intel-IOMMU to enabled\n");
+
+	dmar_disabled = 0;
+	no_iommu = 0;
+
+	return 1;
+}
+
 int __init intel_iommu_init(void)
 {
 	int ret = -ENODEV;
-- 
2.25.1


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

* [PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-14  1:43   ` Lu Baolu
  -1 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

This header file is private to the Intel IOMMU driver. Move it to the
driver folder.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h | 0
 drivers/iommu/intel/trace.h                                | 3 ++-
 drivers/iommu/intel/cap_audit.c                            | 2 +-
 drivers/iommu/intel/debugfs.c                              | 2 +-
 drivers/iommu/intel/dmar.c                                 | 2 +-
 drivers/iommu/intel/iommu.c                                | 2 +-
 drivers/iommu/intel/irq_remapping.c                        | 2 +-
 drivers/iommu/intel/pasid.c                                | 2 +-
 drivers/iommu/intel/perf.c                                 | 2 +-
 drivers/iommu/intel/svm.c                                  | 2 +-
 MAINTAINERS                                                | 1 -
 11 files changed, 10 insertions(+), 10 deletions(-)
 rename include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h (100%)

diff --git a/include/linux/intel-iommu.h b/drivers/iommu/intel/iommu.h
similarity index 100%
rename from include/linux/intel-iommu.h
rename to drivers/iommu/intel/iommu.h
diff --git a/drivers/iommu/intel/trace.h b/drivers/iommu/intel/trace.h
index 25cb7f88e1a2..93d96f93a89b 100644
--- a/drivers/iommu/intel/trace.h
+++ b/drivers/iommu/intel/trace.h
@@ -13,7 +13,8 @@
 #define _TRACE_INTEL_IOMMU_H
 
 #include <linux/tracepoint.h>
-#include <linux/intel-iommu.h>
+
+#include "iommu.h"
 
 #define MSG_MAX		256
 
diff --git a/drivers/iommu/intel/cap_audit.c b/drivers/iommu/intel/cap_audit.c
index 71596fc62822..3ee68393122f 100644
--- a/drivers/iommu/intel/cap_audit.c
+++ b/drivers/iommu/intel/cap_audit.c
@@ -10,7 +10,7 @@
 
 #define pr_fmt(fmt)	"DMAR: " fmt
 
-#include <linux/intel-iommu.h>
+#include "iommu.h"
 #include "cap_audit.h"
 
 static u64 intel_iommu_cap_sanity;
diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index ed796eea4581..d927ef10641b 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -10,11 +10,11 @@
 
 #include <linux/debugfs.h>
 #include <linux/dmar.h>
-#include <linux/intel-iommu.h>
 #include <linux/pci.h>
 
 #include <asm/irq_remapping.h>
 
+#include "iommu.h"
 #include "pasid.h"
 #include "perf.h"
 
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index b02d72097a8c..059af0ef2a9d 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -19,7 +19,6 @@
 #include <linux/pci.h>
 #include <linux/dmar.h>
 #include <linux/iova.h>
-#include <linux/intel-iommu.h>
 #include <linux/timer.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -32,6 +31,7 @@
 #include <asm/irq_remapping.h>
 #include <asm/iommu_table.h>
 
+#include "iommu.h"
 #include "../irq_remapping.h"
 #include "perf.h"
 #include "trace.h"
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index ea1c3bcd38d5..1af4b6562266 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -17,7 +17,6 @@
 #include <linux/dma-direct.h>
 #include <linux/dma-iommu.h>
 #include <linux/dmi.h>
-#include <linux/intel-iommu.h>
 #include <linux/intel-svm.h>
 #include <linux/memory.h>
 #include <linux/pci.h>
@@ -26,6 +25,7 @@
 #include <linux/syscore_ops.h>
 #include <linux/tboot.h>
 
+#include "iommu.h"
 #include "../irq_remapping.h"
 #include "../iommu-sva-lib.h"
 #include "pasid.h"
diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c
index a67319597884..2e9683e970f8 100644
--- a/drivers/iommu/intel/irq_remapping.c
+++ b/drivers/iommu/intel/irq_remapping.c
@@ -10,7 +10,6 @@
 #include <linux/hpet.h>
 #include <linux/pci.h>
 #include <linux/irq.h>
-#include <linux/intel-iommu.h>
 #include <linux/acpi.h>
 #include <linux/irqdomain.h>
 #include <linux/crash_dump.h>
@@ -21,6 +20,7 @@
 #include <asm/irq_remapping.h>
 #include <asm/pci-direct.h>
 
+#include "iommu.h"
 #include "../irq_remapping.h"
 #include "cap_audit.h"
 
diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c
index cb4c1d0cf25c..b2ac5869286f 100644
--- a/drivers/iommu/intel/pasid.c
+++ b/drivers/iommu/intel/pasid.c
@@ -12,13 +12,13 @@
 #include <linux/bitops.h>
 #include <linux/cpufeature.h>
 #include <linux/dmar.h>
-#include <linux/intel-iommu.h>
 #include <linux/iommu.h>
 #include <linux/memory.h>
 #include <linux/pci.h>
 #include <linux/pci-ats.h>
 #include <linux/spinlock.h>
 
+#include "iommu.h"
 #include "pasid.h"
 
 /*
diff --git a/drivers/iommu/intel/perf.c b/drivers/iommu/intel/perf.c
index 0e8e03252d92..94ee70ac38e3 100644
--- a/drivers/iommu/intel/perf.c
+++ b/drivers/iommu/intel/perf.c
@@ -9,8 +9,8 @@
  */
 
 #include <linux/spinlock.h>
-#include <linux/intel-iommu.h>
 
+#include "iommu.h"
 #include "perf.h"
 
 static DEFINE_SPINLOCK(latency_lock);
diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
index 70b40d007a52..580713aa9e07 100644
--- a/drivers/iommu/intel/svm.c
+++ b/drivers/iommu/intel/svm.c
@@ -5,7 +5,6 @@
  * Authors: David Woodhouse <dwmw2@infradead.org>
  */
 
-#include <linux/intel-iommu.h>
 #include <linux/mmu_notifier.h>
 #include <linux/sched.h>
 #include <linux/sched/mm.h>
@@ -22,6 +21,7 @@
 #include <asm/page.h>
 #include <asm/fpu/api.h>
 
+#include "iommu.h"
 #include "pasid.h"
 #include "perf.h"
 #include "../iommu-sva-lib.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index a2095c832d84..81458c7f9a32 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9870,7 +9870,6 @@ L:	iommu@lists.linux-foundation.org
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 F:	drivers/iommu/intel/
-F:	include/linux/intel-iommu.h
 F:	include/linux/intel-svm.h
 
 INTEL IOP-ADMA DMA DRIVER
-- 
2.25.1

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

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

* [PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu
@ 2022-05-14  1:43   ` Lu Baolu
  0 siblings, 0 replies; 44+ messages in thread
From: Lu Baolu @ 2022-05-14  1:43 UTC (permalink / raw)
  To: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

This header file is private to the Intel IOMMU driver. Move it to the
driver folder.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h | 0
 drivers/iommu/intel/trace.h                                | 3 ++-
 drivers/iommu/intel/cap_audit.c                            | 2 +-
 drivers/iommu/intel/debugfs.c                              | 2 +-
 drivers/iommu/intel/dmar.c                                 | 2 +-
 drivers/iommu/intel/iommu.c                                | 2 +-
 drivers/iommu/intel/irq_remapping.c                        | 2 +-
 drivers/iommu/intel/pasid.c                                | 2 +-
 drivers/iommu/intel/perf.c                                 | 2 +-
 drivers/iommu/intel/svm.c                                  | 2 +-
 MAINTAINERS                                                | 1 -
 11 files changed, 10 insertions(+), 10 deletions(-)
 rename include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h (100%)

diff --git a/include/linux/intel-iommu.h b/drivers/iommu/intel/iommu.h
similarity index 100%
rename from include/linux/intel-iommu.h
rename to drivers/iommu/intel/iommu.h
diff --git a/drivers/iommu/intel/trace.h b/drivers/iommu/intel/trace.h
index 25cb7f88e1a2..93d96f93a89b 100644
--- a/drivers/iommu/intel/trace.h
+++ b/drivers/iommu/intel/trace.h
@@ -13,7 +13,8 @@
 #define _TRACE_INTEL_IOMMU_H
 
 #include <linux/tracepoint.h>
-#include <linux/intel-iommu.h>
+
+#include "iommu.h"
 
 #define MSG_MAX		256
 
diff --git a/drivers/iommu/intel/cap_audit.c b/drivers/iommu/intel/cap_audit.c
index 71596fc62822..3ee68393122f 100644
--- a/drivers/iommu/intel/cap_audit.c
+++ b/drivers/iommu/intel/cap_audit.c
@@ -10,7 +10,7 @@
 
 #define pr_fmt(fmt)	"DMAR: " fmt
 
-#include <linux/intel-iommu.h>
+#include "iommu.h"
 #include "cap_audit.h"
 
 static u64 intel_iommu_cap_sanity;
diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index ed796eea4581..d927ef10641b 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -10,11 +10,11 @@
 
 #include <linux/debugfs.h>
 #include <linux/dmar.h>
-#include <linux/intel-iommu.h>
 #include <linux/pci.h>
 
 #include <asm/irq_remapping.h>
 
+#include "iommu.h"
 #include "pasid.h"
 #include "perf.h"
 
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index b02d72097a8c..059af0ef2a9d 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -19,7 +19,6 @@
 #include <linux/pci.h>
 #include <linux/dmar.h>
 #include <linux/iova.h>
-#include <linux/intel-iommu.h>
 #include <linux/timer.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -32,6 +31,7 @@
 #include <asm/irq_remapping.h>
 #include <asm/iommu_table.h>
 
+#include "iommu.h"
 #include "../irq_remapping.h"
 #include "perf.h"
 #include "trace.h"
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index ea1c3bcd38d5..1af4b6562266 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -17,7 +17,6 @@
 #include <linux/dma-direct.h>
 #include <linux/dma-iommu.h>
 #include <linux/dmi.h>
-#include <linux/intel-iommu.h>
 #include <linux/intel-svm.h>
 #include <linux/memory.h>
 #include <linux/pci.h>
@@ -26,6 +25,7 @@
 #include <linux/syscore_ops.h>
 #include <linux/tboot.h>
 
+#include "iommu.h"
 #include "../irq_remapping.h"
 #include "../iommu-sva-lib.h"
 #include "pasid.h"
diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c
index a67319597884..2e9683e970f8 100644
--- a/drivers/iommu/intel/irq_remapping.c
+++ b/drivers/iommu/intel/irq_remapping.c
@@ -10,7 +10,6 @@
 #include <linux/hpet.h>
 #include <linux/pci.h>
 #include <linux/irq.h>
-#include <linux/intel-iommu.h>
 #include <linux/acpi.h>
 #include <linux/irqdomain.h>
 #include <linux/crash_dump.h>
@@ -21,6 +20,7 @@
 #include <asm/irq_remapping.h>
 #include <asm/pci-direct.h>
 
+#include "iommu.h"
 #include "../irq_remapping.h"
 #include "cap_audit.h"
 
diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c
index cb4c1d0cf25c..b2ac5869286f 100644
--- a/drivers/iommu/intel/pasid.c
+++ b/drivers/iommu/intel/pasid.c
@@ -12,13 +12,13 @@
 #include <linux/bitops.h>
 #include <linux/cpufeature.h>
 #include <linux/dmar.h>
-#include <linux/intel-iommu.h>
 #include <linux/iommu.h>
 #include <linux/memory.h>
 #include <linux/pci.h>
 #include <linux/pci-ats.h>
 #include <linux/spinlock.h>
 
+#include "iommu.h"
 #include "pasid.h"
 
 /*
diff --git a/drivers/iommu/intel/perf.c b/drivers/iommu/intel/perf.c
index 0e8e03252d92..94ee70ac38e3 100644
--- a/drivers/iommu/intel/perf.c
+++ b/drivers/iommu/intel/perf.c
@@ -9,8 +9,8 @@
  */
 
 #include <linux/spinlock.h>
-#include <linux/intel-iommu.h>
 
+#include "iommu.h"
 #include "perf.h"
 
 static DEFINE_SPINLOCK(latency_lock);
diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
index 70b40d007a52..580713aa9e07 100644
--- a/drivers/iommu/intel/svm.c
+++ b/drivers/iommu/intel/svm.c
@@ -5,7 +5,6 @@
  * Authors: David Woodhouse <dwmw2@infradead.org>
  */
 
-#include <linux/intel-iommu.h>
 #include <linux/mmu_notifier.h>
 #include <linux/sched.h>
 #include <linux/sched/mm.h>
@@ -22,6 +21,7 @@
 #include <asm/page.h>
 #include <asm/fpu/api.h>
 
+#include "iommu.h"
 #include "pasid.h"
 #include "perf.h"
 #include "../iommu-sva-lib.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index a2095c832d84..81458c7f9a32 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9870,7 +9870,6 @@ L:	iommu@lists.linux-foundation.org
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 F:	drivers/iommu/intel/
-F:	include/linux/intel-iommu.h
 F:	include/linux/intel-svm.h
 
 INTEL IOP-ADMA DMA DRIVER
-- 
2.25.1


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

* Re: [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-16  5:54   ` Christoph Hellwig
  -1 siblings, 0 replies; 44+ messages in thread
From: Christoph Hellwig @ 2022-05-16  5:54 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel

On Sat, May 14, 2022 at 09:43:15AM +0800, Lu Baolu wrote:
> Hi folks,
> 
> The include/linux/intel-iommu.h should be private to the Intel IOMMU
> driver. Other drivers or components should interact with the IOMMU
> drivers through the kAPIs provided by the iommu core.
> 
> This series cleanups all includes of intel-iommu.h outside of the Intel
> IOMMU driver and move this header from include/linux to
> drivers/iommu/intel/.
> 
> No functional changes intended. Please help to review and suggest.

Thanks, this was long overdue!

The series looks good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private
@ 2022-05-16  5:54   ` Christoph Hellwig
  0 siblings, 0 replies; 44+ messages in thread
From: Christoph Hellwig @ 2022-05-16  5:54 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Jason Gunthorpe, Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen,
	Rodrigo Vivi, Thomas Gleixner, Tvrtko Ursulin, linux-kernel,
	iommu, Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:15AM +0800, Lu Baolu wrote:
> Hi folks,
> 
> The include/linux/intel-iommu.h should be private to the Intel IOMMU
> driver. Other drivers or components should interact with the IOMMU
> drivers through the kAPIs provided by the iommu core.
> 
> This series cleanups all includes of intel-iommu.h outside of the Intel
> IOMMU driver and move this header from include/linux to
> drivers/iommu/intel/.
> 
> No functional changes intended. Please help to review and suggest.

Thanks, this was long overdue!

The series looks good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 4/7] drm/i915: Remove unnecessary include
  2022-05-14  1:43   ` Lu Baolu
@ 2022-05-16  7:28     ` Jani Nikula
  -1 siblings, 0 replies; 44+ messages in thread
From: Jani Nikula @ 2022-05-16  7:28 UTC (permalink / raw)
  To: Lu Baolu, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, Paolo Bonzini, David Airlie,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel, Lu Baolu

On Sat, 14 May 2022, Lu Baolu <baolu.lu@linux.intel.com> wrote:
> intel-iommu.h is not needed in drm/i915 anymore. Remove its include.

Thanks for the cleanups. Do you want to keep the patches together or
want us to pick this up via drm-intel?

If you want to keep the patches together,

Acked-by: Jani Nikula <jani.nikula@intel.com>

for merging via whichever tree suits you best. Just let us know.

BR,
Jani.


>
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h                | 1 -
>  drivers/gpu/drm/i915/display/intel_display.c   | 1 -
>  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 -
>  3 files changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index fa14da84362e..f2a6982c3bef 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -36,7 +36,6 @@
>  
>  #include <linux/i2c.h>
>  #include <linux/i2c-algo-bit.h>
> -#include <linux/intel-iommu.h>
>  #include <linux/pm_qos.h>
>  
>  #include <drm/drm_connector.h>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 7dfeb458aa65..686ddbeebadc 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -27,7 +27,6 @@
>  #include <acpi/video.h>
>  #include <linux/i2c.h>
>  #include <linux/input.h>
> -#include <linux/intel-iommu.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/dma-resv.h>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index d42f437149c9..c9823528ea94 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -4,7 +4,6 @@
>   * Copyright © 2008,2010 Intel Corporation
>   */
>  
> -#include <linux/intel-iommu.h>
>  #include <linux/dma-resv.h>
>  #include <linux/sync_file.h>
>  #include <linux/uaccess.h>

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [PATCH 4/7] drm/i915: Remove unnecessary include
@ 2022-05-16  7:28     ` Jani Nikula
  0 siblings, 0 replies; 44+ messages in thread
From: Jani Nikula @ 2022-05-16  7:28 UTC (permalink / raw)
  To: Lu Baolu, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, Paolo Bonzini, David Airlie,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun
  Cc: Steve Wahl, Will Deacon, linux-kernel, iommu, Jason Gunthorpe,
	Robin Murphy, Christoph Hellwig

On Sat, 14 May 2022, Lu Baolu <baolu.lu@linux.intel.com> wrote:
> intel-iommu.h is not needed in drm/i915 anymore. Remove its include.

Thanks for the cleanups. Do you want to keep the patches together or
want us to pick this up via drm-intel?

If you want to keep the patches together,

Acked-by: Jani Nikula <jani.nikula@intel.com>

for merging via whichever tree suits you best. Just let us know.

BR,
Jani.


>
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h                | 1 -
>  drivers/gpu/drm/i915/display/intel_display.c   | 1 -
>  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 -
>  3 files changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index fa14da84362e..f2a6982c3bef 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -36,7 +36,6 @@
>  
>  #include <linux/i2c.h>
>  #include <linux/i2c-algo-bit.h>
> -#include <linux/intel-iommu.h>
>  #include <linux/pm_qos.h>
>  
>  #include <drm/drm_connector.h>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 7dfeb458aa65..686ddbeebadc 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -27,7 +27,6 @@
>  #include <acpi/video.h>
>  #include <linux/i2c.h>
>  #include <linux/input.h>
> -#include <linux/intel-iommu.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/dma-resv.h>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index d42f437149c9..c9823528ea94 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -4,7 +4,6 @@
>   * Copyright © 2008,2010 Intel Corporation
>   */
>  
> -#include <linux/intel-iommu.h>
>  #include <linux/dma-resv.h>
>  #include <linux/sync_file.h>
>  #include <linux/uaccess.h>

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 1/7] iommu/vt-d: Move trace/events/intel_iommu.h under iommu
  2022-05-14  1:43   ` Lu Baolu
@ 2022-05-16 18:04     ` Jason Gunthorpe via iommu
  -1 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe @ 2022-05-16 18:04 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel

On Sat, May 14, 2022 at 09:43:16AM +0800, Lu Baolu wrote:
> This header file is private to the Intel IOMMU driver. Move it to the
> driver folder.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  .../trace/events/intel_iommu.h => drivers/iommu/intel/trace.h | 4 ++++
>  drivers/iommu/intel/dmar.c                                    | 2 +-
>  drivers/iommu/intel/svm.c                                     | 2 +-
>  drivers/iommu/intel/trace.c                                   | 2 +-
>  4 files changed, 7 insertions(+), 3 deletions(-)
>  rename include/trace/events/intel_iommu.h => drivers/iommu/intel/trace.h (94%)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

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

* Re: [PATCH 1/7] iommu/vt-d: Move trace/events/intel_iommu.h under iommu
@ 2022-05-16 18:04     ` Jason Gunthorpe via iommu
  0 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe via iommu @ 2022-05-16 18:04 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:16AM +0800, Lu Baolu wrote:
> This header file is private to the Intel IOMMU driver. Move it to the
> driver folder.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  .../trace/events/intel_iommu.h => drivers/iommu/intel/trace.h | 4 ++++
>  drivers/iommu/intel/dmar.c                                    | 2 +-
>  drivers/iommu/intel/svm.c                                     | 2 +-
>  drivers/iommu/intel/trace.c                                   | 2 +-
>  4 files changed, 7 insertions(+), 3 deletions(-)
>  rename include/trace/events/intel_iommu.h => drivers/iommu/intel/trace.h (94%)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

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

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

* Re: [PATCH 2/7] agp/intel: Use per device iommu check
  2022-05-14  1:43   ` Lu Baolu
@ 2022-05-16 18:04     ` Jason Gunthorpe via iommu
  -1 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe @ 2022-05-16 18:04 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel

On Sat, May 14, 2022 at 09:43:17AM +0800, Lu Baolu wrote:
> The IOMMU subsystem has already provided an interface to query whether
> the IOMMU hardware is enabled for a specific device. This changes the
> check from Intel specific intel_iommu_gfx_mapped (globally exported by
> the Intel IOMMU driver) to probing the presence of IOMMU on a specific
> device using the generic device_iommu_mapped().
> 
> This follows commit cca084692394a ("drm/i915: Use per device iommu check")
> which converted drm/i915 driver to use device_iommu_mapped().
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/char/agp/intel-gtt.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

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

* Re: [PATCH 2/7] agp/intel: Use per device iommu check
@ 2022-05-16 18:04     ` Jason Gunthorpe via iommu
  0 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe via iommu @ 2022-05-16 18:04 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:17AM +0800, Lu Baolu wrote:
> The IOMMU subsystem has already provided an interface to query whether
> the IOMMU hardware is enabled for a specific device. This changes the
> check from Intel specific intel_iommu_gfx_mapped (globally exported by
> the Intel IOMMU driver) to probing the presence of IOMMU on a specific
> device using the generic device_iommu_mapped().
> 
> This follows commit cca084692394a ("drm/i915: Use per device iommu check")
> which converted drm/i915 driver to use device_iommu_mapped().
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/char/agp/intel-gtt.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

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

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

* Re: [PATCH 3/7] iommu/vt-d: Remove unnecessary exported symbol
  2022-05-14  1:43   ` Lu Baolu
@ 2022-05-16 18:04     ` Jason Gunthorpe via iommu
  -1 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe @ 2022-05-16 18:04 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel

On Sat, May 14, 2022 at 09:43:18AM +0800, Lu Baolu wrote:
> The exported symbol intel_iommu_gfx_mapped is not used anywhere in the
> tree. Remove it to avoid dead code.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  include/linux/intel-iommu.h | 1 -
>  drivers/iommu/intel/iommu.c | 6 ------
>  2 files changed, 7 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Maybe could squash to the prior patch

Jason

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

* Re: [PATCH 3/7] iommu/vt-d: Remove unnecessary exported symbol
@ 2022-05-16 18:04     ` Jason Gunthorpe via iommu
  0 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe via iommu @ 2022-05-16 18:04 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:18AM +0800, Lu Baolu wrote:
> The exported symbol intel_iommu_gfx_mapped is not used anywhere in the
> tree. Remove it to avoid dead code.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  include/linux/intel-iommu.h | 1 -
>  drivers/iommu/intel/iommu.c | 6 ------
>  2 files changed, 7 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Maybe could squash to the prior patch

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

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

* Re: [PATCH 4/7] drm/i915: Remove unnecessary include
  2022-05-14  1:43   ` Lu Baolu
@ 2022-05-16 18:04     ` Jason Gunthorpe via iommu
  -1 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe @ 2022-05-16 18:04 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel

On Sat, May 14, 2022 at 09:43:19AM +0800, Lu Baolu wrote:
> intel-iommu.h is not needed in drm/i915 anymore. Remove its include.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h                | 1 -
>  drivers/gpu/drm/i915/display/intel_display.c   | 1 -
>  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 -
>  3 files changed, 3 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

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

* Re: [PATCH 4/7] drm/i915: Remove unnecessary include
@ 2022-05-16 18:04     ` Jason Gunthorpe via iommu
  0 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe via iommu @ 2022-05-16 18:04 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:19AM +0800, Lu Baolu wrote:
> intel-iommu.h is not needed in drm/i915 anymore. Remove its include.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h                | 1 -
>  drivers/gpu/drm/i915/display/intel_display.c   | 1 -
>  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 -
>  3 files changed, 3 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

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

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

* Re: [PATCH 5/7] KVM: x86: Remove unnecessary include
  2022-05-14  1:43   ` Lu Baolu
@ 2022-05-16 18:05     ` Jason Gunthorpe via iommu
  -1 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe @ 2022-05-16 18:05 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel

On Sat, May 14, 2022 at 09:43:20AM +0800, Lu Baolu wrote:
> intel-iommu.h is not needed in kvm/x86 anymore. Remove its include.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  arch/x86/kvm/x86.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

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

* Re: [PATCH 5/7] KVM: x86: Remove unnecessary include
@ 2022-05-16 18:05     ` Jason Gunthorpe via iommu
  0 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe via iommu @ 2022-05-16 18:05 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:20AM +0800, Lu Baolu wrote:
> intel-iommu.h is not needed in kvm/x86 anymore. Remove its include.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  arch/x86/kvm/x86.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

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

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
  2022-05-14  1:43   ` Lu Baolu
@ 2022-05-16 18:06     ` Jason Gunthorpe via iommu
  -1 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe @ 2022-05-16 18:06 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel

On Sat, May 14, 2022 at 09:43:21AM +0800, Lu Baolu wrote:
> tboot_force_iommu() is only called by the Intel IOMMU driver. Move the
> helper into that driver. No functional change intended.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  include/linux/tboot.h       |  2 --
>  arch/x86/kernel/tboot.c     | 15 ---------------
>  drivers/iommu/intel/iommu.c | 14 ++++++++++++++
>  3 files changed, 14 insertions(+), 17 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

> +static __init int tboot_force_iommu(void)
> +{
> +	if (!tboot_enabled())
> +		return 0;
> +
> +	if (no_iommu || dmar_disabled)
> +		pr_warn("Forcing Intel-IOMMU to enabled\n");

Unrelated, but when we are in the special secure IOMMU modes, do we
force ATS off? Specifically does the IOMMU reject TLPs that are marked
as translated?

Jason

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
@ 2022-05-16 18:06     ` Jason Gunthorpe via iommu
  0 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe via iommu @ 2022-05-16 18:06 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:21AM +0800, Lu Baolu wrote:
> tboot_force_iommu() is only called by the Intel IOMMU driver. Move the
> helper into that driver. No functional change intended.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  include/linux/tboot.h       |  2 --
>  arch/x86/kernel/tboot.c     | 15 ---------------
>  drivers/iommu/intel/iommu.c | 14 ++++++++++++++
>  3 files changed, 14 insertions(+), 17 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

> +static __init int tboot_force_iommu(void)
> +{
> +	if (!tboot_enabled())
> +		return 0;
> +
> +	if (no_iommu || dmar_disabled)
> +		pr_warn("Forcing Intel-IOMMU to enabled\n");

Unrelated, but when we are in the special secure IOMMU modes, do we
force ATS off? Specifically does the IOMMU reject TLPs that are marked
as translated?

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

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

* Re: [PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu
  2022-05-14  1:43   ` Lu Baolu
@ 2022-05-16 18:06     ` Jason Gunthorpe via iommu
  -1 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe @ 2022-05-16 18:06 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel

On Sat, May 14, 2022 at 09:43:22AM +0800, Lu Baolu wrote:
> This header file is private to the Intel IOMMU driver. Move it to the
> driver folder.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h | 0
>  drivers/iommu/intel/trace.h                                | 3 ++-
>  drivers/iommu/intel/cap_audit.c                            | 2 +-
>  drivers/iommu/intel/debugfs.c                              | 2 +-
>  drivers/iommu/intel/dmar.c                                 | 2 +-
>  drivers/iommu/intel/iommu.c                                | 2 +-
>  drivers/iommu/intel/irq_remapping.c                        | 2 +-
>  drivers/iommu/intel/pasid.c                                | 2 +-
>  drivers/iommu/intel/perf.c                                 | 2 +-
>  drivers/iommu/intel/svm.c                                  | 2 +-
>  MAINTAINERS                                                | 1 -
>  11 files changed, 10 insertions(+), 10 deletions(-)
>  rename include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h (100%)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

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

* Re: [PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu
@ 2022-05-16 18:06     ` Jason Gunthorpe via iommu
  0 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe via iommu @ 2022-05-16 18:06 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:22AM +0800, Lu Baolu wrote:
> This header file is private to the Intel IOMMU driver. Move it to the
> driver folder.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h | 0
>  drivers/iommu/intel/trace.h                                | 3 ++-
>  drivers/iommu/intel/cap_audit.c                            | 2 +-
>  drivers/iommu/intel/debugfs.c                              | 2 +-
>  drivers/iommu/intel/dmar.c                                 | 2 +-
>  drivers/iommu/intel/iommu.c                                | 2 +-
>  drivers/iommu/intel/irq_remapping.c                        | 2 +-
>  drivers/iommu/intel/pasid.c                                | 2 +-
>  drivers/iommu/intel/perf.c                                 | 2 +-
>  drivers/iommu/intel/svm.c                                  | 2 +-
>  MAINTAINERS                                                | 1 -
>  11 files changed, 10 insertions(+), 10 deletions(-)
>  rename include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h (100%)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

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

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
  2022-05-16 18:06     ` Jason Gunthorpe via iommu
@ 2022-05-16 22:58       ` Jacob Pan
  -1 siblings, 0 replies; 44+ messages in thread
From: Jacob Pan @ 2022-05-16 22:58 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Lu Baolu, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, Paolo Bonzini, David Airlie,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	Daniel Vetter, Kevin Tian, Ashok Raj, Liu Yi L, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel, jacob.jun.pan

Hi Jason,

On Mon, 16 May 2022 15:06:28 -0300, Jason Gunthorpe <jgg@nvidia.com> wrote:

> Unrelated, but when we are in the special secure IOMMU modes, do we
> force ATS off? Specifically does the IOMMU reject TLPs that are marked
> as translated?
Yes, VT-d context entry has a Device TLB Enable bit, if 0, it means
"Translation Requests (with or without PASID) and Translated Requests
received and processed through this scalable-mode context-entry are
blocked."

Thanks,

Jacob

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
@ 2022-05-16 22:58       ` Jacob Pan
  0 siblings, 0 replies; 44+ messages in thread
From: Jacob Pan @ 2022-05-16 22:58 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Will Deacon,
	Christoph Hellwig, Ashok Raj, Ingo Molnar, Kevin Tian,
	Dave Hansen, Jani Nikula, Ning Sun, Borislav Petkov,
	Rodrigo Vivi, Thomas Gleixner, Tvrtko Ursulin, linux-kernel,
	iommu, Daniel Vetter, Paolo Bonzini, Robin Murphy

Hi Jason,

On Mon, 16 May 2022 15:06:28 -0300, Jason Gunthorpe <jgg@nvidia.com> wrote:

> Unrelated, but when we are in the special secure IOMMU modes, do we
> force ATS off? Specifically does the IOMMU reject TLPs that are marked
> as translated?
Yes, VT-d context entry has a Device TLB Enable bit, if 0, it means
"Translation Requests (with or without PASID) and Translated Requests
received and processed through this scalable-mode context-entry are
blocked."

Thanks,

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

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
  2022-05-16 18:06     ` Jason Gunthorpe via iommu
@ 2022-05-17  2:05       ` Baolu Lu
  -1 siblings, 0 replies; 44+ messages in thread
From: Baolu Lu @ 2022-05-17  2:05 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: baolu.lu, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, Paolo Bonzini, David Airlie,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	Daniel Vetter, Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan,
	Ning Sun, Will Deacon, Robin Murphy, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel

Hi Jason,

On 2022/5/17 02:06, Jason Gunthorpe wrote:
>> +static __init int tboot_force_iommu(void)
>> +{
>> +	if (!tboot_enabled())
>> +		return 0;
>> +
>> +	if (no_iommu || dmar_disabled)
>> +		pr_warn("Forcing Intel-IOMMU to enabled\n");
> Unrelated, but when we are in the special secure IOMMU modes, do we
> force ATS off? Specifically does the IOMMU reject TLPs that are marked
> as translated?

Good question. From IOMMU point of view, I don't see a point to force
ATS off, but trust boot involves lots of other things that I am not
familiar with. Anybody else could help to answer?

Best regards,
baolu

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
@ 2022-05-17  2:05       ` Baolu Lu
  0 siblings, 0 replies; 44+ messages in thread
From: Baolu Lu @ 2022-05-17  2:05 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

Hi Jason,

On 2022/5/17 02:06, Jason Gunthorpe wrote:
>> +static __init int tboot_force_iommu(void)
>> +{
>> +	if (!tboot_enabled())
>> +		return 0;
>> +
>> +	if (no_iommu || dmar_disabled)
>> +		pr_warn("Forcing Intel-IOMMU to enabled\n");
> Unrelated, but when we are in the special secure IOMMU modes, do we
> force ATS off? Specifically does the IOMMU reject TLPs that are marked
> as translated?

Good question. From IOMMU point of view, I don't see a point to force
ATS off, but trust boot involves lots of other things that I am not
familiar with. Anybody else could help to answer?

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

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
  2022-05-17  2:05       ` Baolu Lu
@ 2022-05-17 11:13         ` Jason Gunthorpe via iommu
  -1 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe @ 2022-05-17 11:13 UTC (permalink / raw)
  To: Baolu Lu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Christoph Hellwig, Steve Wahl, iommu,
	linux-kernel

On Tue, May 17, 2022 at 10:05:43AM +0800, Baolu Lu wrote:
> Hi Jason,
> 
> On 2022/5/17 02:06, Jason Gunthorpe wrote:
> > > +static __init int tboot_force_iommu(void)
> > > +{
> > > +	if (!tboot_enabled())
> > > +		return 0;
> > > +
> > > +	if (no_iommu || dmar_disabled)
> > > +		pr_warn("Forcing Intel-IOMMU to enabled\n");
> > Unrelated, but when we are in the special secure IOMMU modes, do we
> > force ATS off? Specifically does the IOMMU reject TLPs that are marked
> > as translated?
> 
> Good question. From IOMMU point of view, I don't see a point to force
> ATS off, but trust boot involves lots of other things that I am not
> familiar with. Anybody else could help to answer?

ATS is inherently not secure, if a rouge device can issue a TLP with
the translated bit set then it has unlimited access to host memory.

Many of these trusted iommu scenarios rely on the idea that a rouge
device cannot DMA to arbitary system memory.

Jason

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
@ 2022-05-17 11:13         ` Jason Gunthorpe via iommu
  0 siblings, 0 replies; 44+ messages in thread
From: Jason Gunthorpe via iommu @ 2022-05-17 11:13 UTC (permalink / raw)
  To: Baolu Lu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On Tue, May 17, 2022 at 10:05:43AM +0800, Baolu Lu wrote:
> Hi Jason,
> 
> On 2022/5/17 02:06, Jason Gunthorpe wrote:
> > > +static __init int tboot_force_iommu(void)
> > > +{
> > > +	if (!tboot_enabled())
> > > +		return 0;
> > > +
> > > +	if (no_iommu || dmar_disabled)
> > > +		pr_warn("Forcing Intel-IOMMU to enabled\n");
> > Unrelated, but when we are in the special secure IOMMU modes, do we
> > force ATS off? Specifically does the IOMMU reject TLPs that are marked
> > as translated?
> 
> Good question. From IOMMU point of view, I don't see a point to force
> ATS off, but trust boot involves lots of other things that I am not
> familiar with. Anybody else could help to answer?

ATS is inherently not secure, if a rouge device can issue a TLP with
the translated bit set then it has unlimited access to host memory.

Many of these trusted iommu scenarios rely on the idea that a rouge
device cannot DMA to arbitary system memory.

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

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
  2022-05-17 11:13         ` Jason Gunthorpe via iommu
@ 2022-05-18  7:38           ` Baolu Lu
  -1 siblings, 0 replies; 44+ messages in thread
From: Baolu Lu @ 2022-05-18  7:38 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: baolu.lu, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, Paolo Bonzini, David Airlie,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	Daniel Vetter, Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan,
	Ning Sun, Will Deacon, Robin Murphy, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel

On 2022/5/17 19:13, Jason Gunthorpe wrote:
> On Tue, May 17, 2022 at 10:05:43AM +0800, Baolu Lu wrote:
>> Hi Jason,
>>
>> On 2022/5/17 02:06, Jason Gunthorpe wrote:
>>>> +static __init int tboot_force_iommu(void)
>>>> +{
>>>> +	if (!tboot_enabled())
>>>> +		return 0;
>>>> +
>>>> +	if (no_iommu || dmar_disabled)
>>>> +		pr_warn("Forcing Intel-IOMMU to enabled\n");
>>> Unrelated, but when we are in the special secure IOMMU modes, do we
>>> force ATS off? Specifically does the IOMMU reject TLPs that are marked
>>> as translated?
>>
>> Good question. From IOMMU point of view, I don't see a point to force
>> ATS off, but trust boot involves lots of other things that I am not
>> familiar with. Anybody else could help to answer?
> 
> ATS is inherently not secure, if a rouge device can issue a TLP with
> the translated bit set then it has unlimited access to host memory.

Agreed. The current logic is that the platform lets the OS know such
devices through firmware (ACPI/DT) and OS sets the untrusted flag in
their device structures. The IOMMU subsystem will disable ATS on devices
with the untrusted flag set.

There is some discussion about allowing the supervisor users to set the
trust policy through the sysfs ABI, but I don't think this has happened
in upstream kernel.

> Many of these trusted iommu scenarios rely on the idea that a rouge
> device cannot DMA to arbitary system memory.

I am not sure whether tboot has the same requirement.

Best regards,
baolu

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

* Re: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU
@ 2022-05-18  7:38           ` Baolu Lu
  0 siblings, 0 replies; 44+ messages in thread
From: Baolu Lu @ 2022-05-18  7:38 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen, Rodrigo Vivi,
	Thomas Gleixner, Tvrtko Ursulin, linux-kernel, iommu,
	Daniel Vetter, Borislav Petkov, Robin Murphy

On 2022/5/17 19:13, Jason Gunthorpe wrote:
> On Tue, May 17, 2022 at 10:05:43AM +0800, Baolu Lu wrote:
>> Hi Jason,
>>
>> On 2022/5/17 02:06, Jason Gunthorpe wrote:
>>>> +static __init int tboot_force_iommu(void)
>>>> +{
>>>> +	if (!tboot_enabled())
>>>> +		return 0;
>>>> +
>>>> +	if (no_iommu || dmar_disabled)
>>>> +		pr_warn("Forcing Intel-IOMMU to enabled\n");
>>> Unrelated, but when we are in the special secure IOMMU modes, do we
>>> force ATS off? Specifically does the IOMMU reject TLPs that are marked
>>> as translated?
>>
>> Good question. From IOMMU point of view, I don't see a point to force
>> ATS off, but trust boot involves lots of other things that I am not
>> familiar with. Anybody else could help to answer?
> 
> ATS is inherently not secure, if a rouge device can issue a TLP with
> the translated bit set then it has unlimited access to host memory.

Agreed. The current logic is that the platform lets the OS know such
devices through firmware (ACPI/DT) and OS sets the untrusted flag in
their device structures. The IOMMU subsystem will disable ATS on devices
with the untrusted flag set.

There is some discussion about allowing the supervisor users to set the
trust policy through the sysfs ABI, but I don't think this has happened
in upstream kernel.

> Many of these trusted iommu scenarios rely on the idea that a rouge
> device cannot DMA to arbitary system memory.

I am not sure whether tboot has the same requirement.

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

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

* Re: [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private
  2022-05-14  1:43 ` Lu Baolu
@ 2022-05-18 18:41   ` Steve Wahl
  -1 siblings, 0 replies; 44+ messages in thread
From: Steve Wahl @ 2022-05-18 18:41 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Joerg Roedel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Paolo Bonzini, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Daniel Vetter,
	Kevin Tian, Ashok Raj, Liu Yi L, Jacob Pan, Ning Sun,
	Will Deacon, Robin Murphy, Jason Gunthorpe, Christoph Hellwig,
	Steve Wahl, iommu, linux-kernel

On Sat, May 14, 2022 at 09:43:15AM +0800, Lu Baolu wrote:
> Hi folks,
> 
> The include/linux/intel-iommu.h should be private to the Intel IOMMU
> driver. Other drivers or components should interact with the IOMMU
> drivers through the kAPIs provided by the iommu core.
> 
> This series cleanups all includes of intel-iommu.h outside of the Intel
> IOMMU driver and move this header from include/linux to
> drivers/iommu/intel/.
> 
> No functional changes intended. Please help to review and suggest.

I went through and examined the changes as well.  These changes make the
robots complaint against my patch go away, which is great by me!

Reviewed-by: Steve Wahl <steve.wahl@hpe.com>

-- 
Steve Wahl, Hewlett Packard Enterprise

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

* Re: [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private
@ 2022-05-18 18:41   ` Steve Wahl
  0 siblings, 0 replies; 44+ messages in thread
From: Steve Wahl @ 2022-05-18 18:41 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Steve Wahl, David Airlie, Joonas Lahtinen, Paolo Bonzini,
	Will Deacon, Christoph Hellwig, Ashok Raj, Ingo Molnar,
	Jason Gunthorpe, Kevin Tian, Jani Nikula, Ning Sun, Dave Hansen,
	Rodrigo Vivi, Thomas Gleixner, Tvrtko Ursulin, linux-kernel,
	iommu, Daniel Vetter, Borislav Petkov, Robin Murphy

On Sat, May 14, 2022 at 09:43:15AM +0800, Lu Baolu wrote:
> Hi folks,
> 
> The include/linux/intel-iommu.h should be private to the Intel IOMMU
> driver. Other drivers or components should interact with the IOMMU
> drivers through the kAPIs provided by the iommu core.
> 
> This series cleanups all includes of intel-iommu.h outside of the Intel
> IOMMU driver and move this header from include/linux to
> drivers/iommu/intel/.
> 
> No functional changes intended. Please help to review and suggest.

I went through and examined the changes as well.  These changes make the
robots complaint against my patch go away, which is great by me!

Reviewed-by: Steve Wahl <steve.wahl@hpe.com>

-- 
Steve Wahl, Hewlett Packard Enterprise
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2022-05-18 18:42 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-14  1:43 [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private Lu Baolu
2022-05-14  1:43 ` Lu Baolu
2022-05-14  1:43 ` [PATCH 1/7] iommu/vt-d: Move trace/events/intel_iommu.h under iommu Lu Baolu
2022-05-14  1:43   ` Lu Baolu
2022-05-16 18:04   ` Jason Gunthorpe
2022-05-16 18:04     ` Jason Gunthorpe via iommu
2022-05-14  1:43 ` [PATCH 2/7] agp/intel: Use per device iommu check Lu Baolu
2022-05-14  1:43   ` Lu Baolu
2022-05-16 18:04   ` Jason Gunthorpe
2022-05-16 18:04     ` Jason Gunthorpe via iommu
2022-05-14  1:43 ` [PATCH 3/7] iommu/vt-d: Remove unnecessary exported symbol Lu Baolu
2022-05-14  1:43   ` Lu Baolu
2022-05-16 18:04   ` Jason Gunthorpe
2022-05-16 18:04     ` Jason Gunthorpe via iommu
2022-05-14  1:43 ` [PATCH 4/7] drm/i915: Remove unnecessary include Lu Baolu
2022-05-14  1:43   ` Lu Baolu
2022-05-16  7:28   ` Jani Nikula
2022-05-16  7:28     ` Jani Nikula
2022-05-16 18:04   ` Jason Gunthorpe
2022-05-16 18:04     ` Jason Gunthorpe via iommu
2022-05-14  1:43 ` [PATCH 5/7] KVM: x86: " Lu Baolu
2022-05-14  1:43   ` Lu Baolu
2022-05-16 18:05   ` Jason Gunthorpe
2022-05-16 18:05     ` Jason Gunthorpe via iommu
2022-05-14  1:43 ` [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU Lu Baolu
2022-05-14  1:43   ` Lu Baolu
2022-05-16 18:06   ` Jason Gunthorpe
2022-05-16 18:06     ` Jason Gunthorpe via iommu
2022-05-16 22:58     ` Jacob Pan
2022-05-16 22:58       ` Jacob Pan
2022-05-17  2:05     ` Baolu Lu
2022-05-17  2:05       ` Baolu Lu
2022-05-17 11:13       ` Jason Gunthorpe
2022-05-17 11:13         ` Jason Gunthorpe via iommu
2022-05-18  7:38         ` Baolu Lu
2022-05-18  7:38           ` Baolu Lu
2022-05-14  1:43 ` [PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu Lu Baolu
2022-05-14  1:43   ` Lu Baolu
2022-05-16 18:06   ` Jason Gunthorpe
2022-05-16 18:06     ` Jason Gunthorpe via iommu
2022-05-16  5:54 ` [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private Christoph Hellwig
2022-05-16  5:54   ` Christoph Hellwig
2022-05-18 18:41 ` Steve Wahl
2022-05-18 18:41   ` Steve Wahl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.