[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95a0537f-27b2-adc9-d44e-527281326b0d@linaro.org>
Date: Tue, 18 Oct 2022 15:28:58 +0200
From: Philippe Mathieu-Daudé <philmd@...aro.org>
To: Huacai Chen <chenhuacai@...ngson.cn>,
Arnd Bergmann <arnd@...db.de>,
Huacai Chen <chenhuacai@...nel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Dinh Nguyen <dinguyen@...nel.org>
Cc: loongarch@...ts.linux.dev, linux-arch@...r.kernel.org,
Xuefeng Li <lixuefeng@...ngson.cn>,
Guo Ren <guoren@...nel.org>, Xuerui Wang <kernel@...0n.name>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Feiyang Chen <chenfeiyang@...ngson.cn>
Subject: Re: [PATCH V11 1/4] MIPS&LoongArch&NIOS2: Adjust prototypes of
p?d_init()
On 17/10/22 04:40, Huacai Chen wrote:
> From: Feiyang Chen <chenfeiyang@...ngson.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@...goat.com>
> Signed-off-by: Feiyang Chen <chenfeiyang@...ngson.cn>
> Signed-off-by: Huacai Chen <chenhuacai@...ngson.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@...aro.org>
Powered by blists - more mailing lists