• Ard Biesheuvel's avatar
    arm64: ptdump: Deal with translation levels folded at runtime · d40900fc
    Ard Biesheuvel authored
    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: default avatarArd Biesheuvel <ardb@kernel.org>
    Link: https://lore.kernel.org/r/20240214122845.2033971-83-ardb+git@google.comSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    d40900fc
ptdump.c 8.56 KB