Create a dedicated folder for iommu drivers, and move the base
iommu implementation over there.
Grouping the various iommu drivers in a single location will help
finding similar problems shared by different platforms, so they
could be solved once, in the iommu framework, instead of solved
differently (or duplicated) in each driver.
Signed-off-by: Ohad Ben-Cohen <redacted>
---
arch/arm/mach-msm/Kconfig | 3 ---
arch/x86/Kconfig | 5 ++---
drivers/Kconfig | 2 ++
drivers/Makefile | 1 +
drivers/base/Makefile | 1 -
drivers/iommu/Kconfig | 3 +++
drivers/iommu/Makefile | 1 +
drivers/{base => iommu}/iommu.c | 0
8 files changed, 9 insertions(+), 7 deletions(-)
create mode 100644 drivers/iommu/Kconfig
create mode 100644 drivers/iommu/Makefile
rename drivers/{base => iommu}/iommu.c (100%)
@@ -720,9 +721,6 @@ config SWIOTLBconfigIOMMU_HELPERdef_bool(CALGARY_IOMMU||GART_IOMMU||SWIOTLB||AMD_IOMMU)-configIOMMU_API-def_bool(AMD_IOMMU||DMAR)-configMAXSMPbool"Enable Maximum number of SMP Processors and NUMA Nodes"depends onX86_64&&SMP&&DEBUG_KERNEL&&EXPERIMENTAL
This should ease finding similarities with different platforms,
with the intention of solving problems once in a generic framework
which everyone can use.
Compile-tested on x86_64.
Signed-off-by: Ohad Ben-Cohen <redacted>
---
arch/x86/Kconfig | 28 ------------------------
arch/x86/kernel/Makefile | 2 +-
drivers/iommu/Kconfig | 28 ++++++++++++++++++++++++
drivers/iommu/Makefile | 1 +
{arch/x86/kernel => drivers/iommu}/amd_iommu.c | 0
5 files changed, 30 insertions(+), 29 deletions(-)
rename {arch/x86/kernel => drivers/iommu}/amd_iommu.c (100%)
@@ -680,34 +680,6 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULTCalgaryanyway,pass'iommu=calgary'onthekernelcommandline.Ifunsure,sayY.-configAMD_IOMMU-bool"AMD IOMMU support"-selectSWIOTLB-selectPCI_MSI-selectPCI_IOV-selectIOMMU_API-depends onX86_64&&PCI&&ACPI----help----WiththisoptionyoucanenablesupportforAMDIOMMUhardwarein-yoursystem.AnIOMMUisahardwarecomponentwhichprovides-remappingofDMAmemoryaccessesfromdevices.WithanAMDIOMMUyou-canisolatethetheDMAmemoryofdifferentdevicesandprotectthe-systemfrommisbehavingdevicedriversorhardware.--YoucanfindoutifyoursystemhasanAMDIOMMUifyoulookinto-yourBIOSforanoptiontoenableitorifyouhaveanIVRSACPI-table.--configAMD_IOMMU_STATS-bool"Export AMD IOMMU statistics to debugfs"-depends onAMD_IOMMU-selectDEBUG_FS----help----ThisoptionenablescodeintheAMDIOMMUdrivertocollectvarious-statisticsaboutwhatshappeninginthedriverandexportsthat-informationtouserspaceviadebugfs.-Ifunsure,sayN.-# need this always selected by IOMMU for the VIA workaroundconfigSWIOTLBdef_boolyifX86_64
diff --git a/arch/x86/kernel/amd_iommu.c b/drivers/iommu/amd_iommu.csimilarity index 100%rename from arch/x86/kernel/amd_iommu.crename to drivers/iommu/amd_iommu.c
--
1.7.1
This should ease finding similarities with different platforms,
with the intention of solving problems once in a generic framework
which everyone can use.
Note: to move intel-iommu.c, the declaration of pci_find_upstream_pcie_bridge()
has to move from drivers/pci/pci.h to include/linux/pci.h. This is handled
in this patch, too.
Compile-tested on x86_64.
Signed-off-by: Ohad Ben-Cohen <redacted>
---
arch/x86/Kconfig | 11 -----------
drivers/iommu/Kconfig | 11 +++++++++++
drivers/iommu/Makefile | 1 +
drivers/{pci => iommu}/intel-iommu.c | 1 -
drivers/pci/Makefile | 2 +-
drivers/pci/pci.h | 2 --
include/linux/pci.h | 11 +++++++++++
7 files changed, 24 insertions(+), 15 deletions(-)
rename drivers/{pci => iommu}/intel-iommu.c (99%)
diff --git a/drivers/pci/intel-iommu.c b/drivers/iommu/intel-iommu.csimilarity index 99%rename from drivers/pci/intel-iommu.crename to drivers/iommu/intel-iommu.cindex 59f17ac..fd7a055 100644--- a/drivers/pci/intel-iommu.c+++ b/drivers/iommu/intel-iommu.c
This should ease finding similarities with different platforms,
with the intention of solving problems once in a generic framework
which everyone can use.
Compile-tested for MSM8X60.
Signed-off-by: Ohad Ben-Cohen <redacted>
---
arch/arm/mach-msm/Kconfig | 12 ------------
arch/arm/mach-msm/Makefile | 2 +-
drivers/iommu/Kconfig | 11 +++++++++++
drivers/iommu/Makefile | 1 +
.../mach-msm/iommu.c => drivers/iommu/msm-iommu.c | 0
5 files changed, 13 insertions(+), 13 deletions(-)
rename arch/arm/mach-msm/iommu.c => drivers/iommu/msm-iommu.c (100%)
diff --git a/arch/arm/mach-msm/iommu.c b/drivers/iommu/msm-iommu.csimilarity index 100%rename from arch/arm/mach-msm/iommu.crename to drivers/iommu/msm-iommu.c
--
1.7.1
At least iova.o wants to go with it. That's one of the parts that is a
candidate for harmonisation across IOMMU implementations, either by
removing it or by having others use it too. It's how we allocate virtual
I/O address space.
I suspect the interrupt remapping support may well want to move with it
too. It's no more out-of-place in drivers/iommu than it is in
drivers/pci. And then you can certainly move dmar.o too.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse at intel.com Intel Corporation
(Cc'ing Ingo)
On Wed, Jun 08, 2011 at 04:34:18AM -0400, Ohad Ben-Cohen wrote:
Create a dedicated iommu drivers folder, put the base iommu code there,
and move the existing IOMMU API users as well (msm-iommu, amd_iommu and
intel-iommu).
Putting all iommu drivers together will ease finding similarities
between different platforms, with the intention of solving problems once,
in a generic framework, which everyone can use.
OMAP's iommu will be moved too as soon as it's migrated.
Great, thanks. I'll apply the patches as soon as the relevant ACKs come
in. Looking at the MAINTAINERS file David Brown needs to ACK the MSM
patch and David Woodhouse the VT-d patch.
David B., David W., is this direction ok for both of you?
A more important question is how we handle the IOMMU tree. Currently the
situation is as follows:
* The AMD IOMMU changes go upstream through Ingo
* David Woohouse has his own tree which he sents directly to
Linus
* Not sure about the ARM IOMMU code
* And to comlicate things further there is the upcoming ARM
integration tree which may contain code that depends on IOMMU
changes
My suggestion is that the ARM tree pulls in the necessary changes from
the IOMMU tree and the IOMMU code goes upstream through Ingo or directly
to Linus (with some time in linux-next, of course). Thoughts?
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
At least iova.o wants to go with it. That's one of the parts that is a
candidate for harmonisation across IOMMU implementations, either by
removing it or by having others use it too. It's how we allocate virtual
I/O address space.
I suspect the interrupt remapping support may well want to move with it
too. It's no more out-of-place in drivers/iommu than it is in
drivers/pci. And then you can certainly move dmar.o too.
Interrupt remapping certainly makes sense too. I am not sure yet how to
generalize it because the AMD version of it is significantly different
from VT-d, but we'll see.
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
On Wed, Jun 8, 2011 at 12:17 PM, David Woodhouse [off-list ref] wrote:
At least iova.o wants to go with it. That's one of the parts that is a
candidate for harmonisation across IOMMU implementations, either by
removing it or by having others use it too. It's how we allocate virtual
I/O address space.
I suspect the interrupt remapping support may well want to move with it
too. It's no more out-of-place in drivers/iommu than it is in
drivers/pci. And then you can certainly move dmar.o too.
Sounds good, thanks.
I'll wait a bit to see if there're more comments, and then re-send this one
From: Matthew Wilcox <hidden> Date: 2011-06-08 13:05:27
On Wed, Jun 08, 2011 at 11:34:18AM +0300, Ohad Ben-Cohen wrote:
Create a dedicated iommu drivers folder, put the base iommu code there,
and move the existing IOMMU API users as well (msm-iommu, amd_iommu and
intel-iommu).
Putting all iommu drivers together will ease finding similarities
between different platforms, with the intention of solving problems once,
in a generic framework, which everyone can use.
OMAP's iommu will be moved too as soon as it's migrated.
For previous discussions on this, please see:
https://lkml.org/lkml/2011/6/2/369
Ohad Ben-Cohen (4):
drivers: iommu: move to a dedicated folder
msm: iommu: move to drivers/iommu/
x86: amd_iommu: move to drivers/iommu/
x86: intel-iommu: move to drivers/iommu/
You've missed at least parisc, ia64, alpha, sparc, powerpc and sh which
have IOMMUs. Not that they necessarily all need to be moved across in
one patchset, but saying "all iommu drivers" is clearly false.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
On Wed, Jun 08, 2011 at 09:11:16AM -0400, Ohad Ben-Cohen wrote:
On Wed, Jun 8, 2011 at 4:05 PM, Matthew Wilcox [off-list ref] wrote:
quoted
You've missed at least parisc, ia64, alpha, sparc, powerpc and sh which
have IOMMUs.
None of these seem to call register_iommu.
quoted
Not that they necessarily all need to be moved across in
one patchset, but saying "all iommu drivers" is clearly false.
I've moved only the existing IOMMU API users.
And I think that is good for now. The iommu-api needs to be extended to
cover all kinds of iommus (like the iommus available on other
architectures). It is definitly the plan to do that and have a common
dma_ops implementation for all of them. But lets start small by now and
move forward step by step :-)
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
(Cc'ing Ingo)
On Wed, Jun 08, 2011 at 04:34:18AM -0400, Ohad Ben-Cohen wrote:
quoted
Create a dedicated iommu drivers folder, put the base iommu code there,
and move the existing IOMMU API users as well (msm-iommu, amd_iommu and
intel-iommu).
Putting all iommu drivers together will ease finding similarities
between different platforms, with the intention of solving problems once,
in a generic framework, which everyone can use.
OMAP's iommu will be moved too as soon as it's migrated.
Great, thanks. I'll apply the patches as soon as the relevant ACKs come
in. Looking at the MAINTAINERS file David Brown needs to ACK the MSM
patch and David Woodhouse the VT-d patch.
David B., David W., is this direction ok for both of you?
A more important question is how we handle the IOMMU tree. Currently the
situation is as follows:
* The AMD IOMMU changes go upstream through Ingo
* David Woohouse has his own tree which he sents directly to
Linus
* Not sure about the ARM IOMMU code
* And to comlicate things further there is the upcoming ARM
integration tree which may contain code that depends on IOMMU
changes
My suggestion is that the ARM tree pulls in the necessary changes from
the IOMMU tree and the IOMMU code goes upstream through Ingo or directly
to Linus (with some time in linux-next, of course). Thoughts?
I can certainly pull from you trees you pull from elsewhere.
David could help keep things tidier by sending the Intel IOMMU bits
to me as well.
In any case the tip:core/iommu tree is in linux-next so whatever you
send me shows up there on the next day or so.
Thanks,
Ingo