On Sat, Aug 09, 2025 at 09:53:56PM +0800, Wei-Lin Chang wrote:
The attribute masks and test values in the ptdump code are meant for
individual attributes, however for stage-2 ptdump we included PTE_VALID
while testing for R, W, X, and AF. This led to some confusion and the
flipped output for the executable attribute.
Remove PTE_VALID from all attribute masks and values so that each test
matches only the relevant bits.
Additionally, the executable attribute printing is updated to align with
stage-1 ptdump, printing "NX" for non-executable regions and "x " for
executable ones.
Suggested-by: Anshuman Khandual <redacted>
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Suggested-by: Sebastian Ene <redacted>
Signed-off-by: Wei-Lin Chang <redacted>
---
Tested on QEMU.
Changes in v2, thanks to those listed in the Suggested-by tags:
- remove PTE_VALID from .mask and .val
- make executable attribute output format identical to stage-1 ptdump
- Link to v1: https://lore.kernel.org/kvmarm/20250802104021.3076621-1-r09922117@csie.ntu.edu.tw/ (local)
---
arch/arm64/kvm/ptdump.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
Acked-by: Will Deacon <will@kernel.org>
I assume Oliver or Marc will pick this up via the kvmarm tree.
Cheers,
Will