lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H5x6fskGSObfh=P2JeDEhhFs6c9iQcOAKroeQQv4fu3uA@mail.gmail.com>
Date:   Wed, 19 Oct 2022 10:00:22 +0800
From:   Huacai Chen <chenhuacai@...nel.org>
To:     Philippe Mathieu-Daudé <philmd@...aro.org>
Cc:     Huacai Chen <chenhuacai@...ngson.cn>,
        Arnd Bergmann <arnd@...db.de>,
        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>, 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()

Hi, Philippe,

On Tue, Oct 18, 2022 at 9:29 PM Philippe Mathieu-Daudé
<philmd@...aro.org> wrote:
>
> 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]);
>
> ?
OK, that seems better, thanks.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ