]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
arm64: ptdump: Don't iterate kernel page tables using PTRS_PER_PXX
authorWill Deacon <will.deacon@arm.com>
Mon, 4 Feb 2019 14:37:38 +0000 (14:37 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 4 Feb 2019 14:37:38 +0000 (14:37 +0000)
commitd23c808c6fc6132e812690648e14c0d6b0cbe273
treec30e67be724ecd617c383d82e041d08314cfc59a
parent8834f5600cf3c8db365e18a3d5cac2c2780c81e5
arm64: ptdump: Don't iterate kernel page tables using PTRS_PER_PXX

When 52-bit virtual addressing is enabled for userspace
(CONFIG_ARM64_USER_VA_BITS_52=y), the kernel continues to utilise 48-bit
virtual addressing in TTBR1. Consequently, PTRS_PER_PGD reflects the
larger page table size for userspace and the pgd pointer for kernel page
tables is offset before being written to TTBR1.

This means that we can't use PTRS_PER_PGD to iterate over kernel page
tables unless we apply the same offset, which is fiddly to get right and
leads to some non-idiomatic walking code. Instead, just follow the usual
pattern when walking page tables by using a while loop driven by
pXd_offset() and pXd_addr_end().

Reported-by: Qian Cai <cai@lca.pw>
Tested-by: Qian Cai <cai@lca.pw>
Acked-by: Steve Capper <steve.capper@arm.com>
Tested-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/mm/dump.c