Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp383073rwi; Tue, 18 Oct 2022 19:40:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4cCjrnoe2zGnG0F/ck9Y9AEc99lZMt8GRcRZASWhKS6JzN2P3kYH0d2mlPoRdhutacLFWJ X-Received: by 2002:a17:90b:4a43:b0:20d:8948:1733 with SMTP id lb3-20020a17090b4a4300b0020d89481733mr41899461pjb.79.1666147246201; Tue, 18 Oct 2022 19:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666147246; cv=none; d=google.com; s=arc-20160816; b=KNTHKfoQ8p7xn8WyqE33hyMT9AEXuw/jDswZDNjUqASl8mwg0MLed/3BNdyQuvns2a uG+Zk2Xoy9kxvti2O1RTtz+wIyPyxt43onMR5eJDJ1OM1UT3kxGSk0Sjmqni6UnVLx7E pUQluZr+bQzAruqLhvzxp0CEYq6Q/tMbwHyy26r66s7ppFd7VaSTqc3wofH8R6/Q2yT3 TsaN4QQdp1JyxBAJp0OB0whs3bon6fPHZGRnz8/PZujTE0jjFTysJWPwtKvlDBgWuPKE xeh66uP50u1pQh5JPhMntibMaptbHbmJsXbgSl/8ckNJZXesj3WZQvPknK9Na+kDyBon k/bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0ezeiKiPVR6WhA3eM/1EHsakzN6uewjPvuH49EFlims=; b=rwD9DljVjBrc3tiDk2eCxS1UHa7rL1rT/JJQHDkOcHs+240GQJianfB/Z9GZT/hB3R sHf3aGG8QWKnYX6xxUmWrqMeQ5/OEIu80tovZseI3qB3bHRzvhvSPvpn5CA2F+eOvuko A/so/zCYhpo4ACriW1gTSM3lm3QRKIuMeoUTB/0mZymfptc+LetGrdBQCEg0rDqB/6Ls mh5ZQIEdWzRs9SoP7/UFuFIm0qrkflh1io3BxvOu/lkofPFXSZyxwjg7nIW5PvzvrmxU /UbOLUF4/DJ0i4Hd98XFze8OlaYpDwOZniUIXOQDTB84KIDDQ3YGRdnmcucKDQstJmEL g1eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hz2yl4Id; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a17090ab10200b00201d6d4cc79si21417829pjq.113.2022.10.18.19.40.34; Tue, 18 Oct 2022 19:40:46 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hz2yl4Id; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbiJSCAl (ORCPT + 99 others); Tue, 18 Oct 2022 22:00:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiJSCAj (ORCPT ); Tue, 18 Oct 2022 22:00:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54BBC9C7E2; Tue, 18 Oct 2022 19:00:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0AD46B821CF; Wed, 19 Oct 2022 02:00:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B34BEC43142; Wed, 19 Oct 2022 02:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666144835; bh=TCSW17AvKHdkoRbEkTskjv1Qo5Q/OxvcAE+xqUKV4UM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hz2yl4Id2b3n0774YtVIuKgTYQo3ezL3TMyAdSVbtuHTKfklHhxuGx88xZX1X4RZh 3sjMR9qNcG1/LOUCDLVF+Pf0Hx03JfvwFr5y4bGL47TR6vLIKN4u+AOEMgXwrY6FG5 rctrVP2SNH0TArAZOGDWD9bHynPTVUNRw45B/GhAwgVpBpQNUkzT2SOs2TYOzfrPl5 2X2xfwOFzh9NGzFg1r8s3YbbY9w7GO3JBrVIfi5l2VezlXiwQn5TwlmtXMo6vw0UiV oqEi4jsMU4IcE8qIxpW8I2+wIWe51CdUFAf1T5GTEQPZ1+IFASMdoY15+Y6cytojDQ VcxXQ7/F8OmBg== Received: by mail-ed1-f53.google.com with SMTP id r14so23130940edc.7; Tue, 18 Oct 2022 19:00:35 -0700 (PDT) X-Gm-Message-State: ACrzQf0i9gGyhFfE7om7M20YNOm7B8pWkczkP83m8y8BjTvwdswYEhgR PxKXwWKXZblfCGVwdTidMSEDLgTsjfXeZcXTt7U= X-Received: by 2002:aa7:df16:0:b0:45b:f51f:ab73 with SMTP id c22-20020aa7df16000000b0045bf51fab73mr5144349edy.366.1666144833892; Tue, 18 Oct 2022 19:00:33 -0700 (PDT) MIME-Version: 1.0 References: <20221017024027.2389370-1-chenhuacai@loongson.cn> <20221017024027.2389370-2-chenhuacai@loongson.cn> <95a0537f-27b2-adc9-d44e-527281326b0d@linaro.org> In-Reply-To: <95a0537f-27b2-adc9-d44e-527281326b0d@linaro.org> From: Huacai Chen Date: Wed, 19 Oct 2022 10:00:22 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V11 1/4] MIPS&LoongArch&NIOS2: Adjust prototypes of p?d_init() To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Cc: Huacai Chen , Arnd Bergmann , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , Dinh Nguyen , loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , Andrew Morton , linux-mm@kvack.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Feiyang Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Hi, Philippe, On Tue, Oct 18, 2022 at 9:29 PM Philippe Mathieu-Daud=C3=A9 wrote: > > On 17/10/22 04:40, Huacai Chen wrote: > > From: Feiyang Chen > > > > We are preparing to add sparse vmemmap support to LoongArch. MIPS and > > LoongArch need to call pgd_init()/pud_init()/pmd_init() when populating > > page tables, so adjust their prototypes to make generic helpers can cal= l > > them. > > > > NIOS2 declares pmd_init() but doesn't use, just remove it to avoid buil= d > > errors. > > > > Reviewed-by: Jiaxun Yang > > Signed-off-by: Feiyang Chen > > Signed-off-by: Huacai Chen > > --- > > arch/loongarch/include/asm/pgalloc.h | 13 ++----------- > > arch/loongarch/include/asm/pgtable.h | 8 ++++---- > > arch/loongarch/kernel/numa.c | 4 ++-- > > arch/loongarch/mm/pgtable.c | 23 +++++++++++++---------- > > arch/mips/include/asm/pgalloc.h | 10 +++++----- > > arch/mips/include/asm/pgtable-64.h | 8 ++++---- > > arch/mips/kvm/mmu.c | 3 +-- > > arch/mips/mm/pgtable-32.c | 10 +++++----- > > arch/mips/mm/pgtable-64.c | 18 ++++++++++-------- > > arch/mips/mm/pgtable.c | 2 +- > > arch/nios2/include/asm/pgalloc.h | 5 ----- > > 11 files changed, 47 insertions(+), 57 deletions(-) > > > diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c > > index 61891af25019..88819a21d97e 100644 > > --- a/arch/mips/mm/pgtable-32.c > > +++ b/arch/mips/mm/pgtable-32.c > > @@ -13,9 +13,9 @@ > > #include > > #include > > > > -void pgd_init(unsigned long page) > > +void pgd_init(void *addr) > > { > > - unsigned long *p =3D (unsigned long *) page; > > + unsigned long *p =3D (unsigned long *)addr; > > int i; > > > > for (i =3D 0; i < USER_PTRS_PER_PGD; i+=3D8) { > > @@ -61,9 +61,9 @@ void __init pagetable_init(void) > > #endif > > > > /* Initialize the entire pgd. */ > > - pgd_init((unsigned long)swapper_pg_dir); > > - pgd_init((unsigned long)swapper_pg_dir > > - + sizeof(pgd_t) * USER_PTRS_PER_PGD); > > + pgd_init(swapper_pg_dir); > > + pgd_init((void *)((unsigned long)swapper_pg_dir > > + + sizeof(pgd_t) * USER_PTRS_PER_PGD)); > > Pre-existing, but why not use: > > pgd_init(&swapper_pg_dir[USER_PTRS_PER_PGD]); > > ? OK, that seems better, thanks. Huacai > > Otherwise: > Reviewed-by: Philippe Mathieu-Daud=C3=A9 >