From nobody Tue Apr 7 01:55:53 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49F42C433F5 for ; Sun, 9 Oct 2022 17:31:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbiJIRbg (ORCPT ); Sun, 9 Oct 2022 13:31:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbiJIRbd (ORCPT ); Sun, 9 Oct 2022 13:31:33 -0400 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1498F2610A for ; Sun, 9 Oct 2022 10:31:30 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4MlpxX3ZsJz9t4C; Sun, 9 Oct 2022 19:31:28 +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 KcTURc9U1h5g; Sun, 9 Oct 2022 19:31:28 +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 4MlpxX2pXcz9snc; Sun, 9 Oct 2022 19:31:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4FEE48B770; Sun, 9 Oct 2022 19:31:28 +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 R4LggZwx4-Zh; Sun, 9 Oct 2022 19:31:28 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.232.15]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2659E8B767; Sun, 9 Oct 2022 19:31:28 +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 299HVHIe750018 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 9 Oct 2022 19:31:17 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 299HVGv0750015; Sun, 9 Oct 2022 19:31:16 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Michael Ellerman , Nicholas Piggin Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc: Use swapper_pg_dir instead of init_mm->pgd Date: Sun, 9 Oct 2022 19:31:05 +0200 Message-Id: <9792b4281cae63e9c5692951b0ff2da14cfef79b.1665336655.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1665336663; l=875; s=20211009; h=from:subject:message-id; bh=pLVlLp6cQz2Sk70ufJdb24H6byBNfUxOLSMwc2ttIyg=; b=59zIGlmaUG958zUNnAn2+/5aGsOfXO3BWbAp6c9aSS0bRH5QlUvkRocne93+MqvCUPewm87La5OB +yw2CZVtCkYvl+1ptsov7idTlmy0p537giO+tSjdvPVdO9/lFSHu X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" init_mm->pgd is always swapper_pg_dir[] which is known at build time. Directly use the later instead of loading it from init_mm struct at every time. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pgtable.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/= pgtable.h index 283f40d05a4d..f6843e6294d9 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h @@ -48,6 +48,9 @@ struct mm_struct; /* Keep these as a macros to avoid include dependency mess */ #define pte_page(x) pfn_to_page(pte_pfn(x)) #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) + +#define pgd_offset_k(address) pgd_offset_pgd(swapper_pg_dir, (address)) + /* * Select all bits except the pfn */ --=20 2.37.1