Commit 63703f37 authored by Kefeng Wang's avatar Kefeng Wang Committed by Linus Torvalds

mm: generalize ZONE_[DMA|DMA32]

ZONE_[DMA|DMA32] configs have duplicate definitions on platforms that
subscribe to them.  Instead, just make them generic options which can be
selected on applicable platforms.

Also only x86/arm64 architectures could enable both ZONE_DMA and
ZONE_DMA32 if EXPERT, add ARCH_HAS_ZONE_DMA_SET to make dma zone
configurable and visible on the two architectures.

Link: https://lkml.kernel.org/r/20210528074557.17768-1-wangkefeng.wang@huawei.comSigned-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
Acked-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>	[RISC-V]
Acked-by: Michal Simek <michal.simek@xilinx.com>	[microblaze]
Acked-by: Michael Ellerman <mpe@ellerman.id.au>		[powerpc]
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent db1d9152
...@@ -40,6 +40,7 @@ config ALPHA ...@@ -40,6 +40,7 @@ config ALPHA
select MMU_GATHER_NO_RANGE select MMU_GATHER_NO_RANGE
select SET_FS select SET_FS
select SPARSEMEM_EXTREME if SPARSEMEM select SPARSEMEM_EXTREME if SPARSEMEM
select ZONE_DMA
help help
The Alpha is a 64-bit general-purpose processor designed and The Alpha is a 64-bit general-purpose processor designed and
marketed by the Digital Equipment Corporation of blessed memory, marketed by the Digital Equipment Corporation of blessed memory,
...@@ -65,10 +66,6 @@ config GENERIC_CALIBRATE_DELAY ...@@ -65,10 +66,6 @@ config GENERIC_CALIBRATE_DELAY
bool bool
default y default y
config ZONE_DMA
bool
default y
config GENERIC_ISA_DMA config GENERIC_ISA_DMA
bool bool
default y default y
......
...@@ -218,9 +218,6 @@ config GENERIC_CALIBRATE_DELAY ...@@ -218,9 +218,6 @@ config GENERIC_CALIBRATE_DELAY
config ARCH_MAY_HAVE_PC_FDC config ARCH_MAY_HAVE_PC_FDC
bool bool
config ZONE_DMA
bool
config ARCH_SUPPORTS_UPROBES config ARCH_SUPPORTS_UPROBES
def_bool y def_bool y
......
...@@ -42,6 +42,7 @@ config ARM64 ...@@ -42,6 +42,7 @@ config ARM64
select ARCH_HAS_SYSCALL_WRAPPER select ARCH_HAS_SYSCALL_WRAPPER
select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select ARCH_HAS_ZONE_DMA_SET if EXPERT
select ARCH_HAVE_ELF_PROT select ARCH_HAVE_ELF_PROT
select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_HAVE_NMI_SAFE_CMPXCHG
select ARCH_INLINE_READ_LOCK if !PREEMPTION select ARCH_INLINE_READ_LOCK if !PREEMPTION
...@@ -306,14 +307,6 @@ config GENERIC_CSUM ...@@ -306,14 +307,6 @@ config GENERIC_CSUM
config GENERIC_CALIBRATE_DELAY config GENERIC_CALIBRATE_DELAY
def_bool y def_bool y
config ZONE_DMA
bool "Support DMA zone" if EXPERT
default y
config ZONE_DMA32
bool "Support DMA32 zone" if EXPERT
default y
config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
def_bool y def_bool y
......
...@@ -60,6 +60,7 @@ config IA64 ...@@ -60,6 +60,7 @@ config IA64
select NUMA if !FLATMEM select NUMA if !FLATMEM
select PCI_MSI_ARCH_FALLBACKS if PCI_MSI select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
select SET_FS select SET_FS
select ZONE_DMA32
default y default y
help help
The Itanium Processor Family is Intel's 64-bit successor to The Itanium Processor Family is Intel's 64-bit successor to
...@@ -72,9 +73,6 @@ config 64BIT ...@@ -72,9 +73,6 @@ config 64BIT
select ATA_NONSTANDARD if ATA select ATA_NONSTANDARD if ATA
default y default y
config ZONE_DMA32
def_bool y
config MMU config MMU
bool bool
default y default y
......
...@@ -34,6 +34,7 @@ config M68K ...@@ -34,6 +34,7 @@ config M68K
select SET_FS select SET_FS
select UACCESS_MEMCPY if !MMU select UACCESS_MEMCPY if !MMU
select VIRT_TO_BUS select VIRT_TO_BUS
select ZONE_DMA
config CPU_BIG_ENDIAN config CPU_BIG_ENDIAN
def_bool y def_bool y
...@@ -62,10 +63,6 @@ config TIME_LOW_RES ...@@ -62,10 +63,6 @@ config TIME_LOW_RES
config NO_IOPORT_MAP config NO_IOPORT_MAP
def_bool y def_bool y
config ZONE_DMA
bool
default y
config HZ config HZ
int int
default 1000 if CLEOPATRA default 1000 if CLEOPATRA
......
...@@ -43,6 +43,7 @@ config MICROBLAZE ...@@ -43,6 +43,7 @@ config MICROBLAZE
select MMU_GATHER_NO_RANGE select MMU_GATHER_NO_RANGE
select SPARSE_IRQ select SPARSE_IRQ
select SET_FS select SET_FS
select ZONE_DMA
# Endianness selection # Endianness selection
choice choice
...@@ -60,9 +61,6 @@ config CPU_LITTLE_ENDIAN ...@@ -60,9 +61,6 @@ config CPU_LITTLE_ENDIAN
endchoice endchoice
config ZONE_DMA
def_bool y
config ARCH_HAS_ILOG2_U32 config ARCH_HAS_ILOG2_U32
def_bool n def_bool n
......
...@@ -3274,13 +3274,6 @@ config I8253 ...@@ -3274,13 +3274,6 @@ config I8253
select CLKSRC_I8253 select CLKSRC_I8253
select CLKEVT_I8253 select CLKEVT_I8253
select MIPS_EXTERNAL_TIMER select MIPS_EXTERNAL_TIMER
config ZONE_DMA
bool
config ZONE_DMA32
bool
endmenu endmenu
config TRAD_SIGNALS config TRAD_SIGNALS
......
...@@ -403,10 +403,6 @@ config PPC_ADV_DEBUG_DAC_RANGE ...@@ -403,10 +403,6 @@ config PPC_ADV_DEBUG_DAC_RANGE
config PPC_DAWR config PPC_DAWR
bool bool
config ZONE_DMA
bool
default y if PPC_BOOK3E_64
config PGTABLE_LEVELS config PGTABLE_LEVELS
int int
default 2 if !PPC64 default 2 if !PPC64
......
...@@ -111,6 +111,7 @@ config PPC_BOOK3E_64 ...@@ -111,6 +111,7 @@ config PPC_BOOK3E_64
select PPC_FPU # Make it a choice ? select PPC_FPU # Make it a choice ?
select PPC_SMP_MUXED_IPI select PPC_SMP_MUXED_IPI
select PPC_DOORBELL select PPC_DOORBELL
select ZONE_DMA
endchoice endchoice
......
...@@ -104,6 +104,7 @@ config RISCV ...@@ -104,6 +104,7 @@ config RISCV
select SYSCTL_EXCEPTION_TRACE select SYSCTL_EXCEPTION_TRACE
select THREAD_INFO_IN_TASK select THREAD_INFO_IN_TASK
select UACCESS_MEMCPY if !MMU select UACCESS_MEMCPY if !MMU
select ZONE_DMA32 if 64BIT
config ARCH_MMAP_RND_BITS_MIN config ARCH_MMAP_RND_BITS_MIN
default 18 if 64BIT default 18 if 64BIT
...@@ -133,10 +134,6 @@ config MMU ...@@ -133,10 +134,6 @@ config MMU
Select if you want MMU-based virtualised addressing space Select if you want MMU-based virtualised addressing space
support by paged memory management. If unsure, say 'Y'. support by paged memory management. If unsure, say 'Y'.
config ZONE_DMA32
bool
default y if 64BIT
config VA_BITS config VA_BITS
int int
default 32 if 32BIT default 32 if 32BIT
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
config MMU config MMU
def_bool y def_bool y
config ZONE_DMA
def_bool y
config CPU_BIG_ENDIAN config CPU_BIG_ENDIAN
def_bool y def_bool y
...@@ -210,6 +207,7 @@ config S390 ...@@ -210,6 +207,7 @@ config S390
select THREAD_INFO_IN_TASK select THREAD_INFO_IN_TASK
select TTY select TTY
select VIRT_CPU_ACCOUNTING select VIRT_CPU_ACCOUNTING
select ZONE_DMA
# Note: keep the above list sorted alphabetically # Note: keep the above list sorted alphabetically
config SCHED_OMIT_FRAME_POINTER config SCHED_OMIT_FRAME_POINTER
......
...@@ -59,6 +59,7 @@ config SPARC32 ...@@ -59,6 +59,7 @@ config SPARC32
select CLZ_TAB select CLZ_TAB
select HAVE_UID16 select HAVE_UID16
select OLD_SIGACTION select OLD_SIGACTION
select ZONE_DMA
config SPARC64 config SPARC64
def_bool 64BIT def_bool 64BIT
...@@ -141,10 +142,6 @@ config HIGHMEM ...@@ -141,10 +142,6 @@ config HIGHMEM
default y if SPARC32 default y if SPARC32
select KMAP_LOCAL select KMAP_LOCAL
config ZONE_DMA
bool
default y if SPARC32
config GENERIC_ISA_DMA config GENERIC_ISA_DMA
bool bool
default y if SPARC32 default y if SPARC32
......
...@@ -33,6 +33,7 @@ config X86_64 ...@@ -33,6 +33,7 @@ config X86_64
select NEED_DMA_MAP_STATE select NEED_DMA_MAP_STATE
select SWIOTLB select SWIOTLB
select ARCH_HAS_ELFCORE_COMPAT select ARCH_HAS_ELFCORE_COMPAT
select ZONE_DMA32
config FORCE_DYNAMIC_FTRACE config FORCE_DYNAMIC_FTRACE
def_bool y def_bool y
...@@ -93,6 +94,7 @@ config X86 ...@@ -93,6 +94,7 @@ config X86
select ARCH_HAS_SYSCALL_WRAPPER select ARCH_HAS_SYSCALL_WRAPPER
select ARCH_HAS_UBSAN_SANITIZE_ALL select ARCH_HAS_UBSAN_SANITIZE_ALL
select ARCH_HAS_DEBUG_WX select ARCH_HAS_DEBUG_WX
select ARCH_HAS_ZONE_DMA_SET if EXPERT
select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_HAVE_NMI_SAFE_CMPXCHG
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_PARPORT
...@@ -343,9 +345,6 @@ config ARCH_SUSPEND_POSSIBLE ...@@ -343,9 +345,6 @@ config ARCH_SUSPEND_POSSIBLE
config ARCH_WANT_GENERAL_HUGETLB config ARCH_WANT_GENERAL_HUGETLB
def_bool y def_bool y
config ZONE_DMA32
def_bool y if X86_64
config AUDIT_ARCH config AUDIT_ARCH
def_bool y if X86_64 def_bool y if X86_64
...@@ -393,16 +392,6 @@ config CC_HAS_SANE_STACKPROTECTOR ...@@ -393,16 +392,6 @@ config CC_HAS_SANE_STACKPROTECTOR
menu "Processor type and features" menu "Processor type and features"
config ZONE_DMA
bool "DMA memory allocation support" if EXPERT
default y
help
DMA memory allocation support allows devices with less than 32-bit
addressing to allocate within the first 16MB of address space.
Disable if no such devices will be used.
If unsure, say Y.
config SMP config SMP
bool "Symmetric multi-processing support" bool "Symmetric multi-processing support"
help help
......
...@@ -761,6 +761,18 @@ config ARCH_HAS_CACHE_LINE_SIZE ...@@ -761,6 +761,18 @@ config ARCH_HAS_CACHE_LINE_SIZE
config ARCH_HAS_PTE_DEVMAP config ARCH_HAS_PTE_DEVMAP
bool bool
config ARCH_HAS_ZONE_DMA_SET
bool
config ZONE_DMA
bool "Support DMA zone" if ARCH_HAS_ZONE_DMA_SET
default y if ARM64 || X86
config ZONE_DMA32
bool "Support DMA32 zone" if ARCH_HAS_ZONE_DMA_SET
depends on !X86_32
default y if ARM64
config ZONE_DEVICE config ZONE_DEVICE
bool "Device memory (pmem, HMM, etc...) hotplug support" bool "Device memory (pmem, HMM, etc...) hotplug support"
depends on MEMORY_HOTPLUG depends on MEMORY_HOTPLUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment