[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YrSfOp5B+LhFXgjt@kernel.org>
Date: Thu, 23 Jun 2022 12:13:30 -0500
From: Mike Rapoport <rppt@...nel.org>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH] powerpc/64e: Rewrite p4d_populate() as a static inline
function
On Thu, Jun 23, 2022 at 10:56:57AM +0200, Christophe Leroy wrote:
> Rewrite p4d_populate() as a static inline function instead of
> a macro.
>
> This change allows typechecking and would have helped detecting
> a recently found bug in map_kernel_page().
>
> Cc: Mike Rapoport <rppt@...nel.org>
> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
Acked-by: Mike Rapoport <rppt@...ux.ibm.com>
> ---
> arch/powerpc/include/asm/nohash/64/pgalloc.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h
> index 668aee6017e7..e50b211becb3 100644
> --- a/arch/powerpc/include/asm/nohash/64/pgalloc.h
> +++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h
> @@ -15,7 +15,10 @@ struct vmemmap_backing {
> };
> extern struct vmemmap_backing *vmemmap_list;
>
> -#define p4d_populate(MM, P4D, PUD) p4d_set(P4D, (unsigned long)PUD)
> +static inline void p4d_populate(struct mm_struct *mm, p4d_t *p4d, pud_t *pud)
> +{
> + p4d_set(p4d, (unsigned long)pud);
> +}
>
> static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
> {
> --
> 2.36.1
>
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists