* [PATCH 0/4] mm: Rework generic PTDUMP configs
@ 2025-02-13 4:09 Anshuman Khandual
2025-02-13 4:09 ` [PATCH 1/4] configs: Drop GENERIC_PTDUMP from debug.config Anshuman Khandual
` (3 more replies)
0 siblings, 4 replies; 18+ messages in thread
From: Anshuman Khandual @ 2025-02-13 4:09 UTC (permalink / raw)
To: linux-mm
Cc: steven.price, christophe.leroy, Anshuman Khandual, Andrew Morton,
Mark Rutland, kvmarm, linux-arm-kernel, linux-doc, linux-kernel,
linuxppc-dev, linux-riscv, linux-s390
The series reworks generic PTDUMP configs before eventually renaming them
after some basic clean ups first. This is derived after splitting changes
from the following patch.
https://lore.kernel.org/all/20250205050039.1506377-1-anshuman.khandual@arm.com/
This series applies on v6.14-rc2 and has been tested on arm64. Although it
also builds on other platforms as well.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: kvmarm@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-s390@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Anshuman Khandual (4):
configs: Drop GENERIC_PTDUMP from debug.config
mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP
mm: Make GENERIC_PTDUMP dependent on MMU
mm: Rename GENERIC_PTDUMP and PTDUMP_CORE
Documentation/arch/arm64/ptdump.rst | 4 ++--
arch/arm64/Kconfig | 2 +-
arch/arm64/include/asm/ptdump.h | 4 ++--
arch/arm64/kvm/Kconfig | 4 ++--
arch/arm64/mm/Makefile | 2 +-
arch/powerpc/Kconfig | 2 +-
arch/powerpc/configs/mpc885_ads_defconfig | 2 +-
arch/powerpc/mm/Makefile | 2 +-
arch/riscv/Kconfig | 2 +-
arch/riscv/mm/Makefile | 2 +-
arch/s390/Kconfig | 2 +-
arch/s390/mm/Makefile | 2 +-
arch/x86/Kconfig | 2 +-
arch/x86/Kconfig.debug | 2 +-
arch/x86/mm/Makefile | 2 +-
kernel/configs/debug.config | 1 -
mm/Kconfig.debug | 12 +++++++-----
mm/Makefile | 2 +-
18 files changed, 26 insertions(+), 25 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 1/4] configs: Drop GENERIC_PTDUMP from debug.config 2025-02-13 4:09 [PATCH 0/4] mm: Rework generic PTDUMP configs Anshuman Khandual @ 2025-02-13 4:09 ` Anshuman Khandual 2025-02-13 11:23 ` Steven Price 2025-02-13 4:09 ` [PATCH 2/4] mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP Anshuman Khandual ` (2 subsequent siblings) 3 siblings, 1 reply; 18+ messages in thread From: Anshuman Khandual @ 2025-02-13 4:09 UTC (permalink / raw) To: linux-mm Cc: steven.price, christophe.leroy, Anshuman Khandual, Andrew Morton, linux-kernel The platforms that support GENERIC_PTDUMP select the config explicitly. But enabling this feature on platforms that don't really support - does nothing or might cause a build failure. Hence just drop GENERIC_PTDUMP from generic debug.config Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> --- kernel/configs/debug.config | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/configs/debug.config b/kernel/configs/debug.config index 20552f163930..8aafd050b754 100644 --- a/kernel/configs/debug.config +++ b/kernel/configs/debug.config @@ -73,7 +73,6 @@ CONFIG_DEBUG_VM=y CONFIG_DEBUG_VM_PGFLAGS=y CONFIG_DEBUG_VM_RB=y CONFIG_DEBUG_VM_VMACACHE=y -CONFIG_GENERIC_PTDUMP=y CONFIG_KASAN=y CONFIG_KASAN_GENERIC=y CONFIG_KASAN_INLINE=y -- 2.25.1 ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/4] configs: Drop GENERIC_PTDUMP from debug.config 2025-02-13 4:09 ` [PATCH 1/4] configs: Drop GENERIC_PTDUMP from debug.config Anshuman Khandual @ 2025-02-13 11:23 ` Steven Price 0 siblings, 0 replies; 18+ messages in thread From: Steven Price @ 2025-02-13 11:23 UTC (permalink / raw) To: Anshuman Khandual, linux-mm; +Cc: christophe.leroy, Andrew Morton, linux-kernel On 13/02/2025 04:09, Anshuman Khandual wrote: > The platforms that support GENERIC_PTDUMP select the config explicitly. But > enabling this feature on platforms that don't really support - does nothing > or might cause a build failure. Hence just drop GENERIC_PTDUMP from generic > debug.config > > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> > --- > kernel/configs/debug.config | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/kernel/configs/debug.config b/kernel/configs/debug.config > index 20552f163930..8aafd050b754 100644 > --- a/kernel/configs/debug.config > +++ b/kernel/configs/debug.config > @@ -73,7 +73,6 @@ CONFIG_DEBUG_VM=y > CONFIG_DEBUG_VM_PGFLAGS=y > CONFIG_DEBUG_VM_RB=y > CONFIG_DEBUG_VM_VMACACHE=y > -CONFIG_GENERIC_PTDUMP=y > CONFIG_KASAN=y > CONFIG_KASAN_GENERIC=y > CONFIG_KASAN_INLINE=y ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/4] mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP 2025-02-13 4:09 [PATCH 0/4] mm: Rework generic PTDUMP configs Anshuman Khandual 2025-02-13 4:09 ` [PATCH 1/4] configs: Drop GENERIC_PTDUMP from debug.config Anshuman Khandual @ 2025-02-13 4:09 ` Anshuman Khandual 2025-02-13 11:23 ` Steven Price 2025-02-13 4:09 ` [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU Anshuman Khandual 2025-02-13 4:09 ` [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE Anshuman Khandual 3 siblings, 1 reply; 18+ messages in thread From: Anshuman Khandual @ 2025-02-13 4:09 UTC (permalink / raw) To: linux-mm Cc: steven.price, christophe.leroy, Anshuman Khandual, Andrew Morton, linux-kernel DEBUG_WX selects PTDUMP_CORE without even ensuring that the given platform implements GENERIC_PTDUMP. This problem has been latent until now, as all the platforms subscribing ARCH_HAS_DEBUG_WX also subscribe GENERIC_PTDUMP. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> --- mm/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index 41a58536531d..a51a1149909a 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -186,6 +186,7 @@ config ARCH_HAS_DEBUG_WX config DEBUG_WX bool "Warn on W+X mappings at boot" depends on ARCH_HAS_DEBUG_WX + depends on GENERIC_PTDUMP depends on MMU select PTDUMP_CORE help -- 2.25.1 ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/4] mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP 2025-02-13 4:09 ` [PATCH 2/4] mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP Anshuman Khandual @ 2025-02-13 11:23 ` Steven Price 0 siblings, 0 replies; 18+ messages in thread From: Steven Price @ 2025-02-13 11:23 UTC (permalink / raw) To: Anshuman Khandual, linux-mm; +Cc: christophe.leroy, Andrew Morton, linux-kernel On 13/02/2025 04:09, Anshuman Khandual wrote: > DEBUG_WX selects PTDUMP_CORE without even ensuring that the given platform > implements GENERIC_PTDUMP. This problem has been latent until now, as all > the platforms subscribing ARCH_HAS_DEBUG_WX also subscribe GENERIC_PTDUMP. > > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> > --- > mm/Kconfig.debug | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug > index 41a58536531d..a51a1149909a 100644 > --- a/mm/Kconfig.debug > +++ b/mm/Kconfig.debug > @@ -186,6 +186,7 @@ config ARCH_HAS_DEBUG_WX > config DEBUG_WX > bool "Warn on W+X mappings at boot" > depends on ARCH_HAS_DEBUG_WX > + depends on GENERIC_PTDUMP > depends on MMU > select PTDUMP_CORE > help ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU 2025-02-13 4:09 [PATCH 0/4] mm: Rework generic PTDUMP configs Anshuman Khandual 2025-02-13 4:09 ` [PATCH 1/4] configs: Drop GENERIC_PTDUMP from debug.config Anshuman Khandual 2025-02-13 4:09 ` [PATCH 2/4] mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP Anshuman Khandual @ 2025-02-13 4:09 ` Anshuman Khandual 2025-02-13 7:30 ` Christophe Leroy 2025-02-13 11:23 ` Steven Price 2025-02-13 4:09 ` [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE Anshuman Khandual 3 siblings, 2 replies; 18+ messages in thread From: Anshuman Khandual @ 2025-02-13 4:09 UTC (permalink / raw) To: linux-mm Cc: steven.price, christophe.leroy, Anshuman Khandual, Paul Walmsley, Palmer Dabbelt, Andrew Morton, linux-riscv, linux-kernel There is no page table dump without a MMU. Make this dependency at generic level and drop the same from riscv platform instead. Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> --- arch/riscv/Kconfig | 2 +- mm/Kconfig.debug | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 7612c52e9b1e..c4cdba6460b8 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -112,7 +112,7 @@ config RISCV select GENERIC_IRQ_SHOW_LEVEL select GENERIC_LIB_DEVMEM_IS_ALLOWED select GENERIC_PCI_IOMAP - select GENERIC_PTDUMP if MMU + select GENERIC_PTDUMP select GENERIC_SCHED_CLOCK select GENERIC_SMP_IDLE_THREAD select GENERIC_TIME_VSYSCALL if MMU && 64BIT diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index a51a1149909a..c08406760d29 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -214,6 +214,7 @@ config DEBUG_WX If in doubt, say "Y". config GENERIC_PTDUMP + depends on MMU bool config PTDUMP_CORE -- 2.25.1 ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU 2025-02-13 4:09 ` [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU Anshuman Khandual @ 2025-02-13 7:30 ` Christophe Leroy 2025-02-13 11:23 ` Steven Price 1 sibling, 0 replies; 18+ messages in thread From: Christophe Leroy @ 2025-02-13 7:30 UTC (permalink / raw) To: Anshuman Khandual, linux-mm Cc: steven.price, Paul Walmsley, Palmer Dabbelt, Andrew Morton, linux-riscv, linux-kernel Le 13/02/2025 à 05:09, Anshuman Khandual a écrit : > There is no page table dump without a MMU. Make this dependency at generic > level and drop the same from riscv platform instead. > > Cc: Paul Walmsley <paul.walmsley@sifive.com> > Cc: Palmer Dabbelt <palmer@dabbelt.com> > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: linux-riscv@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-mm@kvack.org > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > --- > arch/riscv/Kconfig | 2 +- > mm/Kconfig.debug | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 7612c52e9b1e..c4cdba6460b8 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -112,7 +112,7 @@ config RISCV > select GENERIC_IRQ_SHOW_LEVEL > select GENERIC_LIB_DEVMEM_IS_ALLOWED > select GENERIC_PCI_IOMAP > - select GENERIC_PTDUMP if MMU > + select GENERIC_PTDUMP Are you sure this works as expected ? See https://docs.kernel.org/kbuild/kconfig-language.html : Note: select should be used with care. select will force a symbol to a value without visiting the dependencies. By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set. In general use select only for non-visible symbols (no prompts anywhere) and for symbols with no dependencies. > select GENERIC_SCHED_CLOCK > select GENERIC_SMP_IDLE_THREAD > select GENERIC_TIME_VSYSCALL if MMU && 64BIT > diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug > index a51a1149909a..c08406760d29 100644 > --- a/mm/Kconfig.debug > +++ b/mm/Kconfig.debug > @@ -214,6 +214,7 @@ config DEBUG_WX > If in doubt, say "Y". > > config GENERIC_PTDUMP > + depends on MMU > bool > > config PTDUMP_CORE ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU 2025-02-13 4:09 ` [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU Anshuman Khandual 2025-02-13 7:30 ` Christophe Leroy @ 2025-02-13 11:23 ` Steven Price 2025-02-14 6:49 ` Anshuman Khandual 1 sibling, 1 reply; 18+ messages in thread From: Steven Price @ 2025-02-13 11:23 UTC (permalink / raw) To: Anshuman Khandual, linux-mm Cc: christophe.leroy, Paul Walmsley, Palmer Dabbelt, Andrew Morton, linux-riscv, linux-kernel On 13/02/2025 04:09, Anshuman Khandual wrote: > There is no page table dump without a MMU. Make this dependency at generic > level and drop the same from riscv platform instead. > > Cc: Paul Walmsley <paul.walmsley@sifive.com> > Cc: Palmer Dabbelt <palmer@dabbelt.com> > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: linux-riscv@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-mm@kvack.org > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> As Christophe has pointed out - this is broken. The select will override the dependency you've added in GENERIC_PTDUMP. Generally have "depends on" for symbols that are "select"ed is broken. I'd suggest just dropping this patch. Steve > --- > arch/riscv/Kconfig | 2 +- > mm/Kconfig.debug | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 7612c52e9b1e..c4cdba6460b8 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -112,7 +112,7 @@ config RISCV > select GENERIC_IRQ_SHOW_LEVEL > select GENERIC_LIB_DEVMEM_IS_ALLOWED > select GENERIC_PCI_IOMAP > - select GENERIC_PTDUMP if MMU > + select GENERIC_PTDUMP > select GENERIC_SCHED_CLOCK > select GENERIC_SMP_IDLE_THREAD > select GENERIC_TIME_VSYSCALL if MMU && 64BIT > diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug > index a51a1149909a..c08406760d29 100644 > --- a/mm/Kconfig.debug > +++ b/mm/Kconfig.debug > @@ -214,6 +214,7 @@ config DEBUG_WX > If in doubt, say "Y". > > config GENERIC_PTDUMP > + depends on MMU > bool > > config PTDUMP_CORE ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU 2025-02-13 11:23 ` Steven Price @ 2025-02-14 6:49 ` Anshuman Khandual 0 siblings, 0 replies; 18+ messages in thread From: Anshuman Khandual @ 2025-02-14 6:49 UTC (permalink / raw) To: Steven Price, linux-mm Cc: christophe.leroy, Paul Walmsley, Palmer Dabbelt, Andrew Morton, linux-riscv, linux-kernel On 2/13/25 16:53, Steven Price wrote: > On 13/02/2025 04:09, Anshuman Khandual wrote: >> There is no page table dump without a MMU. Make this dependency at generic >> level and drop the same from riscv platform instead. >> >> Cc: Paul Walmsley <paul.walmsley@sifive.com> >> Cc: Palmer Dabbelt <palmer@dabbelt.com> >> Cc: Andrew Morton <akpm@linux-foundation.org> >> Cc: linux-riscv@lists.infradead.org >> Cc: linux-kernel@vger.kernel.org >> Cc: linux-mm@kvack.org >> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > > As Christophe has pointed out - this is broken. The select will override > the dependency you've added in GENERIC_PTDUMP. Generally have "depends > on" for symbols that are "select"ed is broken. I'd suggest just dropping > this patch. Agreed, will drop this patch. Thanks Steven and Christophe for the explanation here regarding correct usage regarding the "select"'s construct. > > Steve > >> --- >> arch/riscv/Kconfig | 2 +- >> mm/Kconfig.debug | 1 + >> 2 files changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig >> index 7612c52e9b1e..c4cdba6460b8 100644 >> --- a/arch/riscv/Kconfig >> +++ b/arch/riscv/Kconfig >> @@ -112,7 +112,7 @@ config RISCV >> select GENERIC_IRQ_SHOW_LEVEL >> select GENERIC_LIB_DEVMEM_IS_ALLOWED >> select GENERIC_PCI_IOMAP >> - select GENERIC_PTDUMP if MMU >> + select GENERIC_PTDUMP >> select GENERIC_SCHED_CLOCK >> select GENERIC_SMP_IDLE_THREAD >> select GENERIC_TIME_VSYSCALL if MMU && 64BIT >> diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug >> index a51a1149909a..c08406760d29 100644 >> --- a/mm/Kconfig.debug >> +++ b/mm/Kconfig.debug >> @@ -214,6 +214,7 @@ config DEBUG_WX >> If in doubt, say "Y". >> >> config GENERIC_PTDUMP >> + depends on MMU >> bool >> >> config PTDUMP_CORE > ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-13 4:09 [PATCH 0/4] mm: Rework generic PTDUMP configs Anshuman Khandual ` (2 preceding siblings ...) 2025-02-13 4:09 ` [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU Anshuman Khandual @ 2025-02-13 4:09 ` Anshuman Khandual 2025-02-13 7:38 ` Christophe Leroy 2025-02-13 11:23 ` Steven Price 3 siblings, 2 replies; 18+ messages in thread From: Anshuman Khandual @ 2025-02-13 4:09 UTC (permalink / raw) To: linux-mm Cc: steven.price, christophe.leroy, Anshuman Khandual, Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. But generic ptdump gets enabled via PTDUMP_CORE. These configs combination is confusing as they sound very similar and does not differentiate between platform's feature subscription and feature enablement for ptdump. Rename the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve readability. Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Marc Zyngier <maz@kernel.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: kvmarm@lists.linux.dev Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-riscv@lists.infradead.org Cc: linux-s390@vger.kernel.org Cc: linux-mm@kvack.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> --- Documentation/arch/arm64/ptdump.rst | 4 ++-- arch/arm64/Kconfig | 2 +- arch/arm64/include/asm/ptdump.h | 4 ++-- arch/arm64/kvm/Kconfig | 4 ++-- arch/arm64/mm/Makefile | 2 +- arch/powerpc/Kconfig | 2 +- arch/powerpc/configs/mpc885_ads_defconfig | 2 +- arch/powerpc/mm/Makefile | 2 +- arch/riscv/Kconfig | 2 +- arch/riscv/mm/Makefile | 2 +- arch/s390/Kconfig | 2 +- arch/s390/mm/Makefile | 2 +- arch/x86/Kconfig | 2 +- arch/x86/Kconfig.debug | 2 +- arch/x86/mm/Makefile | 2 +- mm/Kconfig.debug | 12 ++++++------ mm/Makefile | 2 +- 17 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Documentation/arch/arm64/ptdump.rst b/Documentation/arch/arm64/ptdump.rst index 5dcfc5d7cddf..a2e527377da3 100644 --- a/Documentation/arch/arm64/ptdump.rst +++ b/Documentation/arch/arm64/ptdump.rst @@ -22,8 +22,8 @@ offlining of memory being accessed by the ptdump code. In order to dump the kernel page tables, enable the following configurations and mount debugfs:: - CONFIG_GENERIC_PTDUMP=y - CONFIG_PTDUMP_CORE=y + CONFIG_ARCH_HAS_PTDUMP=y + CONFIG_PTDUMP=y CONFIG_PTDUMP_DEBUGFS=y mount -t debugfs nodev /sys/kernel/debug diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fcdd0ed3eca8..045d24d074a0 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -41,6 +41,7 @@ config ARM64 select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE select ARCH_HAS_NONLEAF_PMD_YOUNG if ARM64_HAFT + select ARCH_HAS_PTDUMP select ARCH_HAS_PTE_DEVMAP select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_HW_PTE_YOUNG @@ -157,7 +158,6 @@ config ARM64 select GENERIC_IRQ_SHOW_LEVEL select GENERIC_LIB_DEVMEM_IS_ALLOWED select GENERIC_PCI_IOMAP - select GENERIC_PTDUMP select GENERIC_SCHED_CLOCK select GENERIC_SMP_IDLE_THREAD select GENERIC_TIME_VSYSCALL diff --git a/arch/arm64/include/asm/ptdump.h b/arch/arm64/include/asm/ptdump.h index 6cf4aae05219..b2931d1ae0fb 100644 --- a/arch/arm64/include/asm/ptdump.h +++ b/arch/arm64/include/asm/ptdump.h @@ -7,7 +7,7 @@ #include <linux/ptdump.h> -#ifdef CONFIG_PTDUMP_CORE +#ifdef CONFIG_PTDUMP #include <linux/mm_types.h> #include <linux/seq_file.h> @@ -70,6 +70,6 @@ static inline void ptdump_debugfs_register(struct ptdump_info *info, #else static inline void note_page(struct ptdump_state *pt_st, unsigned long addr, int level, u64 val) { } -#endif /* CONFIG_PTDUMP_CORE */ +#endif /* CONFIG_PTDUMP */ #endif /* __ASM_PTDUMP_H */ diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index ead632ad01b4..096e45acadb2 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -71,8 +71,8 @@ config PTDUMP_STAGE2_DEBUGFS depends on KVM depends on DEBUG_KERNEL depends on DEBUG_FS - depends on GENERIC_PTDUMP - select PTDUMP_CORE + depends on ARCH_HAS_PTDUMP + select PTDUMP default n help Say Y here if you want to show the stage-2 kernel pagetables diff --git a/arch/arm64/mm/Makefile b/arch/arm64/mm/Makefile index fc92170a8f37..c26489cf96cd 100644 --- a/arch/arm64/mm/Makefile +++ b/arch/arm64/mm/Makefile @@ -5,7 +5,7 @@ obj-y := dma-mapping.o extable.o fault.o init.o \ context.o proc.o pageattr.o fixmap.o obj-$(CONFIG_ARM64_CONTPTE) += contpte.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o -obj-$(CONFIG_PTDUMP_CORE) += ptdump.o +obj-$(CONFIG_PTDUMP) += ptdump.o obj-$(CONFIG_PTDUMP_DEBUGFS) += ptdump_debugfs.o obj-$(CONFIG_TRANS_TABLE) += trans_pgd.o obj-$(CONFIG_TRANS_TABLE) += trans_pgd-asm.o diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 424f188e62d9..6f1ae41dcf85 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -148,6 +148,7 @@ config PPC select ARCH_HAS_PHYS_TO_DMA select ARCH_HAS_PMEM_API select ARCH_HAS_PREEMPT_LAZY + select ARCH_HAS_PTDUMP select ARCH_HAS_PTE_DEVMAP if PPC_BOOK3S_64 select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64 @@ -206,7 +207,6 @@ config PPC select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW_LEVEL select GENERIC_PCI_IOMAP if PCI - select GENERIC_PTDUMP select GENERIC_SMP_IDLE_THREAD select GENERIC_TIME_VSYSCALL select GENERIC_VDSO_TIME_NS diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig index 77306be62e9e..db005618690b 100644 --- a/arch/powerpc/configs/mpc885_ads_defconfig +++ b/arch/powerpc/configs/mpc885_ads_defconfig @@ -78,4 +78,4 @@ CONFIG_DEBUG_VM_PGTABLE=y CONFIG_DETECT_HUNG_TASK=y CONFIG_BDI_SWITCH=y CONFIG_PPC_EARLY_DEBUG=y -CONFIG_GENERIC_PTDUMP=y +CONFIG_PTDUMP=y diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile index 0fe2f085c05a..8c1582b2987d 100644 --- a/arch/powerpc/mm/Makefile +++ b/arch/powerpc/mm/Makefile @@ -15,5 +15,5 @@ obj-$(CONFIG_NUMA) += numa.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o obj-$(CONFIG_PPC_COPRO_BASE) += copro_fault.o -obj-$(CONFIG_PTDUMP_CORE) += ptdump/ +obj-$(CONFIG_PTDUMP) += ptdump/ obj-$(CONFIG_KASAN) += kasan/ diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index c4cdba6460b8..5aef2aa4103c 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -43,6 +43,7 @@ config RISCV select ARCH_HAS_PMEM_API select ARCH_HAS_PREEMPT_LAZY select ARCH_HAS_PREPARE_SYNC_CORE_CMD + select ARCH_HAS_PTDUMP select ARCH_HAS_PTE_DEVMAP if 64BIT && MMU select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SET_DIRECT_MAP if MMU @@ -112,7 +113,6 @@ config RISCV select GENERIC_IRQ_SHOW_LEVEL select GENERIC_LIB_DEVMEM_IS_ALLOWED select GENERIC_PCI_IOMAP - select GENERIC_PTDUMP select GENERIC_SCHED_CLOCK select GENERIC_SMP_IDLE_THREAD select GENERIC_TIME_VSYSCALL if MMU && 64BIT diff --git a/arch/riscv/mm/Makefile b/arch/riscv/mm/Makefile index cbe4d775ef56..b916a68d324a 100644 --- a/arch/riscv/mm/Makefile +++ b/arch/riscv/mm/Makefile @@ -19,7 +19,7 @@ obj-y += context.o obj-y += pmem.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o -obj-$(CONFIG_PTDUMP_CORE) += ptdump.o +obj-$(CONFIG_PTDUMP) += ptdump.o obj-$(CONFIG_KASAN) += kasan_init.o ifdef CONFIG_KASAN diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 9c9ec08d78c7..dd9dd2f8e673 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -96,6 +96,7 @@ config S390 select ARCH_HAS_MEM_ENCRYPT select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS select ARCH_HAS_PREEMPT_LAZY + select ARCH_HAS_PTDUMP select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SCALED_CPUTIME select ARCH_HAS_SET_DIRECT_MAP @@ -163,7 +164,6 @@ config S390 select GENERIC_CPU_VULNERABILITIES select GENERIC_ENTRY select GENERIC_GETTIMEOFDAY - select GENERIC_PTDUMP select GENERIC_SMP_IDLE_THREAD select GENERIC_TIME_VSYSCALL select GENERIC_VDSO_TIME_NS diff --git a/arch/s390/mm/Makefile b/arch/s390/mm/Makefile index f6c2db7a8669..9726b91fe7e4 100644 --- a/arch/s390/mm/Makefile +++ b/arch/s390/mm/Makefile @@ -9,6 +9,6 @@ obj-y += page-states.o pageattr.o pgtable.o pgalloc.o extable.o obj-$(CONFIG_CMM) += cmm.o obj-$(CONFIG_DEBUG_VIRTUAL) += physaddr.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o -obj-$(CONFIG_PTDUMP_CORE) += dump_pagetables.o +obj-$(CONFIG_PTDUMP) += dump_pagetables.o obj-$(CONFIG_PGSTE) += gmap.o obj-$(CONFIG_PFAULT) += pfault.o diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 87198d957e2f..aa04757f7591 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -26,6 +26,7 @@ config X86_64 depends on 64BIT # Options that are inherently 64-bit kernel only: select ARCH_HAS_GIGANTIC_PAGE + select ARCH_HAS_PTDUMP select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 select ARCH_SUPPORTS_PER_VMA_LOCK select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE @@ -174,7 +175,6 @@ config X86 select GENERIC_IRQ_RESERVATION_MODE select GENERIC_IRQ_SHOW select GENERIC_PENDING_IRQ if SMP - select GENERIC_PTDUMP select GENERIC_SMP_IDLE_THREAD select GENERIC_TIME_VSYSCALL select GENERIC_GETTIMEOFDAY diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 1eb4d23cdaae..c95c3aaadf97 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -59,7 +59,7 @@ config EARLY_PRINTK_USB_XDBC config EFI_PGT_DUMP bool "Dump the EFI pagetable" depends on EFI - select PTDUMP_CORE + select PTDUMP help Enable this if you want to dump the EFI page table before enabling virtual mode. This can be used to debug miscellaneous diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile index 690fbf48e853..e0c99a8760ca 100644 --- a/arch/x86/mm/Makefile +++ b/arch/x86/mm/Makefile @@ -39,7 +39,7 @@ CFLAGS_fault.o := -I $(src)/../include/asm/trace obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o -obj-$(CONFIG_PTDUMP_CORE) += dump_pagetables.o +obj-$(CONFIG_PTDUMP) += dump_pagetables.o obj-$(CONFIG_PTDUMP_DEBUGFS) += debug_pagetables.o obj-$(CONFIG_HIGHMEM) += highmem_32.o diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index c08406760d29..df657c021a18 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -186,9 +186,9 @@ config ARCH_HAS_DEBUG_WX config DEBUG_WX bool "Warn on W+X mappings at boot" depends on ARCH_HAS_DEBUG_WX - depends on GENERIC_PTDUMP + depends on ARCH_HAS_PTDUMP depends on MMU - select PTDUMP_CORE + select PTDUMP help Generate a warning if any W+X mappings are found at boot. @@ -213,19 +213,19 @@ config DEBUG_WX If in doubt, say "Y". -config GENERIC_PTDUMP +config ARCH_HAS_PTDUMP depends on MMU bool -config PTDUMP_CORE +config PTDUMP bool config PTDUMP_DEBUGFS bool "Export kernel pagetable layout to userspace via debugfs" depends on DEBUG_KERNEL depends on DEBUG_FS - depends on GENERIC_PTDUMP - select PTDUMP_CORE + depends on ARCH_HAS_PTDUMP + select PTDUMP help Say Y here if you want to show the kernel pagetable layout in a debugfs file. This information is only useful for kernel developers diff --git a/mm/Makefile b/mm/Makefile index 850386a67b3e..26dfecd4d396 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -138,7 +138,7 @@ obj-$(CONFIG_ZONE_DEVICE) += memremap.o obj-$(CONFIG_HMM_MIRROR) += hmm.o obj-$(CONFIG_MEMFD_CREATE) += memfd.o obj-$(CONFIG_MAPPING_DIRTY_HELPERS) += mapping_dirty_helpers.o -obj-$(CONFIG_PTDUMP_CORE) += ptdump.o +obj-$(CONFIG_PTDUMP) += ptdump.o obj-$(CONFIG_PAGE_REPORTING) += page_reporting.o obj-$(CONFIG_IO_MAPPING) += io-mapping.o obj-$(CONFIG_HAVE_BOOTMEM_INFO_NODE) += bootmem_info.o -- 2.25.1 ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-13 4:09 ` [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE Anshuman Khandual @ 2025-02-13 7:38 ` Christophe Leroy 2025-02-14 7:17 ` Anshuman Khandual 2025-02-13 11:23 ` Steven Price 1 sibling, 1 reply; 18+ messages in thread From: Christophe Leroy @ 2025-02-13 7:38 UTC (permalink / raw) To: Anshuman Khandual, linux-mm Cc: steven.price, Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 Le 13/02/2025 à 05:09, Anshuman Khandual a écrit : > Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. > But generic ptdump gets enabled via PTDUMP_CORE. These configs combination > is confusing as they sound very similar and does not differentiate between > platform's feature subscription and feature enablement for ptdump. Rename > the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve > readability. For me GENERIC_PTDUMP is more explicit and similar to GENERIC_IOMAP or GENERIC_IOREMAP or GENERIC_GETTIMEOFDAY: The arch provides the necessary helpers to use the generic implementation. For me ARCH_HAS_PTDUMP just mean't that an architecture implements PTDUMP, it doesn't mean it does it by using the generic infrastructure. For instance, arm32 implements PTDUMP but without using the generic one so I would say that arm32 has PTDUMP and expect it to select ARCH_HAS_PTDUMP ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-13 7:38 ` Christophe Leroy @ 2025-02-14 7:17 ` Anshuman Khandual 2025-02-24 11:12 ` Christophe Leroy 0 siblings, 1 reply; 18+ messages in thread From: Anshuman Khandual @ 2025-02-14 7:17 UTC (permalink / raw) To: Christophe Leroy, linux-mm Cc: steven.price, Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 On 2/13/25 13:08, Christophe Leroy wrote: > > > Le 13/02/2025 à 05:09, Anshuman Khandual a écrit : >> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >> is confusing as they sound very similar and does not differentiate between >> platform's feature subscription and feature enablement for ptdump. Rename >> the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve >> readability. > > For me GENERIC_PTDUMP is more explicit and similar to GENERIC_IOMAP or GENERIC_IOREMAP or GENERIC_GETTIMEOFDAY: The arch provides the necessary helpers to use the generic implementation. I do realize that GENERIC_ is another method for achieving shared feature across multiple platforms via providing necessary helpers. But I guess there might be a difference - it might not have other similar but separate dependent configs ? > > For me ARCH_HAS_PTDUMP just mean't that an architecture implements PTDUMP, it doesn't mean it does it by using the generic infrastructure. ARCH_HAS_XXX indicates that an architecture subscribes to a generic feature XXX, by implementing all necessary helpers. But the feature in itself is a generic and a shared one. If the platform were to implement a feature on its own without any generic component, it could do that via a separate platform specific config without requiring ARCH_HAS_XXX based subscription indication. > > For instance, arm32 implements PTDUMP but without using the generic one so I would say that arm32 has PTDUMP and expect it to select ARCH_HAS_PTDUMP Actually it does not need to select ARCH_HAS_PTDUMP, as it does not subscribe into generic PTDUMP. Let's see PTDUMP configs on arm (32) ARM_PTDUMP_CORE ARM_PTDUMP_DEBUGFS --> select ARM_PTDUMP_CORE ARM_DEBUG_WX --> select ARM_PTDUMP_CORE The platform has a self contained PTDUMP implementation which does not depend on generic PTDUMP at all. Hence all these ptdump configs are marked as ARM_ etc as they are platform specific. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-14 7:17 ` Anshuman Khandual @ 2025-02-24 11:12 ` Christophe Leroy 0 siblings, 0 replies; 18+ messages in thread From: Christophe Leroy @ 2025-02-24 11:12 UTC (permalink / raw) To: Anshuman Khandual, linux-mm Cc: steven.price, Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 Le 14/02/2025 à 08:17, Anshuman Khandual a écrit : > On 2/13/25 13:08, Christophe Leroy wrote: >> >> >> Le 13/02/2025 à 05:09, Anshuman Khandual a écrit : >>> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >>> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >>> is confusing as they sound very similar and does not differentiate between >>> platform's feature subscription and feature enablement for ptdump. Rename >>> the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve >>> readability. >> >> For me GENERIC_PTDUMP is more explicit and similar to GENERIC_IOMAP or GENERIC_IOREMAP or GENERIC_GETTIMEOFDAY: The arch provides the necessary helpers to use the generic implementation. > > I do realize that GENERIC_ is another method for achieving shared > feature across multiple platforms via providing necessary helpers. > But I guess there might be a difference - it might not have other > similar but separate dependent configs ? > >> >> For me ARCH_HAS_PTDUMP just mean't that an architecture implements PTDUMP, it doesn't mean it does it by using the generic infrastructure. > > ARCH_HAS_XXX indicates that an architecture subscribes to a generic > feature XXX, by implementing all necessary helpers. But the feature > in itself is a generic and a shared one. I'm not sure about your interpretation. For instance CONFIG_ARCH_HAS_ILOG2_U32 means that a plateform provides its own implementation. When this is _NOT_ defined, then the generic implementation is used instead. > > If the platform were to implement a feature on its own without any > generic component, it could do that via a separate platform specific > config without requiring ARCH_HAS_XXX based subscription indication. Not sure. Usually when a plateform needs something generic it subscribes to something like CONFIG_ARCH_WANT_GENERAL_HUGETLB > >> >> For instance, arm32 implements PTDUMP but without using the generic one so I would say that arm32 has PTDUMP and expect it to select ARCH_HAS_PTDUMP > > Actually it does not need to select ARCH_HAS_PTDUMP, as it does not > subscribe into generic PTDUMP. Let's see PTDUMP configs on arm (32) > > ARM_PTDUMP_CORE > ARM_PTDUMP_DEBUGFS --> select ARM_PTDUMP_CORE > ARM_DEBUG_WX --> select ARM_PTDUMP_CORE > > The platform has a self contained PTDUMP implementation which does > not depend on generic PTDUMP at all. Hence all these ptdump configs > are marked as ARM_ etc as they are platform specific. That's the reason why I believe the wording CONFIG_ARCH_HAS_SOMETHING is not appropriate. Christophe ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-13 4:09 ` [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE Anshuman Khandual 2025-02-13 7:38 ` Christophe Leroy @ 2025-02-13 11:23 ` Steven Price 2025-02-13 11:49 ` Christophe Leroy 2025-02-14 7:19 ` Anshuman Khandual 1 sibling, 2 replies; 18+ messages in thread From: Steven Price @ 2025-02-13 11:23 UTC (permalink / raw) To: Anshuman Khandual, linux-mm Cc: christophe.leroy, Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 On 13/02/2025 04:09, Anshuman Khandual wrote: > Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. > But generic ptdump gets enabled via PTDUMP_CORE. These configs combination > is confusing as they sound very similar and does not differentiate between > platform's feature subscription and feature enablement for ptdump. Rename > the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve > readability. I'm not going to bikeshed over the naming, but a few points below. > Cc: Catalin Marinas <catalin.marinas@arm.com> > Cc: Will Deacon <will@kernel.org> > Cc: Jonathan Corbet <corbet@lwn.net> > Cc: Marc Zyngier <maz@kernel.org> > Cc: Michael Ellerman <mpe@ellerman.id.au> > Cc: Nicholas Piggin <npiggin@gmail.com> > Cc: Paul Walmsley <paul.walmsley@sifive.com> > Cc: Palmer Dabbelt <palmer@dabbelt.com> > Cc: Heiko Carstens <hca@linux.ibm.com> > Cc: Vasily Gorbik <gor@linux.ibm.com> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-doc@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: kvmarm@lists.linux.dev > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-riscv@lists.infradead.org > Cc: linux-s390@vger.kernel.org > Cc: linux-mm@kvack.org > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > --- > Documentation/arch/arm64/ptdump.rst | 4 ++-- > arch/arm64/Kconfig | 2 +- > arch/arm64/include/asm/ptdump.h | 4 ++-- > arch/arm64/kvm/Kconfig | 4 ++-- > arch/arm64/mm/Makefile | 2 +- > arch/powerpc/Kconfig | 2 +- > arch/powerpc/configs/mpc885_ads_defconfig | 2 +- > arch/powerpc/mm/Makefile | 2 +- > arch/riscv/Kconfig | 2 +- > arch/riscv/mm/Makefile | 2 +- > arch/s390/Kconfig | 2 +- > arch/s390/mm/Makefile | 2 +- > arch/x86/Kconfig | 2 +- > arch/x86/Kconfig.debug | 2 +- > arch/x86/mm/Makefile | 2 +- > mm/Kconfig.debug | 12 ++++++------ > mm/Makefile | 2 +- > 17 files changed, 25 insertions(+), 25 deletions(-) > > diff --git a/Documentation/arch/arm64/ptdump.rst b/Documentation/arch/arm64/ptdump.rst > index 5dcfc5d7cddf..a2e527377da3 100644 > --- a/Documentation/arch/arm64/ptdump.rst > +++ b/Documentation/arch/arm64/ptdump.rst > @@ -22,8 +22,8 @@ offlining of memory being accessed by the ptdump code. > In order to dump the kernel page tables, enable the following > configurations and mount debugfs:: > > - CONFIG_GENERIC_PTDUMP=y > - CONFIG_PTDUMP_CORE=y > + CONFIG_ARCH_HAS_PTDUMP=y > + CONFIG_PTDUMP=y > CONFIG_PTDUMP_DEBUGFS=y I think we should drop CONFIG_GENERIC_PTDUMP/CONFIG_ARCH_HAS_PTDUMP from this list. It's not a user-selectable symbol so there's no need to be documenting it here. > > mount -t debugfs nodev /sys/kernel/debug [...] > diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig > index 77306be62e9e..db005618690b 100644 > --- a/arch/powerpc/configs/mpc885_ads_defconfig > +++ b/arch/powerpc/configs/mpc885_ads_defconfig > @@ -78,4 +78,4 @@ CONFIG_DEBUG_VM_PGTABLE=y > CONFIG_DETECT_HUNG_TASK=y > CONFIG_BDI_SWITCH=y > CONFIG_PPC_EARLY_DEBUG=y > -CONFIG_GENERIC_PTDUMP=y > +CONFIG_PTDUMP=y I'd suggest dropp this from the defconfig too, just like patch 1 dropped it from debug.config. Steve ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-13 11:23 ` Steven Price @ 2025-02-13 11:49 ` Christophe Leroy 2025-02-14 7:26 ` Anshuman Khandual 2025-02-14 7:19 ` Anshuman Khandual 1 sibling, 1 reply; 18+ messages in thread From: Christophe Leroy @ 2025-02-13 11:49 UTC (permalink / raw) To: Steven Price, Anshuman Khandual, linux-mm Cc: Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 Le 13/02/2025 à 12:23, Steven Price a écrit : > On 13/02/2025 04:09, Anshuman Khandual wrote: >> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >> is confusing as they sound very similar and does not differentiate between >> platform's feature subscription and feature enablement for ptdump. Rename >> the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve >> readability. > > [...] >> diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig >> index 77306be62e9e..db005618690b 100644 >> --- a/arch/powerpc/configs/mpc885_ads_defconfig >> +++ b/arch/powerpc/configs/mpc885_ads_defconfig >> @@ -78,4 +78,4 @@ CONFIG_DEBUG_VM_PGTABLE=y >> CONFIG_DETECT_HUNG_TASK=y >> CONFIG_BDI_SWITCH=y >> CONFIG_PPC_EARLY_DEBUG=y >> -CONFIG_GENERIC_PTDUMP=y >> +CONFIG_PTDUMP=y > > I'd suggest dropp this from the defconfig too, just like patch 1 dropped > it from debug.config. > Thanks for spotting that. That one is wrong. Was introduced by commit d210ee3fdfe8 ("powerpc/configs: Update config files for removed/renamed symbols") which aimed at fixing commit e084728393a5 ("powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP") but it did it wrong. It is CONFIG_PTDUMP_DEBUGFS that is wanted. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-13 11:49 ` Christophe Leroy @ 2025-02-14 7:26 ` Anshuman Khandual 2025-02-24 11:13 ` Christophe Leroy 0 siblings, 1 reply; 18+ messages in thread From: Anshuman Khandual @ 2025-02-14 7:26 UTC (permalink / raw) To: Christophe Leroy, Steven Price, linux-mm Cc: Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 On 2/13/25 17:19, Christophe Leroy wrote: > > > Le 13/02/2025 à 12:23, Steven Price a écrit : >> On 13/02/2025 04:09, Anshuman Khandual wrote: >>> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >>> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >>> is confusing as they sound very similar and does not differentiate between >>> platform's feature subscription and feature enablement for ptdump. Rename >>> the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve >>> readability. >> >> [...] >>> diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig >>> index 77306be62e9e..db005618690b 100644 >>> --- a/arch/powerpc/configs/mpc885_ads_defconfig >>> +++ b/arch/powerpc/configs/mpc885_ads_defconfig >>> @@ -78,4 +78,4 @@ CONFIG_DEBUG_VM_PGTABLE=y >>> CONFIG_DETECT_HUNG_TASK=y >>> CONFIG_BDI_SWITCH=y >>> CONFIG_PPC_EARLY_DEBUG=y >>> -CONFIG_GENERIC_PTDUMP=y >>> +CONFIG_PTDUMP=y >> >> I'd suggest dropp this from the defconfig too, just like patch 1 dropped >> it from debug.config. >> > > Thanks for spotting that. > > That one is wrong. Was introduced by commit d210ee3fdfe8 ("powerpc/configs: Update config files for removed/renamed symbols") which aimed at fixing commit e084728393a5 ("powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP") but it did it wrong. > > It is CONFIG_PTDUMP_DEBUGFS that is wanted. Should this replacement be done in the series or would you like it to be handled in powerpc later ? ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-14 7:26 ` Anshuman Khandual @ 2025-02-24 11:13 ` Christophe Leroy 0 siblings, 0 replies; 18+ messages in thread From: Christophe Leroy @ 2025-02-24 11:13 UTC (permalink / raw) To: Anshuman Khandual, Steven Price, linux-mm Cc: Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 Le 14/02/2025 à 08:26, Anshuman Khandual a écrit : > > > On 2/13/25 17:19, Christophe Leroy wrote: >> >> >> Le 13/02/2025 à 12:23, Steven Price a écrit : >>> On 13/02/2025 04:09, Anshuman Khandual wrote: >>>> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >>>> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >>>> is confusing as they sound very similar and does not differentiate between >>>> platform's feature subscription and feature enablement for ptdump. Rename >>>> the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve >>>> readability. >>> >>> [...] >>>> diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig >>>> index 77306be62e9e..db005618690b 100644 >>>> --- a/arch/powerpc/configs/mpc885_ads_defconfig >>>> +++ b/arch/powerpc/configs/mpc885_ads_defconfig >>>> @@ -78,4 +78,4 @@ CONFIG_DEBUG_VM_PGTABLE=y >>>> CONFIG_DETECT_HUNG_TASK=y >>>> CONFIG_BDI_SWITCH=y >>>> CONFIG_PPC_EARLY_DEBUG=y >>>> -CONFIG_GENERIC_PTDUMP=y >>>> +CONFIG_PTDUMP=y >>> >>> I'd suggest dropp this from the defconfig too, just like patch 1 dropped >>> it from debug.config. >>> >> >> Thanks for spotting that. >> >> That one is wrong. Was introduced by commit d210ee3fdfe8 ("powerpc/configs: Update config files for removed/renamed symbols") which aimed at fixing commit e084728393a5 ("powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP") but it did it wrong. >> >> It is CONFIG_PTDUMP_DEBUGFS that is wanted. > > Should this replacement be done in the series or would you like it > to be handled in powerpc later ? Yes I think you should do the replacement. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE 2025-02-13 11:23 ` Steven Price 2025-02-13 11:49 ` Christophe Leroy @ 2025-02-14 7:19 ` Anshuman Khandual 1 sibling, 0 replies; 18+ messages in thread From: Anshuman Khandual @ 2025-02-14 7:19 UTC (permalink / raw) To: Steven Price, linux-mm Cc: christophe.leroy, Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier, Michael Ellerman, Nicholas Piggin, Paul Walmsley, Palmer Dabbelt, Heiko Carstens, Vasily Gorbik, Thomas Gleixner, Ingo Molnar, Andrew Morton, linux-arm-kernel, linux-doc, linux-kernel, kvmarm, linuxppc-dev, linux-riscv, linux-s390 On 2/13/25 16:53, Steven Price wrote: > On 13/02/2025 04:09, Anshuman Khandual wrote: >> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >> is confusing as they sound very similar and does not differentiate between >> platform's feature subscription and feature enablement for ptdump. Rename >> the configs as ARCH_HAS_PTDUMP and PTDUMP making it more clear and improve >> readability. > > I'm not going to bikeshed over the naming, but a few points below. > >> Cc: Catalin Marinas <catalin.marinas@arm.com> >> Cc: Will Deacon <will@kernel.org> >> Cc: Jonathan Corbet <corbet@lwn.net> >> Cc: Marc Zyngier <maz@kernel.org> >> Cc: Michael Ellerman <mpe@ellerman.id.au> >> Cc: Nicholas Piggin <npiggin@gmail.com> >> Cc: Paul Walmsley <paul.walmsley@sifive.com> >> Cc: Palmer Dabbelt <palmer@dabbelt.com> >> Cc: Heiko Carstens <hca@linux.ibm.com> >> Cc: Vasily Gorbik <gor@linux.ibm.com> >> Cc: Thomas Gleixner <tglx@linutronix.de> >> Cc: Ingo Molnar <mingo@redhat.com> >> Cc: Andrew Morton <akpm@linux-foundation.org> >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-doc@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org >> Cc: kvmarm@lists.linux.dev >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: linux-riscv@lists.infradead.org >> Cc: linux-s390@vger.kernel.org >> Cc: linux-mm@kvack.org >> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> >> --- >> Documentation/arch/arm64/ptdump.rst | 4 ++-- >> arch/arm64/Kconfig | 2 +- >> arch/arm64/include/asm/ptdump.h | 4 ++-- >> arch/arm64/kvm/Kconfig | 4 ++-- >> arch/arm64/mm/Makefile | 2 +- >> arch/powerpc/Kconfig | 2 +- >> arch/powerpc/configs/mpc885_ads_defconfig | 2 +- >> arch/powerpc/mm/Makefile | 2 +- >> arch/riscv/Kconfig | 2 +- >> arch/riscv/mm/Makefile | 2 +- >> arch/s390/Kconfig | 2 +- >> arch/s390/mm/Makefile | 2 +- >> arch/x86/Kconfig | 2 +- >> arch/x86/Kconfig.debug | 2 +- >> arch/x86/mm/Makefile | 2 +- >> mm/Kconfig.debug | 12 ++++++------ >> mm/Makefile | 2 +- >> 17 files changed, 25 insertions(+), 25 deletions(-) >> >> diff --git a/Documentation/arch/arm64/ptdump.rst b/Documentation/arch/arm64/ptdump.rst >> index 5dcfc5d7cddf..a2e527377da3 100644 >> --- a/Documentation/arch/arm64/ptdump.rst >> +++ b/Documentation/arch/arm64/ptdump.rst >> @@ -22,8 +22,8 @@ offlining of memory being accessed by the ptdump code. >> In order to dump the kernel page tables, enable the following >> configurations and mount debugfs:: >> >> - CONFIG_GENERIC_PTDUMP=y >> - CONFIG_PTDUMP_CORE=y >> + CONFIG_ARCH_HAS_PTDUMP=y >> + CONFIG_PTDUMP=y >> CONFIG_PTDUMP_DEBUGFS=y > > I think we should drop CONFIG_GENERIC_PTDUMP/CONFIG_ARCH_HAS_PTDUMP from > this list. It's not a user-selectable symbol so there's no need to be > documenting it here. Sure, will fold that in here. > >> >> mount -t debugfs nodev /sys/kernel/debug > [...] >> diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig >> index 77306be62e9e..db005618690b 100644 >> --- a/arch/powerpc/configs/mpc885_ads_defconfig >> +++ b/arch/powerpc/configs/mpc885_ads_defconfig >> @@ -78,4 +78,4 @@ CONFIG_DEBUG_VM_PGTABLE=y >> CONFIG_DETECT_HUNG_TASK=y >> CONFIG_BDI_SWITCH=y >> CONFIG_PPC_EARLY_DEBUG=y >> -CONFIG_GENERIC_PTDUMP=y >> +CONFIG_PTDUMP=y > > I'd suggest dropp this from the defconfig too, just like patch 1 dropped > it from debug.config. Agreed. ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2025-02-24 11:13 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-02-13 4:09 [PATCH 0/4] mm: Rework generic PTDUMP configs Anshuman Khandual 2025-02-13 4:09 ` [PATCH 1/4] configs: Drop GENERIC_PTDUMP from debug.config Anshuman Khandual 2025-02-13 11:23 ` Steven Price 2025-02-13 4:09 ` [PATCH 2/4] mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP Anshuman Khandual 2025-02-13 11:23 ` Steven Price 2025-02-13 4:09 ` [PATCH 3/4] mm: Make GENERIC_PTDUMP dependent on MMU Anshuman Khandual 2025-02-13 7:30 ` Christophe Leroy 2025-02-13 11:23 ` Steven Price 2025-02-14 6:49 ` Anshuman Khandual 2025-02-13 4:09 ` [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE Anshuman Khandual 2025-02-13 7:38 ` Christophe Leroy 2025-02-14 7:17 ` Anshuman Khandual 2025-02-24 11:12 ` Christophe Leroy 2025-02-13 11:23 ` Steven Price 2025-02-13 11:49 ` Christophe Leroy 2025-02-14 7:26 ` Anshuman Khandual 2025-02-24 11:13 ` Christophe Leroy 2025-02-14 7:19 ` Anshuman Khandual
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox