]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arm64/mm: Define PTDESC_ORDER
authorAnshuman Khandual <anshuman.khandual@arm.com>
Tue, 11 Mar 2025 04:57:10 +0000 (10:27 +0530)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 14 Mar 2025 17:01:23 +0000 (17:01 +0000)
commit51ecb29f7a6518aeb5beeaa7ac433fe62ca3dc4d
treef07784df18b906572bb4903bc91e8b4815a7c05a
parentbf25266f83821697dc5cc3571ff5e079840db027
arm64/mm: Define PTDESC_ORDER

Address bytes shifted with a single 64 bit page table entry (any page table
level) has been always hard coded as 3 (aka 2^3 = 8). Although intuitive it
is not very readable or easy to reason about. Besides it is going to change
with D128, where each 128 bit page table entry will shift address bytes by
4 (aka 2^4 = 16) instead.

Let's just formalise this address bytes shift value into a new macro called
PTDESC_ORDER establishing a logical abstraction, thus improving readability
as well. While here re-organize EARLY_LEVEL macro along with its dependents
for better clarity. This does not cause any functional change. Also replace
all (PAGE_SHIFT - PTDESC_ORDER) instances with PTDESC_TABLE_SHIFT.

Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: kasan-dev@googlegroups.com
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20250311045710.550625-1-anshuman.khandual@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/Kconfig
arch/arm64/include/asm/kernel-pgtable.h
arch/arm64/include/asm/pgtable-hwdef.h
arch/arm64/kernel/pi/map_range.c
arch/arm64/mm/kasan_init.c