From nobody Mon Feb 9 05:41:21 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05BC81F9ED8 for ; Mon, 2 Dec 2024 08:39:00 +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=1733128743; cv=none; b=k+MbFBM8bsiH2JH1Fo9kFHHh836ulqhzdLAwOCo5YRgiSFTi1tB8Z9mreJQTXYo26sLQIMLnteYaEHsyOJe6IkfIahShf2jY3gA4OIziM4tzpw4B+s20lrvJGY7F+xfnNNE4YLV7zTn/ctrp1xMkYDq2CqAQWePDnf8fKnLcmlQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733128743; c=relaxed/simple; bh=hEGdud7c7bh/jYjcv1q0/EyBkdfRmz9jOoUwNelxMPc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=JqbB4F22T3lcWXkR5e5UUsQ50PUk7+C+Mu0A3M2V3t/v3tLZL+0KZrqWD5GO5UMSi/A/NM8KsIMMGdMn9xpq9+xny8iSDmf/82yzWogPIMvMEIDjIFFM/Jzn2JccJusevfs6gyevbl9rVEVF02pCikiaWSqDVxRXRA900N7hhGo= 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 B5C891063; Mon, 2 Dec 2024 00:39:28 -0800 (PST) Received: from a077893.blr.arm.com (a077893.blr.arm.com [10.162.16.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8E1733F58B; Mon, 2 Dec 2024 00:38:57 -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/mm: Replace open encodings with PXD_TABLE_BIT Date: Mon, 2 Dec 2024 14:08:50 +0530 Message-Id: <20241202083850.73207-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" [pgd|p4d]_bad() helpers have open encodings for their respective table bits which can be replaced with corresponding macros. This makes things clearer, thus improving their readability as well. 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 Reviewed-by: Gavin Shan Reviewed-by: Ryan Roberts --- This patch applies on v6.13-rc1 arch/arm64/include/asm/pgtable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgta= ble.h index 6986345b537a..e20b80229910 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -896,7 +896,7 @@ static inline bool mm_pud_folded(const struct mm_struct= *mm) pr_err("%s:%d: bad pud %016llx.\n", __FILE__, __LINE__, pud_val(e)) =20 #define p4d_none(p4d) (pgtable_l4_enabled() && !p4d_val(p4d)) -#define p4d_bad(p4d) (pgtable_l4_enabled() && !(p4d_val(p4d) & 2)) +#define p4d_bad(p4d) (pgtable_l4_enabled() && !(p4d_val(p4d) & P4D_TABLE_= BIT)) #define p4d_present(p4d) (!p4d_none(p4d)) =20 static inline void set_p4d(p4d_t *p4dp, p4d_t p4d) @@ -1023,7 +1023,7 @@ static inline bool mm_p4d_folded(const struct mm_stru= ct *mm) pr_err("%s:%d: bad p4d %016llx.\n", __FILE__, __LINE__, p4d_val(e)) =20 #define pgd_none(pgd) (pgtable_l5_enabled() && !pgd_val(pgd)) -#define pgd_bad(pgd) (pgtable_l5_enabled() && !(pgd_val(pgd) & 2)) +#define pgd_bad(pgd) (pgtable_l5_enabled() && !(pgd_val(pgd) & PGD_TABLE_= BIT)) #define pgd_present(pgd) (!pgd_none(pgd)) =20 static inline void set_pgd(pgd_t *pgdp, pgd_t pgd) --=20 2.30.2