Linux Documentation
 help / color / mirror / Atom feed
* [RFC V2 0/3] lib/vsprintf: Add support for pgtable entries
@ 2026-06-10  4:35 Anshuman Khandual
  2026-06-10  4:35 ` [RFC V2 1/3] " Anshuman Khandual
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Anshuman Khandual @ 2026-06-10  4:35 UTC (permalink / raw)
  To: linux-mm
  Cc: Anshuman Khandual, Andy Shevchenko, Rasmus Villemoes,
	Sergey Senozhatsky, Petr Mladek, Steven Rostedt, Jonathan Corbet,
	Andrew Morton, David Hildenbrand, linux-kernel, linux-doc

Printing page table entries has been a common requirement both in generic
and platform memory management for various purposes. Hence let's create a
dedicated printk format for such entries which will also help standardize
pgtable printing across different platforms.

Also add a test for this new print format in lib/tests/printf_kunit.c via
existing CONFIG_PRINTF_KUNIT_TEST.

This series applies on v7.1-rc7

This series has been tested on arm64 but built tested on several others
including x86, powerpc, s390, riscv, and mips etc. Although it does not
build on arm32 platform due to existing pgdp_get() concerns.

Changes in V2:

Accommodated most suggestions from Petr Mladek and others

- Moved __print_bad_page_map_pgtable() changes into a separate patch
- Added helper pxd_pointer() for pgtable print format
- Added buffer check via check_pointer()
- Added special_hex_number() for base case printing
- Added static_assert() to ensure acceptable pxd_t size
- Avoided direct dereferences and used pxdp_get() helpers instead
- Improved printf KUNIT tests for all level page table entries

Changes in V1:

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

Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-mm@kvack.org

Anshuman Khandual (3):
  lib/vsprintf: Add support for pgtable entries
  kunit: printf: Add test for pgtable entries
  mm: Replace pgtable entry prints with new format

 Documentation/core-api/printk-formats.rst | 19 ++++++++
 lib/tests/printf_kunit.c                  | 57 ++++++++++++++++++++++
 lib/vsprintf.c                            | 58 +++++++++++++++++++++++
 mm/memory.c                               | 15 ++----
 scripts/checkpatch.pl                     |  2 +-
 5 files changed, 140 insertions(+), 11 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-10 11:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10  4:35 [RFC V2 0/3] lib/vsprintf: Add support for pgtable entries Anshuman Khandual
2026-06-10  4:35 ` [RFC V2 1/3] " Anshuman Khandual
2026-06-10 11:13   ` Usama Arif
2026-06-10  4:35 ` [RFC V2 2/3] kunit: printf: Add test " Anshuman Khandual
2026-06-10  4:35 ` [RFC V2 3/3] mm: Replace pgtable entry prints with new format Anshuman Khandual

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox