OrangePi_CM5/arch/arm/include/asm
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
..
hardware
…
mach ARM: 9210/1: Mark the FDT_FIXED sections as shareable 2022-07-21 21:20:03 +02:00
vdso vdso/treewide: Add vdso_data pointer argument to __arch_get_hw_counter() 2020-08-06 10:57:30 +02:00
xen xen/arm: do not setup the runstate info page if kpti is enabled 2020-10-04 18:41:33 -05:00
Kbuild local64.h: make <asm/local64.h> mandatory 2021-01-12 20:18:16 +01:00
arch_gicv3.h
…
arch_timer.h
…
arm-cci.h
…
asm-offsets.h
…
assembler.h ARM: fix co-processor register typo 2022-03-11 12:11:53 +01:00
atomic.h
…
auxvec.h
…
bL_switcher.h
…
barrier.h
…
bitops.h
…
bitrev.h
…
bug.h
…
bugs.h
…
cache.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
cacheflush.h
…
cachetype.h
…
checksum.h arm: propagate the calling convention changes down to csum_partial_copy_from_user() 2020-08-20 15:45:16 -04:00
clocksource.h
…
cmpxchg.h
…
compiler.h
…
cp15.h
…
cpu.h
…
cpufeature.h
…
cpuidle.h ARM: cpuidle: Avoid orphan section warning 2021-06-16 12:01:44 +02:00
cputype.h
…
cti.h
…
dcc.h
…
delay.h
…
device.h
…
div64.h
…
dma-direct.h ARM/omap1: switch to use dma_direct_set_offset for lbus DMA offsets 2020-09-25 06:15:32 +02:00
dma-iommu.h dma-mapping: move dma-debug.h to kernel/dma/ 2020-10-06 07:07:05 +02:00
dma-mapping.h dma-mapping: move dma-debug.h to kernel/dma/ 2020-10-06 07:07:05 +02:00
dma.h ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow 2022-08-03 12:00:50 +02:00
dmi.h
…
domain.h
…
ecard.h
…
edac.h
…
efi.h efi/libstub: arm32: Base FDT and initrd placement on image address 2020-09-16 18:53:42 +03:00
elf.h
…
entry-macro-multi.S
…
exception.h
…
fb.h
…
fiq.h
…
firmware.h
…
fixmap.h ARM: 9012/1: move device tree mapping out of linear region 2021-05-19 10:13:18 +02:00
floppy.h
…
fncpy.h
…
fpstate.h
…
ftrace.h ARM: 9079/1: ftrace: Add MODULE_PLTS support 2021-09-26 14:08:56 +02:00
futex.h
…
glue-cache.h
…
glue-df.h
…
glue-pf.h
…
glue-proc.h
…
glue.h
…
gpio.h
…
hardirq.h ARM: Remove custom IRQ stat accounting 2020-09-17 16:37:28 +01:00
highmem.h
…
hugetlb-3level.h
…
hugetlb.h
…
hw_breakpoint.h
…
hw_irq.h
…
hwcap.h
…
hypervisor.h
…
ide.h
…
idmap.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
insn.h ARM: 9078/1: Add warn suppress parameter to arm_gen_branch_link() 2021-09-26 14:08:56 +02:00
io.h arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map 2022-05-18 10:23:48 +02:00
irq.h
…
irq_work.h
…
irqflags.h
…
jump_label.h
…
kexec-internal.h ARM: kexec: fix oops after TLB are invalidated 2021-02-17 11:02:24 +01:00
kexec.h
…
kgdb.h
…
kmap_types.h
…
kprobes.h ARM: 9019/1: kprobes: Avoid fortify_panic() when copying optprobe template 2020-10-27 12:11:51 +00:00
krait-l2-accessors.h
…
linkage.h
…
mc146818rtc.h
…
mcpm.h
…
mcs_spinlock.h
…
memblock.h
…
memory.h ARM: 9020/1: mm: use correct section size macro to describe the FDT virtual address 2021-05-19 10:13:18 +02:00
mmu.h
…
mmu_context.h
…
module.h ARM: 9079/1: ftrace: Add MODULE_PLTS support 2021-09-26 14:08:56 +02:00
module.lds.h kbuild: preprocess module linker script 2020-09-25 00:36:41 +09:00
mpu.h
…
mtd-xip.h
…
neon.h
…
nwflash.h
…
opcodes-sec.h
…
opcodes-virt.h
…
opcodes.h
…
outercache.h
…
page-nommu.h
…
page.h
…
paravirt.h
…
patch.h
…
pci.h
…
percpu.h ARM: percpu.h: fix build error 2020-07-30 13:01:04 -07:00
perf_event.h
…
pgalloc.h asm-generic: pgalloc: provide generic pgd_free() 2020-08-07 11:33:26 -07:00
pgtable-2level-hwdef.h
…
pgtable-2level-types.h
…
pgtable-2level.h arch: pgtable: define MAX_POSSIBLE_PHYSMEM_BITS where needed 2020-11-16 16:57:18 +01:00
pgtable-3level-hwdef.h
…
pgtable-3level-types.h
…
pgtable-3level.h arch: pgtable: define MAX_POSSIBLE_PHYSMEM_BITS where needed 2020-11-16 16:57:18 +01:00
pgtable-hwdef.h
…
pgtable-nommu.h
…
pgtable.h
…
probes.h
…
proc-fns.h
…
processor.h
…
procinfo.h
…
prom.h ARM: 9011/1: centralize phys-to-virt conversion of DT/ATAGS address 2021-05-19 10:13:18 +02:00
psci.h
…
ptdump.h
…
ptrace.h ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction 2022-07-21 21:20:00 +02:00
sections.h
…
secure_cntvoff.h
…
set_memory.h
…
setup.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
shmparam.h
…
signal.h
…
smp.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
smp_plat.h
…
smp_scu.h
…
smp_twd.h
…
sparsemem.h
…
spectre.h ARM: Spectre-BHB: provide empty stub for non-config 2022-03-16 14:16:01 +01:00
spinlock.h
…
spinlock_types.h
…
stackprotector.h
…
stacktrace.h
…
string.h
…
suspend.h
…
swab.h
…
switch_to.h
…
sync_bitops.h
…
syscall.h
…
system_info.h
…
system_misc.h
…
tcm.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
therm.h
…
thread_info.h
…
thread_notify.h
…
timex.h arm: use fallback for random_get_entropy() instead of zero 2022-05-30 09:33:41 +02:00
tlb.h mm: account PMD tables like PTE tables 2020-10-13 18:38:31 -07:00
tlbflush.h
…
tls.h
…
topology.h arm: disable frequency invariance for CONFIG_BL_SWITCHER 2020-10-08 17:17:27 +02:00
traps.h
…
uaccess-asm.h
…
uaccess.h ARM: 9132/1: Fix __get_user_check failure with ARM KASAN images 2021-11-02 19:48:17 +01:00
ucontext.h
…
unaligned.h
…
unified.h
…
unistd.h
…
unwind.h
…
uprobes.h
…
user.h
…
v7m.h
…
vdso.h
…
vdso_datapage.h
…
vermagic.h
…
vfp.h
…
vfpmacros.h
…
vga.h
…
virt.h
…
vmalloc.h
…
vmlinux.lds.h ARM: Do not use NOCROSSREFS directive with ld.lld 2022-03-11 12:11:53 +01:00
word-at-a-time.h
…
xor.h
…