2022-05-14 04:33:48

by Lu Baolu

[permalink] [raw]
Subject: [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private

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



2022-05-14 04:34:05

by Lu Baolu

[permalink] [raw]
Subject: [PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu

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

Signed-off-by: Lu Baolu <[email protected]>
---
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 <[email protected]>
*/

-#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: [email protected]
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


2022-05-16 11:12:46

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private

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 <[email protected]>

2022-05-17 03:26:21

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu

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 <[email protected]>
> ---
> 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 <[email protected]>

Jason

2022-05-18 18:44:17

by Steve Wahl

[permalink] [raw]
Subject: Re: [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private

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 <[email protected]>

--
Steve Wahl, Hewlett Packard Enterprise