]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64: mm: Represent physical memory with phys_addr_t and resource_size_t
authorSam Edwards <cfsworks@gmail.com>
Thu, 4 Sep 2025 00:52:09 +0000 (17:52 -0700)
committerWill Deacon <will@kernel.org>
Tue, 16 Sep 2025 19:39:49 +0000 (20:39 +0100)
commitb868fff5b10b6d09506e93e489ee19166bf6c5d2
treeb7dc33277ae0ca23cfc12b7fcb4a781b8223e130
parentc56aa9a67a0853ffcf64ebe7f1dbe5a5a7c315cc
arm64: mm: Represent physical memory with phys_addr_t and resource_size_t

This is a type-correctness cleanup to MMU/boot code that replaces
several instances of void * and u64 with phys_addr_t (to represent
addresses) and resource_size_t (to represent sizes) to emphasize that
the code in question concerns physical memory specifically.

The rationale for this change is to improve clarity and readability in
a few modules that handle both types (physical and virtual) of address
and differentiation is essential.

I have left u64 in cases where the address may be either physical or
virtual, where the address is exclusively virtual but used in heavy
pointer arithmetic, and in cases I may have overlooked. I do not
necessarily consider u64 the ideal type in those situations, but it
avoids breaking existing semantics in this cleanup.

This patch provably has no effect at runtime: I have verified that
.text of vmlinux is identical after this change.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/pi/map_kernel.c
arch/arm64/kernel/pi/map_range.c
arch/arm64/kernel/pi/pi.h
arch/arm64/mm/init.c
arch/arm64/mm/mmu.c