linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/3] mm/ptdump: Drop assumption that pxd_val() is u64
@ 2025-04-07  5:31 Anshuman Khandual
  2025-04-07  5:31 ` [PATCH V2 1/3] mm/ptdump: Split note_page() into level specific callbacks Anshuman Khandual
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anshuman Khandual @ 2025-04-07  5:31 UTC (permalink / raw)
  To: linux-mm
  Cc: mark.rutland, Anshuman Khandual, Catalin Marinas, Will Deacon,
	Steven Price, Ryan Roberts, Madhavan Srinivasan, Nicholas Piggin,
	Paul Walmsley, Palmer Dabbelt, Gerald Schaefer, Heiko Carstens,
	Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Alexander Gordeev,
	Andrew Morton, linux-arm-kernel, linux-kernel, linuxppc-dev,
	linux-riscv, linux-s390

Last argument passed down in note_page() is u64 assuming pxd_val() returned
value (all page table levels) is 64 bit - which might not be the case going
ahead when D128 page tables is enabled on arm64 platform. Besides pxd_val()
is very platform specific and its type should not be assumed in generic MM.
A similar problem exists for effective_prot(), although it is restricted to
x86 platform.

This series splits note_page() and effective_prot() into individual page
table level specific callbacks which accepts corresponding pxd_t page table
entry as an argument instead and later on all subscribing platforms could
derive pxd_val() from the table entries as required and proceed as before.

Define ptdesc_t type which describes the basic page table descriptor layout
on arm64 platform. Subsequently all level specific pxxval_t descriptors are
derived from ptdesc_t thus establishing a common original format, which can
also be appropriate for page table entries, masks and protection values etc
which are used at all page table levels.

This series has been tested on arm64 platform but it does build on other
relevant platforms (v6.15-rc1).

Changes in V2:

- Added a patch to split effective_prot() callback per Alexander
- Added a patch to define ptdesc_t data type on arm64 platform per Ryan

Changes in V1:

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

- Added note_page_flush() callback and implemented the same on all
  subscribing platforms
- Moved note_page() argument change from u64 to pteval_t on arm64 platform
  from second patch to the first patch instead

Changes in RFC:

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

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Steven Price <steven.price@arm.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-arm-kernel@lists.infradead.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

Anshuman Khandual (3):
  mm/ptdump: Split note_page() into level specific callbacks
  mm/ptdump: Split effective_prot() into level specific callbacks
  arm64/mm: Define ptdesc_t

 arch/arm64/include/asm/pgtable-types.h | 20 +++++---
 arch/arm64/include/asm/ptdump.h        | 24 ++++++---
 arch/arm64/kernel/efi.c                |  4 +-
 arch/arm64/kernel/pi/map_kernel.c      |  2 +-
 arch/arm64/kernel/pi/map_range.c       |  4 +-
 arch/arm64/kernel/pi/pi.h              |  2 +-
 arch/arm64/mm/mmap.c                   |  2 +-
 arch/arm64/mm/ptdump.c                 | 50 ++++++++++++++++--
 arch/powerpc/mm/ptdump/ptdump.c        | 46 ++++++++++++++++-
 arch/riscv/mm/ptdump.c                 | 46 ++++++++++++++++-
 arch/s390/mm/dump_pagetables.c         | 46 ++++++++++++++++-
 arch/x86/mm/dump_pagetables.c          | 71 +++++++++++++++++++++++++-
 include/linux/ptdump.h                 | 15 ++++--
 mm/ptdump.c                            | 62 ++++++++++++++--------
 14 files changed, 339 insertions(+), 55 deletions(-)

-- 
2.25.1



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

end of thread, other threads:[~2025-04-07  5:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-07  5:31 [PATCH V2 0/3] mm/ptdump: Drop assumption that pxd_val() is u64 Anshuman Khandual
2025-04-07  5:31 ` [PATCH V2 1/3] mm/ptdump: Split note_page() into level specific callbacks Anshuman Khandual
2025-04-07  5:31 ` [PATCH V2 2/3] mm/ptdump: Split effective_prot() " Anshuman Khandual
2025-04-07  5:31 ` [PATCH V2 3/3] arm64/mm: Define ptdesc_t Anshuman Khandual

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