centralize SWIOTLB config symbol and misc other cleanups
Subsystems (30)
Hi all,
this seris aims for a single defintion of the Kconfig symbol. To get there various cleanups, mostly about config symbols are included as well.
PATCH 1/12 iommu-common: move to arch/sparc
This code is only used by sparc, and all new iommu drivers should use the drivers/iommu/ framework. Also remove the unused exports.
---
{include/linux => arch/sparc/include/asm}/iommu-common.h | 0
arch/sparc/include/asm/iommu_64.h | 2 +-
arch/sparc/kernel/Makefile | 2 +-
{lib => arch/sparc/kernel}/iommu-common.c | 5 +----
arch/sparc/kernel/iommu.c | 2 +-
arch/sparc/kernel/ldc.c | 2 +-
arch/sparc/kernel/pci_sun4v.c | 2 +-
lib/Makefile | 2 +-
8 files changed, 7 insertions(+), 10 deletions(-)
rename {include/linux => arch/sparc/include/asm}/iommu-common.h (100%)
rename {lib => arch/sparc/kernel}/iommu-common.c (98%)arch/sparc/include/asm/iommu-common.h renamed from include/linux/iommu-common.h +0 -0
arch/sparc/include/asm/iommu_64.h +1 -1
@@ -17,7 +17,7 @@#define IOPTE_WRITE 0x0000000000000002UL#define IOMMU_NUM_CTXS 4096 -#include <linux/iommu-common.h> +#include <asm/iommu-common.h> struct iommu_arena {unsigned long *map;
arch/sparc/kernel/Makefile +1 -1
@@ -59,7 +59,7 @@ obj-$(CONFIG_SPARC32) += leon_pmc.o obj-$(CONFIG_SPARC64) += reboot.o obj-$(CONFIG_SPARC64) += sysfs.o -obj-$(CONFIG_SPARC64) += iommu.o +obj-$(CONFIG_SPARC64) += iommu.o iommu-common.o obj-$(CONFIG_SPARC64) += central.o obj-$(CONFIG_SPARC64) += starfire.o obj-$(CONFIG_SPARC64) += power.o
arch/sparc/kernel/iommu-common.c renamed from lib/iommu-common.c +1 -4
@@ -8,9 +8,9 @@#include <linux/bitmap.h> #include <linux/bug.h> #include <linux/iommu-helper.h> -#include <linux/iommu-common.h> #include <linux/dma-mapping.h> #include <linux/hash.h> +#include <asm/iommu-common.h> static unsigned long iommu_large_alloc =15 ;
@@ -93,7 +93,6 @@ void iommu_tbl_pool_init(struct iommu_map_table *iommu, p->hint = p->start; p->end = num_entries; } -EXPORT_SYMBOL (iommu_tbl_pool_init); unsigned long iommu_tbl_range_alloc(struct device *dev, struct iommu_map_table *iommu,
@@ -224,7 +223,6 @@ unsigned long iommu_tbl_range_alloc(struct device *dev,return n; } -EXPORT_SYMBOL (iommu_tbl_range_alloc);static struct iommu_pool *get_pool (struct iommu_map_table *tbl,unsigned long entry)
@@ -264,4 +262,3 @@ void iommu_tbl_range_free(struct iommu_map_table *iommu, u64 dma_addr,bitmap_clear (iommu->map, entry, npages);spin_unlock_irqrestore (&(pool->lock), flags); } -EXPORT_SYMBOL (iommu_tbl_range_free);
arch/sparc/kernel/iommu.c +1 -1
@@ -14,7 +14,7 @@#include <linux/errno.h> #include <linux/iommu-helper.h> #include <linux/bitmap.h> -#include <linux/iommu-common.h> +#include <asm/iommu-common.h> #ifdef CONFIG_PCI #include <linux/pci.h>
arch/sparc/kernel/ldc.c +1 -1
@@ -16,7 +16,7 @@#include <linux/list.h> #include <linux/init.h> #include <linux/bitmap.h> -#include <linux/iommu-common.h> +#include <asm/iommu-common.h> #include <asm/hypervisor.h> #include <asm/iommu.h>
arch/sparc/kernel/pci_sun4v.c +1 -1
@@ -16,7 +16,7 @@#include <linux/export.h> #include <linux/log2.h> #include <linux/of_device.h> -#include <linux/iommu-common.h> +#include <asm/iommu-common.h> #include <asm/iommu.h> #include <asm/irq.h>
lib/Makefile +1 -1
@@ -147,7 +147,7 @@ obj-$(CONFIG_AUDIT_GENERIC) += audit.o obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o obj-$(CONFIG_SWIOTLB) += swiotlb.o -obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o iommu-common.o +obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o obj-$(CONFIG_PM_NOTIFIER_ERROR_INJECT) += pm-notifier-error-inject.o
Signature · 1 line
2.17.0
Re: [PATCH 01/12] iommu-common: move to arch/sparc
Quoted 4 lines · Christoph Hellwig
This code is only used by sparc, and all new iommu drivers should use the
drivers/iommu/framework. Also remove the unused exports.Signed-off-by Christoph Hellwig <[email protected]>
Right, these functions are used only from SPARC architecture. Simple git grep confirms it as well. Hence it makes sense to move them into arch code instead.
git grep iommu_tbl_pool_init
----------------------------
arch/sparc/include/asm/iommu-common.h:extern void iommu_tbl_pool_init(struct iommu_map_table *iommu, arch/sparc/kernel/iommu-common.c:void iommu_tbl_pool_init(struct iommu_map_table *iommu,
arch/sparc/kernel/iommu.c: iommu_tbl_pool_init(&iommu->tbl, num_tsb_entries, IO_PAGE_SHIFT, arch/sparc/kernel/ldc.c: iommu_tbl_pool_init(iommu, num_tsb_entries, PAGE_SHIFT, arch/sparc/kernel/pci_sun4v.c: iommu_tbl_pool_init(&atu->tbl, num_iotte, IO_PAGE_SHIFT, arch/sparc/kernel/pci_sun4v.c: iommu_tbl_pool_init(&iommu->tbl, num_tsb_entries, IO_PAGE_SHIFT,
git grep iommu_tbl_range_alloc
------------------------------
arch/sparc/include/asm/iommu-common.h:extern unsigned long iommu_tbl_range_alloc(struct device *dev, arch/sparc/kernel/iommu-common.c:unsigned long iommu_tbl_range_alloc(struct device *dev,
arch/sparc/kernel/iommu.c: entry = iommu_tbl_range_alloc(dev, &iommu->tbl, npages, NULL, arch/sparc/kernel/iommu.c: entry = iommu_tbl_range_alloc(dev, &iommu->tbl, npages, arch/sparc/kernel/ldc.c: entry = iommu_tbl_range_alloc(NULL, &iommu->iommu_map_table, arch/sparc/kernel/pci_sun4v.c: entry = iommu_tbl_range_alloc(dev, tbl, npages, NULL, arch/sparc/kernel/pci_sun4v.c: entry = iommu_tbl_range_alloc(dev, tbl, npages, NULL, arch/sparc/kernel/pci_sun4v.c: entry = iommu_tbl_range_alloc(dev, tbl, npages,
git grep iommu_tbl_range_free
-----------------------------
arch/sparc/include/asm/iommu-common.h:extern void iommu_tbl_range_free(struct iommu_map_table *iommu, arch/sparc/kernel/iommu-common.c:void iommu_tbl_range_free(struct iommu_map_table *iommu, u64 dma_addr,
arch/sparc/kernel/iommu.c: iommu_tbl_range_free(&iommu->tbl, dvma, npages, IOMMU_ERROR_CODE); arch/sparc/kernel/iommu.c: iommu_tbl_range_free(&iommu->tbl, bus_addr, npages, IOMMU_ERROR_CODE); arch/sparc/kernel/iommu.c: iommu_tbl_range_free(&iommu->tbl, vaddr, npages, arch/sparc/kernel/iommu.c: iommu_tbl_range_free(&iommu->tbl, dma_handle, npages, arch/sparc/kernel/ldc.c: iommu_tbl_range_free(&iommu->iommu_map_table, cookie, npages, entry); arch/sparc/kernel/pci_sun4v.c: iommu_tbl_range_free(tbl, *dma_addrp, npages, IOMMU_ERROR_CODE); arch/sparc/kernel/pci_sun4v.c: iommu_tbl_range_free(tbl, dvma, npages, IOMMU_ERROR_CODE); arch/sparc/kernel/pci_sun4v.c: iommu_tbl_range_free(tbl, bus_addr, npages, IOMMU_ERROR_CODE); arch/sparc/kernel/pci_sun4v.c: iommu_tbl_range_free(tbl, bus_addr, npages, IOMMU_ERROR_CODE); arch/sparc/kernel/pci_sun4v.c: iommu_tbl_range_free(tbl, vaddr, npages, arch/sparc/kernel/pci_sun4v.c: iommu_tbl_range_free(tbl, dma_handle, npages,
David Miller
maintainerRe: [PATCH 01/12] iommu-common: move to arch/sparc
From: Anshuman Khandual <[email protected]>
Date: Mon, 16 Apr 2018 14:26:07 +0530
Quoted 9 lines · Christoph Hellwig
Quoted 4 lines
This code is only used by sparc, and all new iommu drivers should use the
drivers/iommu/framework. Also remove the unused exports.Signed-off-by Christoph Hellwig <[email protected]>Right, these functions are used only from SPARC architecture. Simple git grep confirms it as well. Hence it makes sense to move them into arch code instead.
Well, we put these into a common location and used type friendly for powerpc because we hoped powerpc would convert over to using this common piece of code as well.
But nobody did the powerpc work.
If you look at the powerpc iommu support, it's the same code basically for entry allocation.
Re: [PATCH 01/12] iommu-common: move to arch/sparc
Quoted 13 lines · David Miller
From: Anshuman Khandual <[email protected]>
Date: Mon, 16 Apr 2018 14:26:07 +0530Quoted 9 lines · Christoph Hellwig
Quoted 4 lines
This code is only used by sparc, and all new iommu drivers should use the
drivers/iommu/framework. Also remove the unused exports.Signed-off-by Christoph Hellwig <[email protected]>Right, these functions are used only from SPARC architecture. Simple git grep confirms it as well. Hence it makes sense to move them into arch code instead.
Quoted 8 lines
Well, we put these into a common location and used type friendly for powerpc because we hoped powerpc would convert over to using this common piece of code as well.
But nobody did the powerpc work.
If you look at the powerpc iommu support, it's the same code basically for entry allocation.
I understand. But there are some differences in iommu_table structure, how both regular and large IOMMU pools are being initialized etc. So if the movement of code into SPARC help cleaning up these generic config options in general, I guess we should do that. But I will leave it upto others who have more experience in this area.
+mpe
Michael Ellerman
reviewerRe: [PATCH 01/12] iommu-common: move to arch/sparc
Quoted 14 lines · Anshuman Khandual
Quoted 13 lines · David Miller
From: Anshuman Khandual <[email protected]>
Date: Mon, 16 Apr 2018 14:26:07 +0530Quoted 9 lines · Christoph Hellwig
Quoted 4 lines
This code is only used by sparc, and all new iommu drivers should use the
drivers/iommu/framework. Also remove the unused exports.Signed-off-by Christoph Hellwig <[email protected]>Right, these functions are used only from SPARC architecture. Simple git grep confirms it as well. Hence it makes sense to move them into arch code instead.
Quoted 5 lines
Quoted 5 lines
Well, we put these into a common location and used type friendly for powerpc because we hoped powerpc would convert over to using this common piece of code as well.
But nobody did the powerpc work.
Sorry.
Quoted 10 lines
Quoted 2 lines
If you look at the powerpc iommu support, it's the same code basically for entry allocation.
I understand. But there are some differences in
iommu_tablestructure, how both regular and large IOMMU pools are being initialized etc. So if the movement of code into SPARC help cleaning up these generic config options in general, I guess we should do that. But I will leave it upto others who have more experience in this area.+mpe
This is the first I've heard of it, I guess it's probably somewhere on Ben's append-only TODO list.
Some of the code does look very similar, but not 100%. So someone would need to do some work to reconcile the two and test the result. TBH I doubt we're going to get around to it any time soon. Unless we have a volunteer?
cheers
Re: [PATCH 01/12] iommu-common: move to arch/sparc
In reply to David MillerQuoted 13 lines · David Miller
From: Anshuman Khandual <[email protected]>
Date: Mon, 16 Apr 2018 14:26:07 +0530Quoted 9 lines · Christoph Hellwig
Quoted 4 lines
This code is only used by sparc, and all new iommu drivers should use the
drivers/iommu/framework. Also remove the unused exports.Signed-off-by Christoph Hellwig <[email protected]>Right, these functions are used only from SPARC architecture. Simple git grep confirms it as well. Hence it makes sense to move them into arch code instead.
Quoted 8 lines
Well, we put these into a common location and used type friendly for powerpc because we hoped powerpc would convert over to using this common piece of code as well.
But nobody did the powerpc work.
If you look at the powerpc iommu support, it's the same code basically for entry allocation.
I could also introduce a new config symbol and keep it in common code, but it has been there for a while without any new user.
Right now it just means we built the code for everyone who selects CONFIG_IOMMU_HELPER, which is just about anyone these days.
PATCH 2/12 iommu-helper: unexport iommu_area_alloc
In reply to Christoph HellwigThis function is only used by built-in code.
--- lib/iommu-helper.c | 2 -- 1 file changed, 2 deletions(-)
lib/iommu-helper.c +0 -2
@@ -3,7 +3,6 @@* IOMMU helper functions for the free area management */ -#include <linux/export.h> #include <linux/bitmap.h> #include <linux/bug.h>
@@ -38,4 +37,3 @@ unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, }return -1 ; } -EXPORT_SYMBOL (iommu_area_alloc);
Signature · 1 line
2.17.0
Re: [PATCH 02/12] iommu-helper: unexport iommu_area_alloc
Quoted 3 lines · Christoph Hellwig
This function is only used by built-in code.
Reviewed-by Christoph Hellwig <[email protected]>
Sam
Re: [PATCH 02/12] iommu-helper: unexport iommu_area_alloc
In reply to Christoph HellwigQuoted 3 lines · Christoph Hellwig
This function is only used by built-in code.
Reviewed-by Christoph Hellwig <[email protected]>
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 3/12 iommu-helper: mark iommu_is_span_boundary as inline
This avoids selecting IOMMU_HELPER just for this function. And we only use it once or twice in normal builds so this often even is a size reduction.
--- arch/alpha/Kconfig | 3 --- arch/arm/Kconfig | 3 --- arch/arm64/Kconfig | 3 --- arch/ia64/Kconfig | 3 --- arch/mips/cavium-octeon/Kconfig | 4 ---- arch/mips/loongson64/Kconfig | 4 ---- arch/mips/netlogic/Kconfig | 3 --- arch/powerpc/Kconfig | 1 - arch/unicore32/mm/Kconfig | 3 --- arch/x86/Kconfig | 2 +- drivers/parisc/Kconfig | 5 ----- include/linux/iommu-helper.h | 13 ++++++++++--- lib/iommu-helper.c | 12 +----------- 13 files changed, 12 insertions(+), 47 deletions(-)
arch/alpha/Kconfig +0 -3
@@ -345,9 +345,6 @@ config PCI_DOMAINS config PCI_SYSCALL def_bool PCI -config IOMMU_HELPER - def_bool PCI - config ALPHA_NONAME bool depends on ALPHA_BOOK1 || ALPHA_NONAME_CH
arch/arm/Kconfig +0 -3
@@ -1781,9 +1781,6 @@ config SECCOMP config SWIOTLB def_bool y -config IOMMU_HELPER - def_bool SWIOTLB - config PARAVIRT bool "Enable paravirtualization code" help
arch/arm64/Kconfig +0 -3
@@ -252,9 +252,6 @@ config SMP config SWIOTLB def_bool y -config IOMMU_HELPER - def_bool SWIOTLB - config KERNEL_MODE_NEON def_bool y
arch/ia64/Kconfig +0 -3
@@ -613,6 +613,3 @@ source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - -config IOMMU_HELPER - def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
arch/mips/cavium-octeon/Kconfig +0 -4
@@ -67,16 +67,12 @@ config CAVIUM_OCTEON_LOCK_L2_MEMCPY help Lock the kernel's implementation of memcpy() into L2. -config IOMMU_HELPER - bool - config NEED_SG_DMA_LENGTH bool config SWIOTLB def_bool y select DMA_DIRECT_OPS - select IOMMU_HELPER select NEED_SG_DMA_LENGTH config OCTEON_ILM
arch/mips/loongson64/Kconfig +0 -4
@@ -130,9 +130,6 @@ config LOONGSON_UART_BASE default y depends on EARLY_PRINTK || SERIAL_8250 -config IOMMU_HELPER - bool - config NEED_SG_DMA_LENGTH bool
@@ -141,7 +138,6 @@ config SWIOTLB default y depends on CPU_LOONGSON3 select DMA_DIRECT_OPS - select IOMMU_HELPER select NEED_SG_DMA_LENGTH select NEED_DMA_MAP_STATE
arch/mips/netlogic/Kconfig +0 -3
@@ -83,9 +83,6 @@ endif config NLM_COMMON bool -config IOMMU_HELPER - bool - config NEED_SG_DMA_LENGTH bool
arch/powerpc/Kconfig +0 -1
@@ -484,7 +484,6 @@ config IOMMU_HELPER config SWIOTLB bool "SWIOTLB support" default n - select IOMMU_HELPER ---help--- Support for IO bounce buffering for systems without an IOMMU. This allows us to DMA to the full physical address space on
arch/unicore32/mm/Kconfig +0 -3
@@ -44,9 +44,6 @@ config SWIOTLB def_bool y select DMA_DIRECT_OPS -config IOMMU_HELPER - def_bool SWIOTLB - config NEED_SG_DMA_LENGTH def_bool SWIOTLB
arch/x86/Kconfig +1 -1
@@ -930,7 +930,7 @@ config SWIOTLB config IOMMU_HELPER def_bool y - depends on CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU + depends on CALGARY_IOMMU || GART_IOMMU config MAXSMP bool "Enable Maximum number of SMP Processors and NUMA Nodes"
drivers/parisc/Kconfig +0 -5
@@ -103,11 +103,6 @@ config IOMMU_SBA depends on PCI_LBA default PCI_LBA -config IOMMU_HELPER - bool - depends on IOMMU_SBA || IOMMU_CCIO - default y - source "drivers/pcmcia/Kconfig" endmenu
include/linux/iommu-helper.h +10 -3
@@ -2,6 +2,7 @@#ifndef _LINUX_IOMMU_HELPER_H#define _LINUX_IOMMU_HELPER_H +#include <linux/bug.h> #include <linux/kernel.h> static inline unsigned long iommu_device_max_index(unsigned long size,
@@ -14,9 +15,15 @@ static inline unsigned long iommu_device_max_index(unsigned long size,return size; } -extern int iommu_is_span_boundary (unsigned int index,unsigned int nr, -unsigned long shift, -unsigned long boundary_size); +static inline int iommu_is_span_boundary (unsigned int index,unsigned int nr, +unsigned long shift,unsigned long boundary_size) +{ +BUG_ON (!is_power_of_2 (boundary_size)); + + shift = (shift + index) & (boundary_size -1 ); +return shift + nr > boundary_size; +} + extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, unsigned long start, unsigned int nr, unsigned long shift,
lib/iommu-helper.c +1 -11
@@ -4,17 +4,7 @@*/ #include <linux/bitmap.h> -#include <linux/bug.h> - -int iommu_is_span_boundary (unsigned int index,unsigned int nr, -unsigned long shift, -unsigned long boundary_size) -{ -BUG_ON (!is_power_of_2 (boundary_size)); - - shift = (shift + index) & (boundary_size -1 ); -return shift + nr > boundary_size; -} +#include <linux/iommu-helper.h> unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, unsigned long start, unsigned int nr,
Signature · 1 line
2.17.0
PATCH 4/12 iommu-helper: move the IOMMU_HELPER config symbol to lib/
In reply to Christoph HellwigThis way we have one central definition of it, and user can select it as needed.
--- arch/powerpc/Kconfig | 4 +--- arch/s390/Kconfig | 5 ++--- arch/sparc/Kconfig | 5 +---- arch/x86/Kconfig | 6 ++---- lib/Kconfig | 3 +++ 5 files changed, 9 insertions(+), 14 deletions(-)
arch/powerpc/Kconfig +1 -3
@@ -223,6 +223,7 @@ config PPC select HAVE_SYSCALL_TRACEPOINTS select HAVE_VIRT_CPU_ACCOUNTING select HAVE_IRQ_TIME_ACCOUNTING + select IOMMU_HELPER if PPC64 select IRQ_DOMAIN select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA
@@ -478,9 +479,6 @@ config MPROFILE_KERNEL depends on PPC64 && CPU_LITTLE_ENDIAN def_bool !DISABLE_MPROFILE_KERNEL -config IOMMU_HELPER - def_bool PPC64 - config SWIOTLB bool "SWIOTLB support" default n
arch/s390/Kconfig +2 -3
@@ -693,7 +693,9 @@ config QDIO menuconfig PCI bool "PCI support" select PCI_MSI + select IOMMU_HELPER select IOMMU_SUPPORT + help Enable PCI support.
@@ -717,9 +719,6 @@ config PCI_DOMAINS config HAS_IOMEM def_bool PCI -config IOMMU_HELPER - def_bool PCI - config NEED_SG_DMA_LENGTH def_bool PCI
arch/sparc/Kconfig +1 -4
@@ -67,6 +67,7 @@ config SPARC64 select HAVE_SYSCALL_TRACEPOINTS select HAVE_CONTEXT_TRACKING select HAVE_DEBUG_KMEMLEAK + select IOMMU_HELPER select SPARSE_IRQ select RTC_DRV_CMOS select RTC_DRV_BQ4802
@@ -106,10 +107,6 @@ config ARCH_DMA_ADDR_T_64BIT bool default y if ARCH_ATU -config IOMMU_HELPER - bool - default y if SPARC64 - config STACKTRACE_SUPPORT bool default y if SPARC64
arch/x86/Kconfig +2 -4
@@ -870,6 +870,7 @@ config DMI config GART_IOMMU bool "Old AMD GART IOMMU support" + select IOMMU_HELPER select SWIOTLB depends on X86_64 && PCI && AMD_NB ---help---
@@ -891,6 +892,7 @@ config GART_IOMMU config CALGARY_IOMMU bool "IBM Calgary IOMMU support" + select IOMMU_HELPER select SWIOTLB depends on X86_64 && PCI ---help---
@@ -928,10 +930,6 @@ config SWIOTLB with more than 3 GB of memory. If unsure, say Y. -config IOMMU_HELPER - def_bool y - depends on CALGARY_IOMMU || GART_IOMMU - config MAXSMP bool "Enable Maximum number of SMP Processors and NUMA Nodes" depends on X86_64 && SMP && DEBUG_KERNEL
lib/Kconfig +3 -0
@@ -429,6 +429,9 @@ config SGL_ALLOC bool default n +config IOMMU_HELPER + bool + config DMA_DIRECT_OPS bool depends on HAS_DMA && (!64BIT || ARCH_DMA_ADDR_T_64BIT)
Signature · 1 line
2.17.0
Re: [PATCH 04/12] iommu-helper: move the IOMMU_HELPER config symbol to lib/
Quoted 4 lines · Christoph Hellwig
This way we have one central definition of it, and user can select it as needed.
Signed-off-by Christoph Hellwig <[email protected]>
PATCH 5/12 scatterlist: move the NEED_SG_DMA_LENGTH config symbol to lib/Kconfig
In reply to Christoph HellwigThis way we have one central definition of it, and user can select it as needed.
--- arch/alpha/Kconfig | 4 +--- arch/arm/Kconfig | 3 --- arch/arm64/Kconfig | 4 +--- arch/hexagon/Kconfig | 4 +--- arch/ia64/Kconfig | 4 +--- arch/mips/cavium-octeon/Kconfig | 3 --- arch/mips/loongson64/Kconfig | 3 --- arch/mips/netlogic/Kconfig | 3 --- arch/parisc/Kconfig | 4 +--- arch/powerpc/Kconfig | 4 +--- arch/s390/Kconfig | 4 +--- arch/sh/Kconfig | 5 ++--- arch/sparc/Kconfig | 4 +--- arch/unicore32/mm/Kconfig | 5 +---- arch/x86/Kconfig | 4 +--- lib/Kconfig | 3 +++ 16 files changed, 15 insertions(+), 46 deletions(-)
arch/alpha/Kconfig +1 -3
@@ -10,6 +10,7 @@ config ALPHA select HAVE_OPROFILE select HAVE_PCSPKR_PLATFORM select HAVE_PERF_EVENTS + select NEED_SG_DMA_LENGTH select VIRT_TO_BUS select GENERIC_IRQ_PROBE select AUTO_IRQ_AFFINITY if SMP
@@ -70,9 +71,6 @@ config ARCH_DMA_ADDR_T_64BIT config NEED_DMA_MAP_STATE def_bool y -config NEED_SG_DMA_LENGTH - def_bool y - config GENERIC_ISA_DMA bool default y
arch/arm/Kconfig +0 -3
@@ -119,9 +119,6 @@ config ARM_HAS_SG_CHAIN select ARCH_HAS_SG_CHAIN bool -config NEED_SG_DMA_LENGTH - bool - config ARM_DMA_USE_IOMMU bool select ARM_HAS_SG_CHAIN
arch/arm64/Kconfig +1 -3
@@ -133,6 +133,7 @@ config ARM64 select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA select MULTI_IRQ_HANDLER + select NEED_SG_DMA_LENGTH select NO_BOOTMEM select OF select OF_EARLY_FLATTREE
@@ -243,9 +244,6 @@ config ARCH_DMA_ADDR_T_64BIT config NEED_DMA_MAP_STATE def_bool y -config NEED_SG_DMA_LENGTH - def_bool y - config SMP def_bool y
arch/hexagon/Kconfig +1 -3
@@ -19,6 +19,7 @@ config HEXAGON select GENERIC_IRQ_SHOW select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK + select NEED_SG_DMA_LENGTH select NO_IOPORT_MAP select GENERIC_IOMAP select GENERIC_SMP_IDLE_THREAD
@@ -63,9 +64,6 @@ config GENERIC_CSUM config GENERIC_IRQ_PROBE def_bool y -config NEED_SG_DMA_LENGTH - def_bool y - config RWSEM_GENERIC_SPINLOCK def_bool n
arch/ia64/Kconfig +1 -3
@@ -54,6 +54,7 @@ config IA64 select MODULES_USE_ELF_RELA select ARCH_USE_CMPXCHG_LOCKREF select HAVE_ARCH_AUDITSYSCALL + select NEED_SG_DMA_LENGTH default y help The Itanium Processor Family is Intel's 64-bit successor to
@@ -84,9 +85,6 @@ config ARCH_DMA_ADDR_T_64BIT config NEED_DMA_MAP_STATE def_bool y -config NEED_SG_DMA_LENGTH - def_bool y - config SWIOTLB bool
arch/mips/cavium-octeon/Kconfig +0 -3
@@ -67,9 +67,6 @@ config CAVIUM_OCTEON_LOCK_L2_MEMCPY help Lock the kernel's implementation of memcpy() into L2. -config NEED_SG_DMA_LENGTH - bool - config SWIOTLB def_bool y select DMA_DIRECT_OPS
arch/mips/loongson64/Kconfig +0 -3
@@ -130,9 +130,6 @@ config LOONGSON_UART_BASE default y depends on EARLY_PRINTK || SERIAL_8250 -config NEED_SG_DMA_LENGTH - bool - config SWIOTLB bool "Soft IOMMU Support for All-Memory DMA" default y
arch/mips/netlogic/Kconfig +0 -3
@@ -83,7 +83,4 @@ endif config NLM_COMMON bool -config NEED_SG_DMA_LENGTH - bool - endif
arch/parisc/Kconfig +1 -3
@@ -51,6 +51,7 @@ config PARISC select GENERIC_CLOCKEVENTS select ARCH_NO_COHERENT_DMA_MMAP select CPU_NO_EFFICIENT_FFS + select NEED_SG_DMA_LENGTH help The PA-RISC microprocessor is designed by Hewlett-Packard and used
@@ -114,9 +115,6 @@ config STACKTRACE_SUPPORT config NEED_DMA_MAP_STATE def_bool y -config NEED_SG_DMA_LENGTH - def_bool y - config ISA_DMA_API bool
arch/powerpc/Kconfig +1 -3
@@ -227,6 +227,7 @@ config PPC select IRQ_DOMAIN select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA + select NEED_SG_DMA_LENGTH select NO_BOOTMEM select OF select OF_EARLY_FLATTREE
@@ -907,9 +908,6 @@ config ZONE_DMA config NEED_DMA_MAP_STATE def_bool (PPC64 || NOT_COHERENT_CACHE) -config NEED_SG_DMA_LENGTH - def_bool y - config GENERIC_ISA_DMA bool depends on ISA_DMA_API
arch/s390/Kconfig +1 -3
@@ -695,6 +695,7 @@ menuconfig PCI select PCI_MSI select IOMMU_HELPER select IOMMU_SUPPORT + select NEED_SG_DMA_LENGTH help Enable PCI support.
@@ -719,9 +720,6 @@ config PCI_DOMAINS config HAS_IOMEM def_bool PCI -config NEED_SG_DMA_LENGTH - def_bool PCI - config NEED_DMA_MAP_STATE def_bool PCI
arch/sh/Kconfig +2 -3
@@ -50,6 +50,8 @@ config SUPERH select HAVE_ARCH_AUDITSYSCALL select HAVE_FUTEX_CMPXCHG if FUTEX select HAVE_NMI + select NEED_SG_DMA_LENGTH + help The SuperH is a RISC processor targeted for use in embedded systems and consumer electronics; it was also used in the Sega Dreamcast
@@ -163,9 +165,6 @@ config DMA_NONCOHERENT config NEED_DMA_MAP_STATE def_bool DMA_NONCOHERENT -config NEED_SG_DMA_LENGTH - def_bool y - config PGTABLE_LEVELS default 3 if X2TLB default 2
arch/sparc/Kconfig +1 -3
@@ -44,6 +44,7 @@ config SPARC select ARCH_HAS_SG_CHAIN select CPU_NO_EFFICIENT_FFS select LOCKDEP_SMALL if LOCKDEP + select NEED_SG_DMA_LENGTH config SPARC32 def_bool !64BIT
@@ -146,9 +147,6 @@ config ZONE_DMA config NEED_DMA_MAP_STATE def_bool y -config NEED_SG_DMA_LENGTH - def_bool y - config GENERIC_ISA_DMA bool default y if SPARC32
arch/unicore32/mm/Kconfig +1 -4
@@ -43,7 +43,4 @@ config CPU_TLB_SINGLE_ENTRY_DISABLE config SWIOTLB def_bool y select DMA_DIRECT_OPS - -config NEED_SG_DMA_LENGTH - def_bool SWIOTLB - + select NEED_SG_DMA_LENGTH
arch/x86/Kconfig +1 -3
@@ -182,6 +182,7 @@ config X86 select HAVE_UNSTABLE_SCHED_CLOCK select HAVE_USER_RETURN_NOTIFIER select IRQ_FORCED_THREADING + select NEED_SG_DMA_LENGTH select PCI_LOCKLESS_CONFIG select PERF_EVENTS select RTC_LIB
@@ -238,9 +239,6 @@ config NEED_DMA_MAP_STATE def_bool y depends on X86_64 || INTEL_IOMMU || DMA_API_DEBUG || SWIOTLB -config NEED_SG_DMA_LENGTH - def_bool y - config GENERIC_ISA_DMA def_bool y depends on ISA_DMA_API
lib/Kconfig +3 -0
@@ -429,6 +429,9 @@ config SGL_ALLOC bool default n +config NEED_SG_DMA_LENGTH + bool + config IOMMU_HELPER bool
Signature · 1 line
2.17.0
Re: [PATCH 05/12] scatterlist: move the NEED_SG_DMA_LENGTH config symbol to lib/Kconfig
Quoted 4 lines · Christoph Hellwig
This way we have one central definition of it, and user can select it as needed.
Signed-off-by Christoph Hellwig <[email protected]>
PATCH 6/12 dma-mapping: move the NEED_DMA_MAP_STATE config symbol to lib/Kconfig
In reply to Christoph HellwigThis way we have one central definition of it, and user can select it as needed. Note that we now also always select it when CONFIG_DMA_API_DEBUG is select, which fixes some incorrect checks in a few network drivers.
--- arch/alpha/Kconfig | 4 +--- arch/arm/Kconfig | 4 +--- arch/arm64/Kconfig | 4 +--- arch/ia64/Kconfig | 4 +--- arch/mips/Kconfig | 3 --- arch/parisc/Kconfig | 4 +--- arch/s390/Kconfig | 4 +--- arch/sh/Kconfig | 4 +--- arch/sparc/Kconfig | 4 +--- arch/unicore32/Kconfig | 4 +--- arch/x86/Kconfig | 6 ++---- drivers/iommu/Kconfig | 1 + include/linux/dma-mapping.h | 2 +- lib/Kconfig | 3 +++ lib/Kconfig.debug | 1 + 15 files changed, 17 insertions(+), 35 deletions(-)
arch/alpha/Kconfig +1 -3
@@ -10,6 +10,7 @@ config ALPHA select HAVE_OPROFILE select HAVE_PCSPKR_PLATFORM select HAVE_PERF_EVENTS + select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH select VIRT_TO_BUS select GENERIC_IRQ_PROBE
@@ -68,9 +69,6 @@ config ZONE_DMA config ARCH_DMA_ADDR_T_64BIT def_bool y -config NEED_DMA_MAP_STATE - def_bool y - config GENERIC_ISA_DMA bool default y
arch/arm/Kconfig +1 -3
@@ -96,6 +96,7 @@ config ARM select HAVE_VIRT_CPU_ACCOUNTING_GEN select IRQ_FORCED_THREADING select MODULES_USE_ELF_REL + select NEED_DMA_MAP_STATE select NO_BOOTMEM select OF_EARLY_FLATTREE if OF select OF_RESERVED_MEM if OF
@@ -221,9 +222,6 @@ config ARCH_MAY_HAVE_PC_FDC config ZONE_DMA bool -config NEED_DMA_MAP_STATE - def_bool y - config ARCH_SUPPORTS_UPROBES def_bool y
arch/arm64/Kconfig +1 -3
@@ -133,6 +133,7 @@ config ARM64 select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA select MULTI_IRQ_HANDLER + select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH select NO_BOOTMEM select OF
@@ -241,9 +242,6 @@ config HAVE_GENERIC_GUP config ARCH_DMA_ADDR_T_64BIT def_bool y -config NEED_DMA_MAP_STATE - def_bool y - config SMP def_bool y
arch/ia64/Kconfig +1 -3
@@ -54,6 +54,7 @@ config IA64 select MODULES_USE_ELF_RELA select ARCH_USE_CMPXCHG_LOCKREF select HAVE_ARCH_AUDITSYSCALL + select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH default y help
@@ -82,9 +83,6 @@ config MMU config ARCH_DMA_ADDR_T_64BIT def_bool y -config NEED_DMA_MAP_STATE - def_bool y - config SWIOTLB bool
arch/mips/Kconfig +0 -3
@@ -1122,9 +1122,6 @@ config DMA_NONCOHERENT bool select NEED_DMA_MAP_STATE -config NEED_DMA_MAP_STATE - bool - config SYS_HAS_EARLY_PRINTK bool
arch/parisc/Kconfig +1 -3
@@ -51,6 +51,7 @@ config PARISC select GENERIC_CLOCKEVENTS select ARCH_NO_COHERENT_DMA_MMAP select CPU_NO_EFFICIENT_FFS + select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH help
@@ -112,9 +113,6 @@ config PM config STACKTRACE_SUPPORT def_bool y -config NEED_DMA_MAP_STATE - def_bool y - config ISA_DMA_API bool
arch/s390/Kconfig +1 -3
@@ -695,6 +695,7 @@ menuconfig PCI select PCI_MSI select IOMMU_HELPER select IOMMU_SUPPORT + select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH help
@@ -720,9 +721,6 @@ config PCI_DOMAINS config HAS_IOMEM def_bool PCI -config NEED_DMA_MAP_STATE - def_bool PCI - config CHSC_SCH def_tristate m prompt "Support for CHSC subchannels"
arch/sh/Kconfig +1 -3
@@ -50,6 +50,7 @@ config SUPERH select HAVE_ARCH_AUDITSYSCALL select HAVE_FUTEX_CMPXCHG if FUTEX select HAVE_NMI + select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH help
@@ -162,9 +163,6 @@ config DMA_COHERENT config DMA_NONCOHERENT def_bool !DMA_COHERENT -config NEED_DMA_MAP_STATE - def_bool DMA_NONCOHERENT - config PGTABLE_LEVELS default 3 if X2TLB default 2
arch/sparc/Kconfig +1 -3
@@ -44,6 +44,7 @@ config SPARC select ARCH_HAS_SG_CHAIN select CPU_NO_EFFICIENT_FFS select LOCKDEP_SMALL if LOCKDEP + select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH config SPARC32
@@ -144,9 +145,6 @@ config ZONE_DMA bool default y if SPARC32 -config NEED_DMA_MAP_STATE - def_bool y - config GENERIC_ISA_DMA bool default y if SPARC32
arch/unicore32/Kconfig +1 -3
@@ -19,6 +19,7 @@ config UNICORE32 select ARCH_WANT_FRAME_POINTERS select GENERIC_IOMAP select MODULES_USE_ELF_REL + select NEED_DMA_MAP_STATE help UniCore-32 is 32-bit Instruction Set Architecture, including a series of low-power-consumption RISC chip
@@ -61,9 +62,6 @@ config ARCH_MAY_HAVE_PC_FDC config ZONE_DMA def_bool y -config NEED_DMA_MAP_STATE - def_bool y - source "init/Kconfig" source "kernel/Kconfig.freezer"
arch/x86/Kconfig +2 -4
@@ -28,6 +28,7 @@ config X86_64 select ARCH_USE_CMPXCHG_LOCKREF select HAVE_ARCH_SOFT_DIRTY select MODULES_USE_ELF_RELA + select NEED_DMA_MAP_STATE select X86_DEV_DMA_OPS #
@@ -235,10 +236,6 @@ config ARCH_MMAP_RND_COMPAT_BITS_MAX config SBUS bool -config NEED_DMA_MAP_STATE - def_bool y - depends on X86_64 || INTEL_IOMMU || DMA_API_DEBUG || SWIOTLB - config GENERIC_ISA_DMA def_bool y depends on ISA_DMA_API
@@ -921,6 +918,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT # need this always selected by IOMMU for the VIA workaround config SWIOTLB def_bool y if X86_64 + select NEED_DMA_MAP_STATE ---help--- Support for software bounce buffers used on x86-64 systems which don't have a hardware IOMMU. Using this PCI devices
drivers/iommu/Kconfig +1 -0
@@ -146,6 +146,7 @@ config INTEL_IOMMU select DMA_DIRECT_OPS select IOMMU_API select IOMMU_IOVA + select NEED_DMA_MAP_STATE select DMAR_TABLE help DMA remapping (DMAR) devices support enables independent address
include/linux/dma-mapping.h +1 -1
@@ -839,7 +839,7 @@ static inline int dma_mmap_wc(struct device *dev,#define dma_mmap_writecombine dma_mmap_wc#endif -#if defined(CONFIG_NEED_DMA_MAP_STATE ) || defined(CONFIG_DMA_API_DEBUG ) +#ifdef CONFIG_NEED_DMA_MAP_STATE #define DEFINE_DMA_UNMAP_ADDR (ADDR_NAME ) dma_addr_t ADDR_NAME#define DEFINE_DMA_UNMAP_LEN (LEN_NAME ) __u32 LEN_NAME#define dma_unmap_addr (PTR ,ADDR_NAME ) ((PTR)->ADDR_NAME)
lib/Kconfig +3 -0
@@ -432,6 +432,9 @@ config SGL_ALLOC config NEED_SG_DMA_LENGTH bool +config NEED_DMA_MAP_STATE + bool + config IOMMU_HELPER bool
lib/Kconfig.debug +1 -0
@@ -1635,6 +1635,7 @@ config PROVIDE_OHCI1394_DMA_INIT config DMA_API_DEBUG bool "Enable debugging of DMA-API usage" depends on HAVE_DMA_API_DEBUG + select NEED_DMA_MAP_STATE help Enable this option to debug the use of the DMA API by device drivers. With this option you will be able to detect common bugs in device
Signature · 1 line
2.17.0
Re: [PATCH 06/12] dma-mapping: move the NEED_DMA_MAP_STATE config symbol to lib/Kconfig
Quoted 5 lines · Christoph Hellwig
This way we have one central definition of it, and user can select it as needed. Note that we now also always select it when
CONFIG_DMA_API_DEBUGis select, which fixes some incorrect checks in a few network drivers.Signed-off-by Christoph Hellwig <[email protected]>
PATCH 7/12 arch: remove the ARCH_PHYS_ADDR_T_64BIT config symbol
In reply to Christoph HellwigInstead select the PHYS_ADDR_T_64BIT for 32-bit architectures that need a 64-bit phys_addr_t type directly.
--- arch/arc/Kconfig | 4 +--- arch/arm/kernel/setup.c | 2 +- arch/arm/mm/Kconfig | 4 +--- arch/arm64/Kconfig | 3 --- arch/mips/Kconfig | 15 ++++++--------- arch/powerpc/Kconfig | 5 +---- arch/powerpc/platforms/Kconfig.cputype | 1 + arch/riscv/Kconfig | 6 ++---- arch/x86/Kconfig | 5 +---- mm/Kconfig | 2 +- 10 files changed, 15 insertions(+), 32 deletions(-)
arch/arc/Kconfig +1 -3
@@ -453,13 +453,11 @@ config ARC_HAS_PAE40 default n depends on ISA_ARCV2 select HIGHMEM + select PHYS_ADDR_T_64BIT help Enable access to physical memory beyond 4G, only supported on ARC cores with 40 bit Physical Addressing support -config ARCH_PHYS_ADDR_T_64BIT - def_bool ARC_HAS_PAE40 - config ARCH_DMA_ADDR_T_64BIT bool
arch/arm/kernel/setup.c +1 -1
@@ -754,7 +754,7 @@ int __init arm_add_memory(u64 start, u64 size)else size -= aligned_start - start; -#ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT +#ifndef CONFIG_PHYS_ADDR_T_64BIT if (aligned_start >ULONG_MAX ) {pr_crit ("Ignoring memory at 0x%08llx outside 32-bit physical address space\n" , (long long )start);
arch/arm/mm/Kconfig +1 -3
@@ -661,6 +661,7 @@ config ARM_LPAE bool "Support for the Large Physical Address Extension" depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \ !CPU_32v4 && !CPU_32v3 + select PHYS_ADDR_T_64BIT help Say Y if you have an ARMv7 processor supporting the LPAE page table format and you would like to access memory beyond the
@@ -673,9 +674,6 @@ config ARM_PV_FIXUP def_bool y depends on ARM_LPAE && ARM_PATCH_PHYS_VIRT && ARCH_KEYSTONE -config ARCH_PHYS_ADDR_T_64BIT - def_bool ARM_LPAE - config ARCH_DMA_ADDR_T_64BIT bool
arch/arm64/Kconfig +0 -3
@@ -152,9 +152,6 @@ config ARM64 config 64BIT def_bool y -config ARCH_PHYS_ADDR_T_64BIT - def_bool y - config MMU def_bool y
arch/mips/Kconfig +6 -9
@@ -132,7 +132,7 @@ config MIPS_GENERIC config MIPS_ALCHEMY bool "Alchemy processor based machines" - select ARCH_PHYS_ADDR_T_64BIT + select PHYS_ADDR_T_64BIT select CEVT_R4K select CSRC_R4K select IRQ_MIPS_CPU
@@ -890,7 +890,7 @@ config CAVIUM_OCTEON_SOC bool "Cavium Networks Octeon SoC based boards" select CEVT_R4K select ARCH_HAS_PHYS_TO_DMA - select ARCH_PHYS_ADDR_T_64BIT + select PHYS_ADDR_T_64BIT select DMA_COHERENT select SYS_SUPPORTS_64BIT_KERNEL select SYS_SUPPORTS_BIG_ENDIAN
@@ -936,7 +936,7 @@ config NLM_XLR_BOARD select SWAP_IO_SPACE select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL - select ARCH_PHYS_ADDR_T_64BIT + select PHYS_ADDR_T_64BIT select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_HIGHMEM select DMA_COHERENT
@@ -962,7 +962,7 @@ config NLM_XLP_BOARD select HW_HAS_PCI select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL - select ARCH_PHYS_ADDR_T_64BIT + select PHYS_ADDR_T_64BIT select GPIOLIB select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_LITTLE_ENDIAN
@@ -1102,7 +1102,7 @@ config FW_CFE bool config ARCH_DMA_ADDR_T_64BIT - def_bool (HIGHMEM && ARCH_PHYS_ADDR_T_64BIT) || 64BIT + def_bool (HIGHMEM && PHYS_ADDR_T_64BIT) || 64BIT config ARCH_SUPPORTS_UPROBES bool
@@ -1767,7 +1767,7 @@ config CPU_MIPS32_R5_XPA depends on SYS_SUPPORTS_HIGHMEM select XPA select HIGHMEM - select ARCH_PHYS_ADDR_T_64BIT + select PHYS_ADDR_T_64BIT default n help Choose this option if you want to enable the Extended Physical
@@ -2399,9 +2399,6 @@ config SB1_PASS_2_1_WORKAROUNDS default y -config ARCH_PHYS_ADDR_T_64BIT - bool - choice prompt "SmartMIPS or microMIPS ASE support"
arch/powerpc/Kconfig +1 -4
@@ -13,11 +13,8 @@ config 64BIT bool default y if PPC64 -config ARCH_PHYS_ADDR_T_64BIT - def_bool PPC64 || PHYS_64BIT - config ARCH_DMA_ADDR_T_64BIT - def_bool ARCH_PHYS_ADDR_T_64BIT + def_bool PHYS_ADDR_T_64BIT config MMU bool
arch/powerpc/platforms/Kconfig.cputype +1 -0
@@ -222,6 +222,7 @@ config PTE_64BIT config PHYS_64BIT bool 'Large physical address support' if E500 || PPC_86xx depends on (44x || E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx + select PHYS_ADDR_T_64BIT ---help--- This option enables kernel support for larger than 32-bit physical addresses. This feature may not be available on all cores.
arch/riscv/Kconfig +2 -4
@@ -5,6 +5,8 @@ config RISCV def_bool y + # even on 32-bit, physical (and DMA) addresses are > 32-bits + select PHYS_ADDR_T_64BIT select OF select OF_EARLY_FLATTREE select OF_IRQ
@@ -38,10 +40,6 @@ config RISCV config MMU def_bool y -# even on 32-bit, physical (and DMA) addresses are > 32-bits -config ARCH_PHYS_ADDR_T_64BIT - def_bool y - config ZONE_DMA32 bool default y
arch/x86/Kconfig +1 -4
@@ -1447,6 +1447,7 @@ config HIGHMEM config X86_PAE bool "PAE (Physical Address Extension) Support" depends on X86_32 && !HIGHMEM4G + select PHYS_ADDR_T_64BIT select SWIOTLB ---help--- PAE is required for NX support, and furthermore enables
@@ -1474,10 +1475,6 @@ config X86_5LEVEL Say N if unsure. -config ARCH_PHYS_ADDR_T_64BIT - def_bool y - depends on X86_64 || X86_PAE - config ARCH_DMA_ADDR_T_64BIT def_bool y depends on X86_64 || HIGHMEM64G
mm/Kconfig +1 -1
@@ -266,7 +266,7 @@ config ARCH_ENABLE_THP_MIGRATION bool config PHYS_ADDR_T_64BIT - def_bool 64BIT || ARCH_PHYS_ADDR_T_64BIT + def_bool 64BIT config BOUNCE bool "Enable bounce buffers"
Signature · 1 line
2.17.0
PATCH 8/12 arch: define the ARCH_DMA_ADDR_T_64BIT config symbol in lib/Kconfig
In reply to Christoph HellwigDefine this symbol if the architecture either uses 64-bit pointers or the PHYS_ADDR_T_64BIT is set. This covers 95% of the old arch magic. We only need an additional select for Xen on ARM (why anyway?), and we now always set ARCH_DMA_ADDR_T_64BIT on mips boards with 64-bit physical addressing instead of only doing it when highmem is set.
--- arch/alpha/Kconfig | 3 --- arch/arc/Kconfig | 3 --- arch/arm/mach-axxia/Kconfig | 1 - arch/arm/mach-bcm/Kconfig | 1 - arch/arm/mach-exynos/Kconfig | 1 - arch/arm/mach-highbank/Kconfig | 1 - arch/arm/mach-rockchip/Kconfig | 1 - arch/arm/mach-shmobile/Kconfig | 1 - arch/arm/mach-tegra/Kconfig | 1 - arch/arm/mm/Kconfig | 3 --- arch/arm64/Kconfig | 3 --- arch/ia64/Kconfig | 3 --- arch/mips/Kconfig | 3 --- arch/powerpc/Kconfig | 3 --- arch/riscv/Kconfig | 3 --- arch/s390/Kconfig | 3 --- arch/sparc/Kconfig | 4 ---- arch/x86/Kconfig | 4 ---- lib/Kconfig | 3 +++ 19 files changed, 3 insertions(+), 42 deletions(-)
arch/alpha/Kconfig +0 -3
@@ -66,9 +66,6 @@ config ZONE_DMA bool default y -config ARCH_DMA_ADDR_T_64BIT - def_bool y - config GENERIC_ISA_DMA bool default y
arch/arc/Kconfig +0 -3
@@ -458,9 +458,6 @@ config ARC_HAS_PAE40 Enable access to physical memory beyond 4G, only supported on ARC cores with 40 bit Physical Addressing support -config ARCH_DMA_ADDR_T_64BIT - bool - config ARC_KVADDR_SIZE int "Kernel Virtual Address Space size (MB)" range 0 512
arch/arm/mach-axxia/Kconfig +0 -1
@@ -2,7 +2,6 @@ config ARCH_AXXIA bool "LSI Axxia platforms" depends on ARCH_MULTI_V7 && ARM_LPAE - select ARCH_DMA_ADDR_T_64BIT select ARM_AMBA select ARM_GIC select ARM_TIMER_SP804
arch/arm/mach-bcm/Kconfig +0 -1
@@ -211,7 +211,6 @@ config ARCH_BRCMSTB select BRCMSTB_L2_IRQ select BCM7120_L2_IRQ select ARCH_HAS_HOLES_MEMORYMODEL - select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE select ZONE_DMA if ARM_LPAE select SOC_BRCMSTB select SOC_BUS
arch/arm/mach-exynos/Kconfig +0 -1
@@ -112,7 +112,6 @@ config SOC_EXYNOS5440 bool "SAMSUNG EXYNOS5440" default y depends on ARCH_EXYNOS5 - select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE select HAVE_ARM_ARCH_TIMER select AUTO_ZRELADDR select PINCTRL_EXYNOS5440
arch/arm/mach-highbank/Kconfig +0 -1
@@ -1,7 +1,6 @@ config ARCH_HIGHBANK bool "Calxeda ECX-1000/2000 (Highbank/Midway)" depends on ARCH_MULTI_V7 - select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE select ARCH_HAS_HOLES_MEMORYMODEL select ARCH_SUPPORTS_BIG_ENDIAN select ARM_AMBA
arch/arm/mach-rockchip/Kconfig +0 -1
@@ -3,7 +3,6 @@ config ARCH_ROCKCHIP depends on ARCH_MULTI_V7 select PINCTRL select PINCTRL_ROCKCHIP - select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE select ARCH_HAS_RESET_CONTROLLER select ARM_AMBA select ARM_GIC
arch/arm/mach-shmobile/Kconfig +0 -1
@@ -29,7 +29,6 @@ config ARCH_RMOBILE menuconfig ARCH_RENESAS bool "Renesas ARM SoCs" depends on ARCH_MULTI_V7 && MMU - select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE select ARCH_SHMOBILE select ARM_GIC select GPIOLIB
arch/arm/mach-tegra/Kconfig +0 -1
@@ -15,6 +15,5 @@ menuconfig ARCH_TEGRA select RESET_CONTROLLER select SOC_BUS select ZONE_DMA if ARM_LPAE - select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE help This enables support for NVIDIA Tegra based systems.
arch/arm/mm/Kconfig +0 -3
@@ -674,9 +674,6 @@ config ARM_PV_FIXUP def_bool y depends on ARM_LPAE && ARM_PATCH_PHYS_VIRT && ARCH_KEYSTONE -config ARCH_DMA_ADDR_T_64BIT - bool - config ARM_THUMB bool "Support Thumb user binaries" if !CPU_THUMBONLY && EXPERT depends on CPU_THUMB_CAPABLE
arch/arm64/Kconfig +0 -3
@@ -236,9 +236,6 @@ config ZONE_DMA32 config HAVE_GENERIC_GUP def_bool y -config ARCH_DMA_ADDR_T_64BIT - def_bool y - config SMP def_bool y
arch/ia64/Kconfig +0 -3
@@ -80,9 +80,6 @@ config MMU bool default y -config ARCH_DMA_ADDR_T_64BIT - def_bool y - config SWIOTLB bool
arch/mips/Kconfig +0 -3
@@ -1101,9 +1101,6 @@ config GPIO_TXX9 config FW_CFE bool -config ARCH_DMA_ADDR_T_64BIT - def_bool (HIGHMEM && PHYS_ADDR_T_64BIT) || 64BIT - config ARCH_SUPPORTS_UPROBES bool
arch/powerpc/Kconfig +0 -3
@@ -13,9 +13,6 @@ config 64BIT bool default y if PPC64 -config ARCH_DMA_ADDR_T_64BIT - def_bool PHYS_ADDR_T_64BIT - config MMU bool default y
arch/riscv/Kconfig +0 -3
@@ -44,9 +44,6 @@ config ZONE_DMA32 bool default y -config ARCH_DMA_ADDR_T_64BIT - def_bool y - config PAGE_OFFSET hex default 0xC0000000 if 32BIT && MAXPHYSMEM_2GB
arch/s390/Kconfig +0 -3
@@ -35,9 +35,6 @@ config GENERIC_BUG config GENERIC_BUG_RELATIVE_POINTERS def_bool y -config ARCH_DMA_ADDR_T_64BIT - def_bool y - config GENERIC_LOCKBREAK def_bool y if SMP && PREEMPT
arch/sparc/Kconfig +0 -4
@@ -105,10 +105,6 @@ config ARCH_ATU bool default y if SPARC64 -config ARCH_DMA_ADDR_T_64BIT - bool - default y if ARCH_ATU - config STACKTRACE_SUPPORT bool default y if SPARC64
arch/x86/Kconfig +0 -4
@@ -1475,10 +1475,6 @@ config X86_5LEVEL Say N if unsure. -config ARCH_DMA_ADDR_T_64BIT - def_bool y - depends on X86_64 || HIGHMEM64G - config X86_DIRECT_GBPAGES def_bool y depends on X86_64 && !DEBUG_PAGEALLOC
lib/Kconfig +3 -0
@@ -435,6 +435,9 @@ config NEED_SG_DMA_LENGTH config NEED_DMA_MAP_STATE bool +config ARCH_DMA_ADDR_T_64BIT + def_bool 64BIT || PHYS_ADDR_T_64BIT + config IOMMU_HELPER bool
Signature · 1 line
2.17.0
PATCH 9/12 PCI: remove CONFIG_PCI_BUS_ADDR_T_64BIT
In reply to Christoph HellwigThis symbol is now always identical to CONFIG_ARCH_DMA_ADDR_T_64BIT, so remove it.
--- drivers/pci/Kconfig | 4 ---- drivers/pci/bus.c | 4 ++-- include/linux/pci.h | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-)
drivers/pci/Kconfig +0 -4
@@ -5,10 +5,6 @@ source "drivers/pci/pcie/Kconfig" -config PCI_BUS_ADDR_T_64BIT - def_bool y if (ARCH_DMA_ADDR_T_64BIT || 64BIT) - depends on PCI - config PCI_MSI bool "Message Signaled Interrupts (MSI and MSI-X)" depends on PCI
drivers/pci/bus.c +2 -2
@@ -120,7 +120,7 @@ int devm_request_pci_bus_resources(struct device *dev,EXPORT_SYMBOL_GPL (devm_request_pci_bus_resources);static struct pci_bus_region pci_32_bit = {0 ,0xffffffffULL }; -#ifdef CONFIG_PCI_BUS_ADDR_T_64BIT +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT static struct pci_bus_region pci_64_bit = {0 , (pci_bus_addr_t )0xffffffffffffffffULL }; static struct pci_bus_region pci_high = {(pci_bus_addr_t) 0x100000000ULL,
@@ -230,7 +230,7 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, resource_size_t), void *alignf_data) { -#ifdef CONFIG_PCI_BUS_ADDR_T_64BIT +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT int rc;if (res->flags &IORESOURCE_MEM_64 ) {
include/linux/pci.h +1 -1
@@ -670,7 +670,7 @@ int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,int raw_pci_write (unsigned int domain,unsigned int bus,unsigned int devfn,int reg,int len,u32 val); -#ifdef CONFIG_PCI_BUS_ADDR_T_64BIT +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT typedef u64 pci_bus_addr_t ;#else typedef u32 pci_bus_addr_t ;
Signature · 1 line
2.17.0
Re: [PATCH 09/12] PCI: remove CONFIG_PCI_BUS_ADDR_T_64BIT
Quoted 4 lines · Christoph Hellwig
This symbol is now always identical to
CONFIG_ARCH_DMA_ADDR_T_64BIT, so remove it.Signed-off-by Christoph Hellwig <[email protected]>
Please merge this along with the rest of the series; let me know if you need anything more from me.
Quoted 59 lines
--- drivers/pci/Kconfig | 4 ---- drivers/pci/bus.c | 4 ++-- include/linux/pci.h | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-)drivers/pci/Kconfig +0
-4@@ -5,10 +5,6 @@ source "drivers/pci/pcie/Kconfig" -config PCI_BUS_ADDR_T_64BIT - def_bool y if (ARCH_DMA_ADDR_T_64BIT || 64BIT) - depends on PCI - config PCI_MSI bool "Message Signaled Interrupts (MSI and MSI-X)" depends on PCIdrivers/pci/bus.c +2
-2@@ -120,7 +120,7 @@ int devm_request_pci_bus_resources(struct device *dev,EXPORT_SYMBOL_GPL (devm_request_pci_bus_resources);static struct pci_bus_region pci_32_bit = {0 ,0xffffffffULL }; -#ifdef CONFIG_PCI_BUS_ADDR_T_64BIT +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT static struct pci_bus_region pci_64_bit = {0 , (pci_bus_addr_t )0xffffffffffffffffULL }; static struct pci_bus_region pci_high = {(pci_bus_addr_t) 0x100000000ULL,@@ -230,7 +230,7 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, resource_size_t), void *alignf_data) { -#ifdef CONFIG_PCI_BUS_ADDR_T_64BIT +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT int rc;if (res->flags &IORESOURCE_MEM_64 ) {include/linux/pci.h +1
-1@@ -670,7 +670,7 @@ int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,int raw_pci_write (unsigned int domain,unsigned int bus,unsigned int devfn,int reg,int len,u32 val); -#ifdef CONFIG_PCI_BUS_ADDR_T_64BIT +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT typedef u64 pci_bus_addr_t ;#else typedef u32 pci_bus_addr_t ;Signature · 1 line
2.17.0
PATCH 10/12 arm: don't build swiotlb by default
In reply to Christoph Hellwigswiotlb is only used as a library of helper for xen-swiotlb if Xen support is enabled on arm, so don't build it by default.
--- arch/arm/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/Kconfig +2 -1
@@ -1774,7 +1774,7 @@ config SECCOMP defined by each seccomp mode. config SWIOTLB - def_bool y + bool config PARAVIRT bool "Enable paravirtualization code"
@@ -1807,6 +1807,7 @@ config XEN depends on MMU select ARCH_DMA_ADDR_T_64BIT select ARM_PSCI + select SWIOTLB select SWIOTLB_XEN select PARAVIRT help
Signature · 1 line
2.17.0
PATCH 11/12 swiotlb: move the SWIOTLB config symbol to lib/Kconfig
In reply to Christoph HellwigThis way we have one central definition of it, and user can select it as needed. Note that we also add a second ARCH_HAS_SWIOTLB symbol to indicate the architecture supports swiotlb at all, so that we can still make the usage optional for a few architectures that want this feature to be user selectable.
--- arch/arm/Kconfig | 4 +--- arch/arm64/Kconfig | 5 ++--- arch/ia64/Kconfig | 9 +-------- arch/mips/Kconfig | 3 +++ arch/mips/cavium-octeon/Kconfig | 5 ----- arch/mips/loongson64/Kconfig | 8 -------- arch/powerpc/Kconfig | 9 --------- arch/unicore32/mm/Kconfig | 5 ----- arch/x86/Kconfig | 14 +++----------- lib/Kconfig | 15 +++++++++++++++ 10 files changed, 25 insertions(+), 52 deletions(-)
arch/arm/Kconfig +1 -3
@@ -106,6 +106,7 @@ config ARM select REFCOUNT_FULL select RTC_LIB select SYS_SUPPORTS_APM_EMULATION + select ARCH_HAS_SWIOTLB # Above selects are sorted alphabetically; please add new ones # according to that. Thanks. help
@@ -1773,9 +1774,6 @@ config SECCOMP and the task is only allowed to execute a few safe syscalls defined by each seccomp mode. -config SWIOTLB - bool - config PARAVIRT bool "Enable paravirtualization code" help
arch/arm64/Kconfig +2 -3
@@ -21,6 +21,7 @@ config ARM64 select ARCH_HAS_SG_CHAIN select ARCH_HAS_STRICT_KERNEL_RWX select ARCH_HAS_STRICT_MODULE_RWX + select ARCH_HAS_SWIOTLB select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_INLINE_READ_LOCK if !PREEMPT
@@ -144,6 +145,7 @@ config ARM64 select POWER_SUPPLY select REFCOUNT_FULL select SPARSE_IRQ + select SWIOTLB select SYSCTL_EXCEPTION_TRACE select THREAD_INFO_IN_TASK help
@@ -239,9 +241,6 @@ config HAVE_GENERIC_GUP config SMP def_bool y -config SWIOTLB - def_bool y - config KERNEL_MODE_NEON def_bool y
arch/ia64/Kconfig +1 -8
@@ -56,6 +56,7 @@ config IA64 select HAVE_ARCH_AUDITSYSCALL select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH + select ARCH_HAS_SWIOTLB default y help The Itanium Processor Family is Intel's 64-bit successor to
@@ -80,9 +81,6 @@ config MMU bool default y -config SWIOTLB - bool - config STACKTRACE_SUPPORT def_bool y
@@ -139,7 +137,6 @@ config IA64_GENERIC bool "generic" select NUMA select ACPI_NUMA - select DMA_DIRECT_OPS select SWIOTLB select PCI_MSI help
@@ -160,7 +157,6 @@ config IA64_GENERIC config IA64_DIG bool "DIG-compliant" - select DMA_DIRECT_OPS select SWIOTLB config IA64_DIG_VTD
@@ -176,7 +172,6 @@ config IA64_HP_ZX1 config IA64_HP_ZX1_SWIOTLB bool "HP-zx1/sx1000 with software I/O TLB" - select DMA_DIRECT_OPS select SWIOTLB help Build a kernel that runs on HP zx1 and sx1000 systems even when they
@@ -200,7 +195,6 @@ config IA64_SGI_UV bool "SGI-UV" select NUMA select ACPI_NUMA - select DMA_DIRECT_OPS select SWIOTLB help Selecting this option will optimize the kernel for use on UV based
@@ -211,7 +205,6 @@ config IA64_SGI_UV config IA64_HP_SIM bool "Ski-simulator" - select DMA_DIRECT_OPS select SWIOTLB depends on !PM
arch/mips/Kconfig +3 -0
@@ -912,6 +912,8 @@ config CAVIUM_OCTEON_SOC select MIPS_NR_CPU_NR_MAP_1024 select BUILTIN_DTB select MTD_COMPLEX_MAPPINGS + select ARCH_HAS_SWIOTLB + select SWIOTLB select SYS_SUPPORTS_RELOCATABLE help This option supports all of the Octeon reference boards from Cavium
@@ -1367,6 +1369,7 @@ config CPU_LOONGSON3 select MIPS_PGD_C0_CONTEXT select MIPS_L1_CACHE_SHIFT_6 select GPIOLIB + select ARCH_HAS_SWIOTLB help The Loongson 3 processor implements the MIPS64R2 instruction set with many extensions.
arch/mips/cavium-octeon/Kconfig +0 -5
@@ -67,11 +67,6 @@ config CAVIUM_OCTEON_LOCK_L2_MEMCPY help Lock the kernel's implementation of memcpy() into L2. -config SWIOTLB - def_bool y - select DMA_DIRECT_OPS - select NEED_SG_DMA_LENGTH - config OCTEON_ILM tristate "Module to measure interrupt latency using Octeon CIU Timer" help
arch/mips/loongson64/Kconfig +0 -8
@@ -130,14 +130,6 @@ config LOONGSON_UART_BASE default y depends on EARLY_PRINTK || SERIAL_8250 -config SWIOTLB - bool "Soft IOMMU Support for All-Memory DMA" - default y - depends on CPU_LOONGSON3 - select DMA_DIRECT_OPS - select NEED_SG_DMA_LENGTH - select NEED_DMA_MAP_STATE - config PHYS48_TO_HT40 bool default y if CPU_LOONGSON3
arch/powerpc/Kconfig +0 -9
@@ -474,15 +474,6 @@ config MPROFILE_KERNEL depends on PPC64 && CPU_LITTLE_ENDIAN def_bool !DISABLE_MPROFILE_KERNEL -config SWIOTLB - bool "SWIOTLB support" - default n - ---help--- - Support for IO bounce buffering for systems without an IOMMU. - This allows us to DMA to the full physical address space on - platforms where the size of a physical address is larger - than the bus address. Not all platforms support this. - config HOTPLUG_CPU bool "Support for enabling/disabling CPUs" depends on SMP && (PPC_PSERIES || \
arch/unicore32/mm/Kconfig +0 -5
@@ -39,8 +39,3 @@ config CPU_TLB_SINGLE_ENTRY_DISABLE default y help Say Y here to disable the TLB single entry operations. - -config SWIOTLB - def_bool y - select DMA_DIRECT_OPS - select NEED_SG_DMA_LENGTH
arch/x86/Kconfig +3 -11
@@ -24,6 +24,7 @@ config X86_64 depends on 64BIT # Options that are inherently 64-bit kernel only: select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA + select ARCH_HAS_SWIOTLB select ARCH_SUPPORTS_INT128 select ARCH_USE_CMPXCHG_LOCKREF select HAVE_ARCH_SOFT_DIRTY
@@ -676,6 +677,7 @@ config STA2X11 bool "STA2X11 Companion Chip Support" depends on X86_32_NON_STANDARD && PCI select ARCH_HAS_PHYS_TO_DMA + select ARCH_HAS_SWIOTLB select X86_DEV_DMA_OPS select X86_DMA_REMAP select SWIOTLB
@@ -915,17 +917,6 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT Calgary anyway, pass 'iommu=calgary' on the kernel command line. If unsure, say Y. -# need this always selected by IOMMU for the VIA workaround -config SWIOTLB - def_bool y if X86_64 - select NEED_DMA_MAP_STATE - ---help--- - Support for software bounce buffers used on x86-64 systems - which don't have a hardware IOMMU. Using this PCI devices - which can only access 32-bits of memory can be used on systems - with more than 3 GB of memory. - If unsure, say Y. - config MAXSMP bool "Enable Maximum number of SMP Processors and NUMA Nodes" depends on X86_64 && SMP && DEBUG_KERNEL
@@ -1447,6 +1438,7 @@ config HIGHMEM config X86_PAE bool "PAE (Physical Address Extension) Support" depends on X86_32 && !HIGHMEM4G + select ARCH_HAS_SWIOTLB select PHYS_ADDR_T_64BIT select SWIOTLB ---help---
lib/Kconfig +15 -0
@@ -451,6 +451,21 @@ config DMA_VIRT_OPS depends on HAS_DMA && (!64BIT || ARCH_DMA_ADDR_T_64BIT) default n +config ARCH_HAS_SWIOTLB + bool + +config SWIOTLB + bool "SWIOTLB support" + default ARCH_HAS_SWIOTLB + select DMA_DIRECT_OPS + select NEED_DMA_MAP_STATE + select NEED_SG_DMA_LENGTH + ---help--- + Support for IO bounce buffering for systems without an IOMMU. + This allows us to DMA to the full physical address space on + platforms where the size of a physical address is larger + than the bus address. If unsure, say Y. + config CHECK_SIGNATURE bool
Signature · 1 line
2.17.0
Re: [PATCH 11/12] swiotlb: move the SWIOTLB config symbol to lib/Kconfig
Quoted 7 lines · Christoph Hellwig
This way we have one central definition of it, and user can select it as needed. Note that we also add a second
ARCH_HAS_SWIOTLBsymbol to indicate the architecture supports swiotlb at all, so that we can still make the usage optional for a few architectures that want this feature to be user selectable.Signed-off-by Christoph Hellwig <[email protected]>
snip
Quoted 5 lines
lib/Kconfig +5
-0+ +config SWIOTLB + bool "SWIOTLB support" + default ARCH_HAS_SWIOTLB + select DMA_DIRECT_OPS
lib/Kconfig config DMA_VIRT_OPS · line 470
Quoted 10 lines
lib/Kconfig +8
-0+ select NEED_DMA_MAP_STATE + select NEED_SG_DMA_LENGTH + ---help--- + Support for IO bounce buffering for systems without an IOMMU. + This allows us to DMA to the full physical address space on + platforms where the size of a physical address is larger + than the bus address. If unsure, say Y. + config CHECK_SIGNATURE bool
Pulling DMA_DIRECT_OPS config option by default when SWIOTLB is enabled makes sense. This option was also needed to be enabled separately even to use swiotlb_dma_ops.
PATCH 12/12 swiotlb: remove the CONFIG_DMA_DIRECT_OPS ifdefs
In reply to Christoph Hellwigswiotlb now selects the DMA_DIRECT_OPS config symbol, so this will always be true.
--- lib/swiotlb.c | 4 ---- 1 file changed, 4 deletions(-)
lib/swiotlb.c +0 -4
@@ -692,7 +692,6 @@ void swiotlb_tbl_sync_single(struct device *hwdev, phys_addr_t tlb_addr, } } -#ifdef CONFIG_DMA_DIRECT_OPS static inline bool dma_coherent_ok (struct device *dev,dma_addr_t addr,size_t size) {
@@ -764,7 +763,6 @@ static bool swiotlb_free_buffer(struct device *dev, size_t size, DMA_ATTR_SKIP_CPU_SYNC);return true; } -#endif static void swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir,
@@ -1045,7 +1043,6 @@ swiotlb_dma_supported(struct device *hwdev, u64 mask)return __phys_to_dma (hwdev, io_tlb_end -1 ) <= mask; } -#ifdef CONFIG_DMA_DIRECT_OPS void *swiotlb_alloc (struct device *dev,size_t size,dma_addr_t *dma_handle,gfp_t gfp,unsigned long attrs) {
@@ -1089,4 +1086,3 @@ const struct dma_map_ops swiotlb_dma_ops = { .unmap_page = swiotlb_unmap_page, .dma_supported = swiotlb_dma_supported, }; -#endif /* CONFIG_DMA_DIRECT_OPS */
Signature · 1 line
2.17.0