Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5649900iog; Thu, 23 Jun 2022 02:33:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tvLrdsnVNepsKcEKFxXmJCRWnK/2fcMfCiK4Gh2YnY0nS4uVCKS9E4t99UzgCct1scKI0p X-Received: by 2002:a17:907:86ac:b0:708:9c4a:c6e9 with SMTP id qa44-20020a17090786ac00b007089c4ac6e9mr7272870ejc.297.1655976805732; Thu, 23 Jun 2022 02:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655976805; cv=none; d=google.com; s=arc-20160816; b=mplxQO6rHUV5uHyIhsXLsuuTiWclnLm9jx6Mu0YOlTuHz+HRL8HSCXUS9frda5Dm1s GagbH5Fs3jpf2FT+mv3dzILJzuPnFqiGUS492WQTjwjtYns/eeXg5puZIXpbpc8t0mQ/ gw3MljmI6suKwcFWMZRVBa/YNMNfVpyfSF8WU5Tz6wjuPZ63F177mxAIModBiF8yyUDQ I2Jo1JTiVqkL33SEYmy52qx5JYtj5DS//qkvTJn4UWXeMFSa41LWH4M0EBicu3HZtSTM BY7mLhc99K/NVeXseGzhCQHT7v0m+ejGdAAMcI6jhsClscFPAFDPY/tvkMvtoXlTiL4K MFjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5s/oxuXPDf9t5uiulcRowqqzQO6sMoZ3nw2hPTIJHJU=; b=sUQs9CTWWcIHxyolmdSRlKHFPuEiNCoWsDcFdWEcn8Q7e8jjZ2DdDJEUpncA72Wq5r rsZ86r9r8S4WQ4t5+RDOUGPtkx8NCMbF0Q7CSrY7I3yBfqO2HSZWUBYBHI5Yn7bGWT4K lMdoQcpyBBLJsItZt9jJTi+D06WjHf+NaXEOfX/VEE/xKItHugn2qEHPDrokrZGE0kOz 6bSZNxjCkFa1bstHr2QCGv3HtLhrO/yQQHWSLeM4fpf0OOXXV1ClllJut2vug7J1YoYW HkJ6Pe3iR4uQWA3dUCN6r7JRunSoYrmD3BwokEqSFa9jXQZ407PAlXhdwXaRUUNlvuO1 Crsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn20-20020a17090794d400b00722d8f4431bsi11945025ejc.618.2022.06.23.02.32.58; Thu, 23 Jun 2022 02:33:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231137AbiFWI52 (ORCPT + 99 others); Thu, 23 Jun 2022 04:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbiFWI5Y (ORCPT ); Thu, 23 Jun 2022 04:57:24 -0400 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 865794666D for ; Thu, 23 Jun 2022 01:57:23 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4LTDfB1kRcz9t7C; Thu, 23 Jun 2022 10:57:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gTSDzbELHdlg; Thu, 23 Jun 2022 10:57:22 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4LTDfB0zTBz9t6Q; Thu, 23 Jun 2022 10:57:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1025B8B781; Thu, 23 Jun 2022 10:57:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id UExh2KMkcgMT; Thu, 23 Jun 2022 10:57:22 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.232.34]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C59898B763; Thu, 23 Jun 2022 10:57:21 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 25N8v8mv1200361 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 23 Jun 2022 10:57:08 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 25N8v8Zu1200352; Thu, 23 Jun 2022 10:57:08 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Mike Rapoport Subject: [PATCH] powerpc/64e: Rewrite p4d_populate() as a static inline function Date: Thu, 23 Jun 2022 10:56:57 +0200 Message-Id: <1b416f8a8fe1bc3f4e01175680ce310b7eb3a1e4.1655974565.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1655974616; l=1044; s=20211009; h=from:subject:message-id; bh=mKWaYp2wYHt3KQiAnZHcT6REMirM2chYLoLkpYpljic=; b=MQlZhc2Xgg5B96C1oGtFDjruds80b3PLoSlBP03kpllyACQN3qzIcWzc4taMYbmIe8hKQ39NuZak 6ruITfp0A4djKYCaR9VN+Tx7dreqZ66+LaCO/2Gs3TaYz7bh8zzt X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rewrite p4d_populate() as a static inline function instead of a macro. This change allows typechecking and would have helped detecting a recently found bug in map_kernel_page(). Cc: Mike Rapoport Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/pgalloc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h index 668aee6017e7..e50b211becb3 100644 --- a/arch/powerpc/include/asm/nohash/64/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h @@ -15,7 +15,10 @@ struct vmemmap_backing { }; extern struct vmemmap_backing *vmemmap_list; -#define p4d_populate(MM, P4D, PUD) p4d_set(P4D, (unsigned long)PUD) +static inline void p4d_populate(struct mm_struct *mm, p4d_t *p4d, pud_t *pud) +{ + p4d_set(p4d, (unsigned long)pud); +} static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) { -- 2.36.1