From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Wei-Lin Chang <r09922117@csie.ntu.edu.tw>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
Joey Gouly <joey.gouly@arm.com>,
Sebastian Ene <sebastianene@google.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Subject: Re: [PATCH] KVM: arm64: ptdump: Fix exec attribute printing
Date: Sun, 3 Aug 2025 19:33:04 +0530 [thread overview]
Message-ID: <d72b7928-8646-4616-a8f0-96b9d9bbaf09@arm.com> (raw)
In-Reply-To: <20250802104021.3076621-1-r09922117@csie.ntu.edu.tw>
On 02/08/25 4:10 PM, Wei-Lin Chang wrote:
> Currently the guest stage-2 page table dump has the executable attribute
> printed in reverse, showing "X" for a non-executable region and showing
> " " for an executable one. This is caused by misjudgement of which
> string gets printed for the executable and non-executable case. Fix it
> by swapping the two strings.
>
> Signed-off-by: Wei-Lin Chang <r09922117@csie.ntu.edu.tw>
> ---
> arch/arm64/kvm/ptdump.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kvm/ptdump.c b/arch/arm64/kvm/ptdump.c
> index 098416d7e5c25..99fc13f1c11fb 100644
> --- a/arch/arm64/kvm/ptdump.c
> +++ b/arch/arm64/kvm/ptdump.c
> @@ -44,8 +44,8 @@ static const struct ptdump_prot_bits stage2_pte_bits[] = {
> }, {
> .mask = KVM_PTE_LEAF_ATTR_HI_S2_XN | PTE_VALID,
> .val = PTE_VALID,
> - .set = " ",
> - .clear = "X",
> + .set = "X",
> + .clear = " ",
> }, {
> .mask = KVM_PTE_LEAF_ATTR_LO_S2_AF | PTE_VALID,
> .val = KVM_PTE_LEAF_ATTR_LO_S2_AF | PTE_VALID,
Is not KVM_PTE_LEAF_ATTR_HI_S2_XN already in the reverse semantics aka
XN (Execute Never). Hence when KVM_PTE_LEAF_ATTR_HI_S2_XN macro is set
that means the entry is not executable and vice versa.
next prev parent reply other threads:[~2025-08-03 14:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-02 10:40 Wei-Lin Chang
2025-08-03 14:03 ` Anshuman Khandual [this message]
2025-08-04 12:41 ` Wei-Lin Chang
2025-08-04 15:22 ` Mark Rutland
2025-08-04 23:40 ` Anshuman Khandual
2025-08-05 8:31 ` Sebastian Ene
2025-08-07 3:12 ` Wei-Lin Chang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d72b7928-8646-4616-a8f0-96b9d9bbaf09@arm.com \
--to=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=r09922117@csie.ntu.edu.tw \
--cc=sebastianene@google.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®