arm64: ptdump: Deal with translation levels folded at runtime
authorArd Biesheuvel <ardb@kernel.org>
Wed, 14 Feb 2024 12:29:24 +0000 (13:29 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 16 Feb 2024 12:42:42 +0000 (12:42 +0000)
commitd40900fcb39700207823486ca512a1a87d6331e2
treebd634a16a19f696a54e06388f03d126978eb8567
parent16f22981b6d7ea6815d2e4527b82cac5e2f65c89
arm64: ptdump: Deal with translation levels folded at runtime

Currently, the ptdump code deals with folded PMD or PUD levels at build
time, by omitting those levels when invoking note_page. IOW, note_page()
is never invoked with level == 1 if P4Ds are folded in the build
configuration.

With the introduction of LPA2 support, we will defer some of these
folding decisions to runtime, so let's take care of this by overriding
the 'level' argument when this condition triggers.

Substituting the PUD or PMD strings for "PGD" when the level in question
is folded at build time is no longer necessary, and so the conditional
expressions can be simplified. This also makes the indirection of the
'name' field unnecessary, so change that into a char[] array, and make
the whole thing __ro_after_init.

Note that the mm_p?d_folded() functions currently ignore their mm
pointer arguments, but let's wire them up correctly anyway.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240214122845.2033971-83-ardb+git@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/ptdump.c