[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <fd6e7ad9-9d57-40b6-a8f6-455ea3ab3d27@app.fastmail.com>
Date: Wed, 08 Jan 2025 12:01:31 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Qi Zheng" <zhengqi.arch@...edance.com>,
"Peter Zijlstra" <peterz@...radead.org>,
"Alexander Gordeev" <agordeev@...ux.ibm.com>,
"Kevin Brodsky" <kevin.brodsky@....com>, "Alexandre Ghiti" <alex@...ti.fr>,
"Andreas Larsson" <andreas@...sler.com>,
"Palmer Dabbelt" <palmer@...belt.com>,
"Thomas Gleixner" <tglx@...utronix.de>,
"David Hildenbrand" <david@...hat.com>, "Jann Horn" <jannh@...gle.com>,
"Hugh Dickins" <hughd@...gle.com>, "Yu Zhao" <yuzhao@...gle.com>,
"Matthew Wilcox" <willy@...radead.org>,
"Muchun Song" <muchun.song@...ux.dev>, vbabka@...nel.org,
"Lorenzo Stoakes" <lorenzo.stoakes@...cle.com>,
"Andrew Morton" <akpm@...ux-foundation.org>,
"David Rientjes" <rientjes@...gle.com>, vishal.moola@...il.com,
"Will Deacon" <will@...nel.org>, aneesh.kumar@...nel.org,
"Nicholas Piggin" <npiggin@...il.com>,
"Dave Hansen" <dave.hansen@...ux.intel.com>,
"Mike Rapoport" <rppt@...nel.org>, "Ryan Roberts" <ryan.roberts@....com>
Cc: linux-mm@...ck.org, linux-arm-kernel@...ts.infradead.org,
linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org,
linux-s390@...r.kernel.org, sparclinux@...r.kernel.org,
linux-kernel@...r.kernel.org, x86@...nel.org,
Linux-Arch <linux-arch@...r.kernel.org>,
"linux-csky@...r.kernel.org" <linux-csky@...r.kernel.org>,
linux-hexagon@...r.kernel.org, loongarch@...ts.linux.dev,
linux-m68k@...ts.linux-m68k.org, linux-mips@...r.kernel.org,
"linux-openrisc@...r.kernel.org" <linux-openrisc@...r.kernel.org>,
linux-sh@...r.kernel.org, linux-um@...ts.infradead.org
Subject: Re: [PATCH v5 03/17] asm-generic: pgalloc: Provide generic
p4d_{alloc_one,free}
On Wed, Jan 8, 2025, at 07:57, Qi Zheng wrote:
> From: Kevin Brodsky <kevin.brodsky@....com>
>
> Four architectures currently implement 5-level pgtables: arm64,
> riscv, x86 and s390. The first three have essentially the same
> implementation for p4d_alloc_one() and p4d_free(), so we've got an
> opportunity to reduce duplication like at the lower levels.
>
> Provide a generic version of p4d_alloc_one() and p4d_free(), and
> make use of it on those architectures.
>
> Their implementation is the same as at PUD level, except that
> p4d_free() performs a runtime check by calling mm_p4d_folded().
> 5-level pgtables depend on a runtime-detected hardware feature on
> all supported architectures, so we might as well include this check
> in the generic implementation. No runtime check is required in
> p4d_alloc_one() as the top-level p4d_alloc() already does the
> required check.
>
> Signed-off-by: Kevin Brodsky <kevin.brodsky@....com>
> Acked-by: Dave Hansen <dave.hansen@...ux.intel.com>
> Signed-off-by: Qi Zheng <zhengqi.arch@...edance.com>
> ---
> arch/arm64/include/asm/pgalloc.h | 17 ------------
> arch/riscv/include/asm/pgalloc.h | 23 ----------------
> arch/x86/include/asm/pgalloc.h | 18 -------------
> include/asm-generic/pgalloc.h | 45 ++++++++++++++++++++++++++++++++
> 4 files changed, 45 insertions(+), 58 deletions(-)
Acked-by: Arnd Bergmann <arnd@...db.de> # asm-generic
Powered by blists - more mailing lists