u-boot-brain/arch/arm/lib
Patrick Delaunay 54be09cd8f arm: caches: manage phys_addr_t overflow in mmu_set_region_dcache_behaviour
Solved the overflow on phys_addr_t type for start + size in
mmu_set_region_dcache_behaviour() function.

This overflow is avoided by dividing start and end by 2 before addition,
and we only expecting that start and size are even.

This patch doesn't change the current function behavior if the
parameters (start or size) are not aligned on MMU_SECTION_SIZE.

For example, this overflow occurs on ARM32 with:
start = 0xC0000000 and size = 0x40000000
then start + size = 0x100000000 and end = 0x0.

For information the function behavior change with risk of regression,
if we just shift start and size before the addition.
Example with 2MB section size:
  MMU_SECTION_SIZE 0x200000 and MMU_SECTION_SHIFT = 21
  with start = 0x1000000, size = 0x1000000,
  - with the proposed patch, start = 0 and end = 0x1 as previously
  - with the more simple patch:
    end = (start >> MMU_SECTION_SHIFT) + (size >> MMU_SECTION_SHIFT)
    the value of end change:
    start >> 21 = 0, size >> 21 = 0 and end = 0x0 !!!

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-05-01 11:34:01 -04:00
..
ashldi3.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ashrdi3.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
asm-offsets.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bootm-fdt.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bootm.c ARM: bootm: take into account gd->ram_top 2020-04-17 12:29:43 -04:00
cache-cp15.c arm: caches: manage phys_addr_t overflow in mmu_set_region_dcache_behaviour 2020-05-01 11:34:01 -04:00
cache-pl310.c ARM: cache: Fix incorrect bitwise operation 2019-02-28 14:21:46 -05:00
cache.c common/board_f: Make reserve_mmu generic 2020-04-24 15:17:14 -04:00
ccn504.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
cmd_boot.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
crt0_64.S spl: separate SPL_FRAMEWORK config for spl and tpl 2019-11-17 17:22:53 +08:00
crt0_aarch64_efi.S efi_loader: use predefined constants in crt0_*_efi.S 2019-07-16 22:17:14 +00:00
crt0_arm_efi.S efi_loader: use predefined constants in crt0_*_efi.S 2019-07-16 22:17:14 +00:00
crt0.S arm: set the relocated gd with gd->new_gd 2020-04-16 23:06:54 -04:00
debug.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
div64.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
div0.c common: Move hang() to the same header as panic() 2020-01-17 17:53:40 -05:00
eabi_compat.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
elf_aarch64_efi.lds SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
elf_arm_efi.lds SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gic_64.S arm64: gic: Do gicv3 secure initialization based on EL level 2018-10-16 14:58:46 +02:00
gic-v3-its.c arch: arm: Fix SZ_64K undeclared compilation error 2020-02-25 11:39:54 -05:00
image.c ARM: image: Add option for ignoring ep bit 3 2018-06-19 07:31:45 -04:00
interrupts_64.c common: Move interrupt functions into a new header 2019-12-02 18:25:00 -05:00
interrupts_m.c common: Move reset_cpu() to the CPU header 2020-01-17 14:02:31 -05:00
interrupts.c common: Move reset_cpu() to the CPU header 2020-01-17 14:02:31 -05:00
lib1funcs.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lshrdi3.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile arch: arm: Program GIC LPI configuration table 2020-01-10 14:18:26 -05:00
memcpy.S arm: Make arch specific memcpy thumb-safe. 2018-11-16 16:51:57 -05:00
memset.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
muldi3.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
psci-dt.c ARM: PSCI: Enable the PSCI node 2018-07-26 13:15:30 -07:00
reloc_aarch64_efi.c arm: Remove unused _relocate arguments 2018-07-19 16:31:36 -04:00
reloc_arm_efi.c arm: Remove unused _relocate arguments 2018-07-19 16:31:36 -04:00
relocate_64.S common: Move relocate_code() to init.h 2020-01-17 13:26:49 -05:00
relocate.S arm: armv7m: clean up armv7m unified code compilation 2018-09-10 21:19:33 -04:00
reset.c common: Move reset_cpu() to the CPU header 2020-01-17 14:02:31 -05:00
sections.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
semihosting.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
setjmp_aarch64.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
setjmp.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spl.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
stack.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
uldivmod.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
vectors_m.S arm: armv7m: clean up armv7m unified code compilation 2018-09-10 21:19:33 -04:00
vectors.S arm: remove ARCH_ROCKCHIP macro in common code 2019-05-08 17:34:12 +08:00
zimage.c arm: zimage: add barebox image magic number 2019-05-09 20:21:59 -04:00