[PATCH v8 4/7] powernv/iommu: add support for IOMMU default DMA mode build options
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Jean-Philippe Brucker <jean-philippe.brucker@xxxxxxx>, John Garry <john.garry@xxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, Will Deacon <will.deacon@xxxxxxx>, Joerg Roedel <joro@xxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, linux-doc <linux-doc@xxxxxxxxxxxxxxx>, Sebastian Ott <sebott@xxxxxxxxxxxxx>, Gerald Schaefer <gerald.schaefer@xxxxxxxxxx>, "Martin Schwidefsky" <schwidefsky@xxxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, "Michael Ellerman" <mpe@xxxxxxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "H . Peter Anvin" <hpa@xxxxxxxxx>, David Woodhouse <dwmw2@xxxxxxxxxxxxx>, iommu <iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx>, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, linux-s390 <linux-s390@xxxxxxxxxxxxxxx>, linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, x86 <x86@xxxxxxxxxx>, linux-ia64 <linux-ia64@xxxxxxxxxxxxxxx>
- Subject: [PATCH v8 4/7] powernv/iommu: add support for IOMMU default DMA mode build options
- From: Zhen Lei <thunder.leizhen@xxxxxxxxxx>
- Date: Thu, 30 May 2019 11:48:28 +0800
- Cc: Zhen Lei <thunder.leizhen@xxxxxxxxxx>, Hanjun Guo <guohanjun@xxxxxxxxxx>
- In-reply-to: <20190530034831.4184-1-thunder.leizhen@huawei.com>
- References: <20190530034831.4184-1-thunder.leizhen@huawei.com>
The default DMA mode is PASSTHROUGH on powernv, this patch make it can be
set to STRICT at build time. It can be overridden by boot option.
There is no functional change.
Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx>
---
arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++-
drivers/iommu/Kconfig | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 126602b4e39972d..40208b9019be890 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -85,7 +85,8 @@ void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level,
va_end(args);
}
-static bool pnv_iommu_bypass_disabled __read_mostly;
+static bool pnv_iommu_bypass_disabled __read_mostly =
+ !IS_ENABLED(CONFIG_IOMMU_DEFAULT_PASSTHROUGH);
static bool pci_reset_phbs __read_mostly;
static int __init iommu_setup(char *str)
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 9b48c2fc20e14d3..b5af859956c4fda 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -78,6 +78,7 @@ config IOMMU_DEBUGFS
choice
prompt "IOMMU default DMA mode"
depends on IOMMU_API
+ default IOMMU_DEFAULT_PASSTHROUGH if (PPC_POWERNV && PCI)
default IOMMU_DEFAULT_LAZY if S390_IOMMU
default IOMMU_DEFAULT_STRICT
help
@@ -98,6 +99,7 @@ config IOMMU_DEFAULT_PASSTHROUGH
config IOMMU_DEFAULT_LAZY
bool "lazy"
+ depends on !PPC_POWERNV
help
Support lazy mode, where for every IOMMU DMA unmap operation, the
flush operation of IOTLB and the free operation of IOVA are deferred.
--
1.8.3
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]