kernel_optimize_test/arch/arm
Florian Fainelli c454639172 ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow
[ Upstream commit fb0fd3469ead5b937293c213daa1f589b4b7ce46 ]

Commit 26f09e9b3a ("mm/memblock: add memblock memory allocation apis")
added a check to determine whether arm_dma_zone_size is exceeding the
amount of kernel virtual address space available between the upper 4GB
virtual address limit and PAGE_OFFSET in order to provide a suitable
definition of MAX_DMA_ADDRESS that should fit within the 32-bit virtual
address space. The quantity used for comparison was off by a missing
trailing 0, leading to MAX_DMA_ADDRESS to be overflowing a 32-bit
quantity.

This was caught thanks to CONFIG_DEBUG_VIRTUAL on the bcm2711 platform
where we define a dma_zone_size of 1GB and we have a PAGE_OFFSET value
of 0xc000_0000 (CONFIG_VMSPLIT_3G) leading to MAX_DMA_ADDRESS being
0x1_0000_0000 which overflows the unsigned long type used throughout
__pa() and then __virt_addr_valid(). Because the virtual address passed
to __virt_addr_valid() would now be 0, the function would loudly warn
and flood the kernel log, thus making the platform unable to boot
properly.

Fixes: 26f09e9b3a ("mm/memblock: add memblock memory allocation apis")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-03 12:00:50 +02:00
..
boot ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 2022-07-21 21:20:17 +02:00
common
configs ARM: configs: multi_v5_defconfig: re-enable CONFIG_V4L_PLATFORM_DRIVERS 2022-04-08 14:40:11 +02:00
crypto crypto: arm/aes-neonbs-cbc - Select generic cbc and aes 2022-04-08 14:40:41 +02:00
include ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow 2022-08-03 12:00:50 +02:00
kernel ARM: 9197/1: spectre-bhb: fix loop8 sequence for Thumb2 2022-05-25 09:17:59 +02:00
lib ARM: crypto: comment out gcc warning that breaks clang builds 2022-08-03 12:00:49 +02:00
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: at91: pm: use proper compatibles for sam9x60's rtc and rtt 2022-07-12 16:32:21 +02:00
mach-axxia ARM: Fix refcount leak in axxia_boot_secondary 2022-06-29 08:59:54 +02:00
mach-bcm arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
mach-berlin
mach-clps711x
mach-cns3xxx ARM: cns3xxx: Fix refcount leak in cns3xxx_init 2022-06-29 08:59:54 +02:00
mach-davinci arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
mach-digicolor
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx
mach-exynos ARM: exynos: Fix refcount leak in exynos_map_pmu 2022-06-29 08:59:54 +02:00
mach-footbridge ARM: footbridge: fix PCI interrupt mapping 2021-04-21 13:00:58 +02:00
mach-gemini
mach-highbank arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
mach-hisi ARM: hisi: Add missing of_node_put after of_find_compatible_node 2022-06-09 10:20:58 +02:00
mach-imx ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence 2021-10-13 10:04:27 +02:00
mach-integrator
mach-iop32x ARM: iop32x: offset IRQ numbers by 1 2022-04-08 14:40:42 +02:00
mach-ixp4xx clocksource/drivers/ixp4xx: Select TIMER_OF when needed 2021-03-04 11:37:57 +01:00
mach-keystone ARM: keystone: fix integer overflow warning 2021-04-21 13:00:52 +02:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek arm: mediatek: select arch timer for mt7629 2022-06-09 10:21:15 +02:00
mach-meson ARM: meson: Fix refcount leak in meson_smp_prepare_cpus 2022-07-12 16:32:19 +02:00
mach-milbeaut
mach-mmp ARM: mmp: Fix failure to remove sram device 2022-04-08 14:40:35 +02:00
mach-moxart
mach-mstar ARM: mstar: Select HAVE_ARM_ARCH_TIMER 2022-04-08 14:39:47 +02:00
mach-mv78xx0
mach-mvebu mvebu fixes for 5.9 (part 1) 2020-10-26 10:11:55 +01:00
mach-mxs
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 ARM: OMAP1: clock: Fix UART rate reporting algorithm 2022-06-09 10:20:57 +02:00
mach-omap2 arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
mach-orion5x
mach-oxnas
mach-picoxcell
mach-prima2
mach-pxa ARM: pxa: maybe fix gpio lookup tables 2022-06-09 10:21:28 +02:00
mach-qcom
mach-rda
mach-realtek
mach-realview
mach-rockchip
mach-rpc
mach-s3c ARM: 9187/1: JIVE: fix return value of __setup handler 2022-04-08 14:40:43 +02:00
mach-s5pv210 arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
mach-sa1100
mach-shmobile ARM: shmobile: rcar-gen2: Add missing of_node_put() 2022-01-27 10:54:11 +01:00
mach-socfpga ARM: socfpga: fix missing RESET_CONTROLLER 2022-02-16 12:54:21 +01:00
mach-spear
mach-sti
mach-stm32
mach-sunxi ARM: sunxi: Add machine match for the Allwinner V3 SoC 2020-11-02 10:28:14 +01:00
mach-tango arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
mach-tegra
mach-u300
mach-uniphier
mach-ux500
mach-versatile
mach-vexpress ARM: versatile: Add missing of_node_put in dcscb_init 2022-06-09 10:20:58 +02:00
mach-vt8500
mach-zx
mach-zynq
mm ARM: 9210/1: Mark the FDT_FIXED sections as shareable 2022-07-21 21:20:03 +02:00
net bpf, arm: Fix register clobbering in div/mod implementation 2021-10-13 10:04:26 +02:00
nwfpe
oprofile
plat-omap
plat-orion
plat-pxa
plat-versatile
probes ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction 2022-07-21 21:20:00 +02:00
tools
vdso
vfp ARM: 9044/1: vfp: use undef hook for VFP support detection 2020-12-30 11:54:02 +01:00
xen xen/arm: Fix race in RB-tree based P2M accounting 2022-07-07 17:52:23 +02:00
Kbuild
Kconfig arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
Kconfig-nommu
Kconfig.assembler
Kconfig.debug ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART 2022-01-27 10:54:11 +01:00
Makefile ARM: 9156/1: drop cc-option fallbacks for architecture selection 2021-11-18 14:04:28 +01:00