Skip to content

Commit

Permalink
swiotlb: move the SWIOTLB config symbol to lib/Kconfig
Browse files Browse the repository at this point in the history
This way we have one central definition of it, and user can select it as
needed.  The new option is not user visible, which is the behavior
it had in most architectures, with a few notable exceptions:

 - On x86_64 and mips/loongson3 it used to be user selectable, but
   defaulted to y.  It now is unconditional, which seems like the right
   thing for 64-bit architectures without guaranteed availablity of
   IOMMUs.
 - on powerpc the symbol is user selectable and defaults to n, but
   many boards select it.  This change assumes no working setup
   required a manual selection, but if that turned out to be wrong
   we'll have to add another select statement or two for the respective
   boards.

Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
Christoph Hellwig committed May 9, 2018
1 parent 8d9b409 commit 09230cb
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 49 deletions.
3 changes: 0 additions & 3 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1772,9 +1772,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
Expand Down
4 changes: 1 addition & 3 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ config ARM64
select POWER_SUPPLY
select REFCOUNT_FULL
select SPARSE_IRQ
select SWIOTLB
select SYSCTL_EXCEPTION_TRACE
select THREAD_INFO_IN_TASK
help
Expand Down Expand Up @@ -238,9 +239,6 @@ config HAVE_GENERIC_GUP
config SMP
def_bool y

config SWIOTLB
def_bool y

config KERNEL_MODE_NEON
def_bool y

Expand Down
8 changes: 0 additions & 8 deletions arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ config MMU
bool
default y

config SWIOTLB
bool

config STACKTRACE_SUPPORT
def_bool y

Expand Down Expand Up @@ -138,7 +135,6 @@ config IA64_GENERIC
bool "generic"
select NUMA
select ACPI_NUMA
select DMA_DIRECT_OPS
select SWIOTLB
select PCI_MSI
help
Expand All @@ -159,7 +155,6 @@ config IA64_GENERIC

config IA64_DIG
bool "DIG-compliant"
select DMA_DIRECT_OPS
select SWIOTLB

config IA64_DIG_VTD
Expand All @@ -175,7 +170,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
Expand All @@ -199,7 +193,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
Expand All @@ -210,7 +203,6 @@ config IA64_SGI_UV

config IA64_HP_SIM
bool "Ski-simulator"
select DMA_DIRECT_OPS
select SWIOTLB
depends on !PM

Expand Down
2 changes: 2 additions & 0 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ config CAVIUM_OCTEON_SOC
select MIPS_NR_CPU_NR_MAP_1024
select BUILTIN_DTB
select MTD_COMPLEX_MAPPINGS
select SWIOTLB
select SYS_SUPPORTS_RELOCATABLE
help
This option supports all of the Octeon reference boards from Cavium
Expand Down Expand Up @@ -1366,6 +1367,7 @@ config CPU_LOONGSON3
select MIPS_PGD_C0_CONTEXT
select MIPS_L1_CACHE_SHIFT_6
select GPIOLIB
select SWIOTLB
help
The Loongson 3 processor implements the MIPS64R2 instruction
set with many extensions.
Expand Down
4 changes: 0 additions & 4 deletions arch/mips/cavium-octeon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +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

config OCTEON_ILM
tristate "Module to measure interrupt latency using Octeon CIU Timer"
help
Expand Down
7 changes: 0 additions & 7 deletions arch/mips/loongson64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +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_DMA_MAP_STATE

config PHYS48_TO_HT40
bool
default y if CPU_LOONGSON3
Expand Down
9 changes: 0 additions & 9 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,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 || \
Expand Down
1 change: 1 addition & 0 deletions arch/unicore32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ config UNICORE32
select GENERIC_IOMAP
select MODULES_USE_ELF_REL
select NEED_DMA_MAP_STATE
select SWIOTLB
help
UniCore-32 is 32-bit Instruction Set Architecture,
including a series of low-power-consumption RISC chip
Expand Down
4 changes: 0 additions & 4 deletions arch/unicore32/mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +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
12 changes: 1 addition & 11 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ config X86_64
select HAVE_ARCH_SOFT_DIRTY
select MODULES_USE_ELF_RELA
select NEED_DMA_MAP_STATE
select SWIOTLB
select X86_DEV_DMA_OPS
select ARCH_HAS_SYSCALL_WRAPPER

Expand Down Expand Up @@ -919,17 +920,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
Expand Down
5 changes: 5 additions & 0 deletions lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ config DMA_VIRT_OPS
depends on HAS_DMA && (!64BIT || ARCH_DMA_ADDR_T_64BIT)
default n

config SWIOTLB
bool
select DMA_DIRECT_OPS
select NEED_DMA_MAP_STATE

config CHECK_SIGNATURE
bool

Expand Down

0 comments on commit 09230cb

Please sign in to comment.