mirror-linux/arch/arm64/kernel/pi
Anshuman Khandual 51ecb29f7a 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>
2025-03-14 17:01:23 +00:00
..
.gitignore arm64: gitignore: ignore relacheck 2024-02-22 21:57:52 +00:00
Makefile Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
idreg-override.c arm64/mm: Override PARange for !LPA2 and use it consistently 2024-12-19 17:23:52 +00:00
kaslr_early.c arm64: head: Move early kernel mapping routines into C code 2024-02-16 12:42:33 +00:00
map_kernel.c arm64/mm: Override PARange for !LPA2 and use it consistently 2024-12-19 17:23:52 +00:00
map_range.c arm64/mm: Define PTDESC_ORDER 2025-03-14 17:01:23 +00:00
patch-scs.c arm64/scs: Deal with 64-bit relative offsets in FDE frames 2024-11-08 16:37:55 +00:00
pi.h arm64: Enable LPA2 at boot if supported by the system 2024-02-16 12:42:40 +00:00
relacheck.c arm64: kernel: Manage absolute relocations in code built under pi/ 2024-02-16 12:42:28 +00:00
relocate.c arm64: head: Move early kernel mapping routines into C code 2024-02-16 12:42:33 +00:00