linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Huacai Chen <chenhuacai@loongson.cn>,
	Arnd Bergmann <arnd@arndb.de>,
	Huacai Chen <chenhuacai@kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Dinh Nguyen <dinguyen@kernel.org>
Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org,
	Xuefeng Li <lixuefeng@loongson.cn>, Guo Ren <guoren@kernel.org>,
	Xuerui Wang <kernel@xen0n.name>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Feiyang Chen <chenfeiyang@loongson.cn>
Subject: Re: [PATCH V11 1/4] MIPS&LoongArch&NIOS2: Adjust prototypes of p?d_init()
Date: Tue, 18 Oct 2022 15:28:58 +0200	[thread overview]
Message-ID: <95a0537f-27b2-adc9-d44e-527281326b0d@linaro.org> (raw)
In-Reply-To: <20221017024027.2389370-2-chenhuacai@loongson.cn>

On 17/10/22 04:40, Huacai Chen wrote:
> From: Feiyang Chen <chenfeiyang@loongson.cn>
> 
> 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 call
> them.
> 
> NIOS2 declares pmd_init() but doesn't use, just remove it to avoid build
> errors.
> 
> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
>   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 <asm/pgalloc.h>
>   #include <asm/tlbflush.h>
>   
> -void pgd_init(unsigned long page)
> +void pgd_init(void *addr)
>   {
> -	unsigned long *p = (unsigned long *) page;
> +	unsigned long *p = (unsigned long *)addr;
>   	int i;
>   
>   	for (i = 0; i < USER_PTRS_PER_PGD; i+=8) {
> @@ -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]);

?

Otherwise:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-10-18 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17  2:40 [PATCH V11 0/4] mm/sparse-vmemmap: Generalise helpers and enable for LoongArch Huacai Chen
2022-10-17  2:40 ` [PATCH V11 1/4] MIPS&LoongArch&NIOS2: Adjust prototypes of p?d_init() Huacai Chen
2022-10-18 13:28   ` Philippe Mathieu-Daudé [this message]
2022-10-19  2:00     ` Huacai Chen
2022-10-17  2:40 ` [PATCH V11 2/4] LoongArch: Add sparse memory vmemmap support Huacai Chen
2022-10-17  2:40 ` [PATCH V11 3/4] mm/sparse-vmemmap: Generalise vmemmap_populate_hugepages() Huacai Chen
2022-10-17  2:40 ` [PATCH V11 4/4] LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95a0537f-27b2-adc9-d44e-527281326b0d@linaro.org \
    --to=philmd@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=chenfeiyang@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=dave.hansen@linux.intel.com \
    --cc=dinguyen@kernel.org \
    --cc=guoren@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lixuefeng@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).