From: Anshuman Khandual Date: Tue, 5 Nov 2024 04:41:54 +0000 (+0530) Subject: arm64/ptdump: Test both PTE_TABLE_BIT and PTE_VALID for block mappings X-Git-Tag: v6.13-rc1~203^2~2^6~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dc9b74a76320dd87335956f27f09791fa922ea9b;p=thirdparty%2Fkernel%2Flinux.git arm64/ptdump: Test both PTE_TABLE_BIT and PTE_VALID for block mappings Test both PTE_TABLE_BIT and PTE_VALID for block mappings, similar to KVM S2 ptdump. This ensures consistency in identifying block mappings, both in the S1 and the S2 page tables. Besides being kernel page tables, there will not be any unmapped (!PTE_VALID) block mappings. Cc: Will Deacon Cc: Ard Biesheuvel Cc: Ryan Roberts Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/20241105044154.4064181-1-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas --- diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c index 264c5f9b97d86..688fbe0271ca4 100644 --- a/arch/arm64/mm/ptdump.c +++ b/arch/arm64/mm/ptdump.c @@ -80,10 +80,10 @@ static const struct ptdump_prot_bits pte_bits[] = { .set = "CON", .clear = " ", }, { - .mask = PTE_TABLE_BIT, - .val = PTE_TABLE_BIT, - .set = " ", - .clear = "BLK", + .mask = PTE_TABLE_BIT | PTE_VALID, + .val = PTE_VALID, + .set = "BLK", + .clear = " ", }, { .mask = PTE_UXN, .val = PTE_UXN,