[PATCH 0/3] arm64/ptdump: Add cmdline 'early_ptdump'

Anshuman Khandual posted 3 patches 3 weeks, 1 day ago
.../admin-guide/kernel-parameters.txt         |  4 ++
arch/arm64/include/asm/ptdump.h               |  4 ++
arch/arm64/kernel/setup.c                     |  3 ++
arch/arm64/mm/ptdump.c                        | 51 +++++++++++++++----
drivers/firmware/efi/arm-runtime.c            |  4 +-
5 files changed, 53 insertions(+), 13 deletions(-)
[PATCH 0/3] arm64/ptdump: Add cmdline 'early_ptdump'
Posted by Anshuman Khandual 3 weeks, 1 day ago
Enable early kernel page table dump for debug purpose when required through
a new kernel command line option 'early_ptdump'. But first this reorganizes
ptdump_init() separating out the debugfs creation, so that it can be called
early on in setup_arch(). This also adds kernel dmesg console print support
for existing pt_dump_seq_[printf|puts]() helpers.

This series applies on v6.17-rc5

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-efi@vger.kernel.org

Changes in V1:

- Dropped ARM64_PTDUMP_CONSOLE and instead enabled cmdline 'early_ptdump'

Changes in RFC:

https://lore.kernel.org/all/20250818091436.938517-1-anshuman.khandual@arm.com/

Anshuman Khandual (3):
  arm64/ptdump: Re-organize ptdump_init()
  arm64/ptdump: Enable console output in pt_dump_seq_[printf|puts]()
  arm64/ptdump: Add 'early_ptdump' kernel command line option

 .../admin-guide/kernel-parameters.txt         |  4 ++
 arch/arm64/include/asm/ptdump.h               |  4 ++
 arch/arm64/kernel/setup.c                     |  3 ++
 arch/arm64/mm/ptdump.c                        | 51 +++++++++++++++----
 drivers/firmware/efi/arm-runtime.c            |  4 +-
 5 files changed, 53 insertions(+), 13 deletions(-)

-- 
2.25.1
Re: [PATCH 0/3] arm64/ptdump: Add cmdline 'early_ptdump'
Posted by Will Deacon 2 weeks ago
On Wed, Sep 10, 2025 at 03:16:20PM +0530, Anshuman Khandual wrote:
> Enable early kernel page table dump for debug purpose when required through
> a new kernel command line option 'early_ptdump'. But first this reorganizes
> ptdump_init() separating out the debugfs creation, so that it can be called
> early on in setup_arch(). This also adds kernel dmesg console print support
> for existing pt_dump_seq_[printf|puts]() helpers.
> 
> This series applies on v6.17-rc5
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Ryan Roberts <ryan.roberts@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-efi@vger.kernel.org

I'm really not convinced this is particularly useful and I've certainly
never felt the need to have something like it. If you're debugging really
early page-table issues, why you want to rely on all the ptdump
infrastructure to get logs out?

On the other hand, if people do find this useful, then I think it should
be implemented in the core code rather than done behind its back in the
arch code.

Will