Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea65a7d7 authored by Mike Rapoport's avatar Mike Rapoport Committed by Greg Kroah-Hartman
Browse files

arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL

commit 5e545df3292fbd3d5963c68980f1527ead2a2b3f upstream.

ARM is the only architecture that defines CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
which in turn enables memmap_valid_within() function that is intended to
verify existence  of struct page associated with a pfn when there are holes
in the memory map.

However, the ARCH_HAS_HOLES_MEMORYMODEL also enables HAVE_ARCH_PFN_VALID
and arch-specific pfn_valid() implementation that also deals with the holes
in the memory map.

The only two users of memmap_valid_within() call this function after
a call to pfn_valid() so the memmap_valid_within() check becomes redundant.

Remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL and memmap_valid_within() and rely
entirely on ARM's implementation of pfn_valid() that is now enabled
unconditionally.

Link: https://lkml.kernel.org/r/20201101170454.9567-9-rppt@kernel.org


Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Meelis Roos <mroos@linux.ee>
Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Fixes: 8dd559d53b3b ("arm: ioremap: don't abuse pfn_valid() to check if pfn is in RAM")
Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5755f946
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -52,8 +52,7 @@ wrapper :c:func:`free_area_init`. Yet, the mappings array is not
usable until the call to :c:func:`memblock_free_all` that hands all
the memory to the page allocator.

If an architecture enables `CONFIG_ARCH_HAS_HOLES_MEMORYMODEL` option,
it may free parts of the `mem_map` array that do not cover the
An architecture may free parts of the `mem_map` array that do not cover the
actual physical pages. In such case, the architecture specific
:c:func:`pfn_valid` implementation should take the holes in the
`mem_map` into account.
+2 −6
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ config ARM
	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
	select ARCH_HAVE_CUSTOM_GPIO_H
	select ARCH_HAS_GCOV_PROFILE_ALL
	select ARCH_KEEP_MEMBLOCK if HAVE_ARCH_PFN_VALID || KEXEC
	select ARCH_KEEP_MEMBLOCK
	select ARCH_MIGHT_HAVE_PC_PARPORT
	select ARCH_NO_SG_CHAIN if !ARM_HAS_SG_CHAIN
	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
@@ -521,7 +521,6 @@ config ARCH_S3C24XX
config ARCH_OMAP1
	bool "TI OMAP1"
	depends on MMU
	select ARCH_HAS_HOLES_MEMORYMODEL
	select ARCH_OMAP
	select CLKDEV_LOOKUP
	select CLKSRC_MMIO
@@ -1518,9 +1517,6 @@ config OABI_COMPAT
	  UNPREDICTABLE (in fact it can be predicted that it won't work
	  at all). If in doubt say N.

config ARCH_HAS_HOLES_MEMORYMODEL
	bool

config ARCH_SPARSEMEM_ENABLE
	bool

@@ -1528,7 +1524,7 @@ config ARCH_SPARSEMEM_DEFAULT
	def_bool ARCH_SPARSEMEM_ENABLE

config HAVE_ARCH_PFN_VALID
	def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
	def_bool y

config HIGHMEM
	bool "High Memory Support"
+0 −1
Original line number Diff line number Diff line
@@ -214,7 +214,6 @@ config ARCH_BRCMSTB
	select HAVE_ARM_ARCH_TIMER
	select BRCMSTB_L2_IRQ
	select BCM7120_L2_IRQ
	select ARCH_HAS_HOLES_MEMORYMODEL
	select ZONE_DMA if ARM_LPAE
	select SOC_BRCMSTB
	select SOC_BUS
+0 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ menuconfig ARCH_DAVINCI
	depends on ARCH_MULTI_V5
	select DAVINCI_TIMER
	select ZONE_DMA
	select ARCH_HAS_HOLES_MEMORYMODEL
	select PM_GENERIC_DOMAINS if PM
	select PM_GENERIC_DOMAINS_OF if PM && OF
	select REGMAP_MMIO
+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
menuconfig ARCH_EXYNOS
	bool "Samsung EXYNOS"
	depends on ARCH_MULTI_V7
	select ARCH_HAS_HOLES_MEMORYMODEL
	select ARCH_SUPPORTS_BIG_ENDIAN
	select ARM_AMBA
	select ARM_GIC
Loading