From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40757C87FCA for ; Sun, 3 Aug 2025 14:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sTxu5Wj1xTqiRrL4lV4jupBd3ExvVnoW21PMyIXwdCc=; b=CFRFGz8Z6nYVoP13C9Ooiea9wj ZlKCZWMigiW0PranCQ3M970MvUjwjHb45ulZySTtotfCz70GYI6rreES09g6PDPvVRKwzkg+H/kOk LR8/GJ/60R5wgxccH99aqN1TKM0+Zw8xg1vV4No6bK7U9eV+YVrZg+enP0leaLKg76xmspRcQ8JCZ C5ETxkt1ysiX22vldF5379qxgdRlaoVdVAYfdA77LP+ZKXLe/23kH9PXNbL7ozPbmMX0hNw5O3fio Wr01w9WBNDmvsS/Djvu+K27XPAobh8bHt0ur4KBc3rG44Hehm2lrXRRwEn/eaFzCITuI1AI2sLMY/ 3py8cz9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uiZLV-00000008l5U-0nRa; Sun, 03 Aug 2025 14:05:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uiZIx-00000008kzU-255F for linux-arm-kernel@lists.infradead.org; Sun, 03 Aug 2025 14:03:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2BDFB150C; Sun, 3 Aug 2025 07:03:04 -0700 (PDT) Received: from [10.163.64.130] (unknown [10.163.64.130]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 190E63F5A1; Sun, 3 Aug 2025 07:03:07 -0700 (PDT) Message-ID: Date: Sun, 3 Aug 2025 19:33:04 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] KVM: arm64: ptdump: Fix exec attribute printing To: Wei-Lin Chang , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Marc Zyngier , Oliver Upton , Joey Gouly , Sebastian Ene , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon References: <20250802104021.3076621-1-r09922117@csie.ntu.edu.tw> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20250802104021.3076621-1-r09922117@csie.ntu.edu.tw> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250803_070315_581458_4BC645B0 X-CRM114-Status: GOOD ( 15.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > --- > 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.