From nobody Sun Nov 24 13:33:06 2024 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D129818EAD for ; Tue, 5 Nov 2024 04:42:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730781735; cv=none; b=HMkForlgIYZOo01PYQnyM33p6gd5GMtn5W8ZM+GNyKt7HPlaOV0540rH6z//yiDdkEg+1XpFFClWsA2vfX8kd7whVVGsn+HW7CK02Ulv0kjmpgWccWi8cBGQjrfcqxEVT6CsdM0R5qr+Huaac10SAkepOSTE8V13v+GHgDKFW/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730781735; c=relaxed/simple; bh=KYdKWG+4BlRhbZlGabYii9qMbqXI/8M3GyffK2NTq7M=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=tc200O/AD2I2GAvud5t9v9ycF/slnRSrN6w05AXrzqX2WEQeXHTqxAEjQ7/WvKw3aVSJBpdHqIK5A2b3SAjsTVh05QHVRQSGIl7RUpBe+r7OQ3l09MyHqS7NwD0FkgaIh7zgq6ltjBVYNI2128w+c5Yno75mUVyAgzKWPtJev7M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 D8F5DFEC; Mon, 4 Nov 2024 20:42:35 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.45.103]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3F5073F66E; Mon, 4 Nov 2024 20:42:00 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , Ard Biesheuvel , Ryan Roberts , Mark Rutland , linux-kernel@vger.kernel.org Subject: [PATCH] arm64/ptdump: Test both PTE_TABLE_BIT and PTE_VALID for block mappings Date: Tue, 5 Nov 2024 10:11:54 +0530 Message-Id: <20241105044154.4064181-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Test both PTE_TABLE_BIT and PTE_VALID for block mappings, similar to KVM S2 ptdump. This ensures consistency in identifying block mappings, both in the S1 and the S2 page tables. Besides being kernel page tables, there will not be any unmapped (!PTE_VALID) block mappings. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: Ryan Roberts Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This patch applies on v6.12-rc6 arch/arm64/mm/ptdump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c index 264c5f9b97d8..688fbe0271ca 100644 --- a/arch/arm64/mm/ptdump.c +++ b/arch/arm64/mm/ptdump.c @@ -80,10 +80,10 @@ static const struct ptdump_prot_bits pte_bits[] =3D { .set =3D "CON", .clear =3D " ", }, { - .mask =3D PTE_TABLE_BIT, - .val =3D PTE_TABLE_BIT, - .set =3D " ", - .clear =3D "BLK", + .mask =3D PTE_TABLE_BIT | PTE_VALID, + .val =3D PTE_VALID, + .set =3D "BLK", + .clear =3D " ", }, { .mask =3D PTE_UXN, .val =3D PTE_UXN, --=20 2.30.2