[lkml]   [2021]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v12] ARM: uncompress: Validate start of physical memory against passed DTB
04.01.2021 16:01, Geert Uytterhoeven пишет:
> Currently, the start address of physical memory is obtained by masking
> the program counter with a fixed mask of 0xf8000000. This mask value
> was chosen as a balance between the requirements of different platforms.
> However, this does require that the start address of physical memory is
> a multiple of 128 MiB, precluding booting Linux on platforms where this
> requirement is not fulfilled.
> Fix this limitation by validating the masked address against the memory
> information in the passed DTB. Only use the start address
> from DTB when masking would yield an out-of-range address, prefer the
> traditional method in all other cases. Note that this applies only to the
> explicitly passed DTB on modern systems, and not to a DTB appended to
> the kernel, or to ATAGS. The appended DTB may need to be augmented by
> information from ATAGS, which may need to rely on knowledge of the start
> address of physical memory itself.
> This allows to boot Linux on r7s9210/rza2mevb using the 64 MiB of SDRAM
> on the RZA2MEVB sub board, which is located at 0x0C000000 (CS3 space),
> i.e. not at a multiple of 128 MiB.
> Suggested-by: Nicolas Pitre <>
> Suggested-by: Ard Biesheuvel <>
> Signed-off-by: Geert Uytterhoeven <>
> Reviewed-by: Ard Biesheuvel <>
> Acked-by: Nicolas Pitre <>
> ---
> Submitted to RMK's patch tracker.
> v12:
> - Drop unneeded initialization of r in get_val(),

I tested this patch on NVIDIA Tegra and haven't spotted any problems.

Tested-by: Dmitry Osipenko <>

 \ /
  Last update: 2021-01-09 18:30    [W:0.084 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site