[PATCH v2] arm64/mm: use lm_alias() with addresses passed to memblock_free()

Will Deacon will at kernel.org
Fri Sep 6 05:29:27 PDT 2024


On Thu, 05 Sep 2024 16:29:35 +0100, Joey Gouly wrote:
> The pointer argument to memblock_free() needs to be a linear map address, but
> in mem_init() we pass __init_begin/__init_end, which is a kernel image address.
> 
> This results in warnings when building with CONFIG_DEBUG_VIRTUAL=y:
> 
>     virt_to_phys used for non-linear address: ffff800081270000 (set_reset_devices+0x0/0x10)
>     WARNING: CPU: 0 PID: 1 at arch/arm64/mm/physaddr.c:12 __virt_to_phys+0x54/0x70
>     Modules linked in:
>     CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.11.0-rc6-next-20240905 #5810 b1ebb0ad06653f35ce875413d5afad24668df3f3
>     Hardware name: FVP Base RevC (DT)
>     pstate: 2161402005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
>     pc : __virt_to_phys+0x54/0x70
>     lr : __virt_to_phys+0x54/0x70
>     sp : ffff80008169be20
>     ...
>     Call trace:
>      __virt_to_phys+0x54/0x70
>      memblock_free+0x18/0x30
>      free_initmem+0x3c/0x9c
>      kernel_init+0x30/0x1cc
>      ret_from_fork+0x10/0x20
> 
> [...]

Applied to arm64 (for-next/mm), thanks!

[1/1] arm64/mm: use lm_alias() with addresses passed to memblock_free()
      https://git.kernel.org/arm64/c/c02e7c5c6da8

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list