[PATCH v2] KVM: arm64: ptdump: Don't test PTE_VALID alongside other attributes

Will Deacon will at kernel.org
Mon Sep 8 07:19:00 PDT 2025


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 <anshuman.khandual at arm.com>
> Suggested-by: Mark Rutland <mark.rutland at arm.com>
> Suggested-by: Sebastian Ene <sebastianene at google.com>
> Signed-off-by: Wei-Lin Chang <r09922117 at csie.ntu.edu.tw>
> ---
> 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/
> ---
>  arch/arm64/kvm/ptdump.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)

Acked-by: Will Deacon <will at kernel.org>

I assume Oliver or Marc will pick this up via the kvmarm tree.

Cheers,

Will



More information about the linux-arm-kernel mailing list