From patchwork Thu May 9 12:28:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13659722 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 78179C25B4F for ; Thu, 9 May 2024 12:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8fD4PcfVyq9HdTBLVHxUwXJlRDxt+7H+bfw+b67QFlA=; b=ziIsD/D/LEagal 3/WLBMOCMzU0bJZAlyXHWhauNMTZB88Jlueb0a9UexBx5IJIYregoWoqr3dOIov8EL4RBvEMYOUPu 4IHPg+7BsmGvk9J8mFFknqpD3rHIR5IejZJLoXR0n2VizjKfbYJFct4MRFm05jY4MGz32yNfVhACt wBMnovc0okqG3x/nAiQJz+JzL+u7d/8HP+jy+OQmhNcL0evapR0jc70BFfvsiyn1LhArazG33dS9L 8PifehJccA7nfHN3/ZbnPaMQe8W5gHC9Qh0GGzvnfKAvRr584qnTIifjCzZdt73zJNk+AYjcJ/+L7 kyAzajOhlaoV0VAdn5/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s52tR-00000001Qp5-2cI3; Thu, 09 May 2024 12:29:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s52tN-00000001Qnt-3ST3 for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2024 12:28:59 +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 0C05A106F; Thu, 9 May 2024 05:29:18 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AA1F73F6A8; Thu, 9 May 2024 05:28:51 -0700 (PDT) From: Ryan Roberts To: Catalin Marinas , Will Deacon , Anshuman Khandual Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, kernel test robot Subject: [PATCH v1] arm64/mm: Fix pud_user_accessible_page() for PGTABLE_LEVELS <= 2 Date: Thu, 9 May 2024 13:28:42 +0100 Message-ID: <20240509122844.563320-1-ryan.roberts@arm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240509_052857_942768_F88D6634 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. 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 The recent change to use pud_valid() as part of the implementation of pud_user_accessible_page() fails to build when PGTABLE_LEVELS <= 2 because pud_valid() is not defined in that case. Fix this by defining pud_valid() to false for this case. This means that pud_user_accessible_page() will correctly always return false for this config. Fixes: f0f5863a0fb0 ("arm64/mm: Remove PTE_PROT_NONE bit") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405082221.43rfWxz5-lkp@intel.com/ Signed-off-by: Ryan Roberts --- arch/arm64/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) -- 2.43.0 diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 78fd3e2ef8c6..bde9fd179388 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -814,6 +814,7 @@ static inline pmd_t *pud_pgtable(pud_t pud) #else +#define pud_valid(pud) false #define pud_page_paddr(pud) ({ BUILD_BUG(); 0; }) #define pud_user_exec(pud) pud_user(pud) /* Always 0 with folding */