mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Mike Rapoport <rppt@kernel.org>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [PATCH 05/17] s390/mm: Show write-combining attribute in page table dump
Date: Thu,  3 Dec 2026 11:33:33 +0100	[thread overview]
Message-ID: <20261203103345.1206548-6-hca@linux.ibm.com> (raw)
In-Reply-To: <20261203103345.1206548-1-hca@linux.ibm.com>

Print "WC" for mappings with the MIO write-back bit set, so they are no
longer merged with otherwise identical non-WC mappings.

Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
 arch/s390/mm/dump_pagetables.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/s390/mm/dump_pagetables.c b/arch/s390/mm/dump_pagetables.c
index 7533dc22e0e9..21eb1243c9d2 100644
--- a/arch/s390/mm/dump_pagetables.c
+++ b/arch/s390/mm/dump_pagetables.c
@@ -31,7 +31,7 @@ struct pg_state {
 	struct ptdump_state ptdump;
 	struct seq_file *seq;
 	int level;
-	unsigned int current_prot;
+	unsigned long current_prot;
 	bool check_wx;
 	unsigned long wx_pages;
 	unsigned long start_address;
@@ -54,7 +54,7 @@ struct pg_state {
 		seq_puts(__m, fmt);		\
 })
 
-static void print_prot(struct seq_file *m, unsigned int pr, int level)
+static void print_prot(struct seq_file *m, unsigned long pr, int level)
 {
 	static const char * const level_name[] =
 		{ "ASCE", "PGD", "PUD", "PMD", "PTE" };
@@ -65,7 +65,10 @@ static void print_prot(struct seq_file *m, unsigned int pr, int level)
 		return;
 	}
 	pt_dump_seq_puts(m, (pr & _PAGE_PROTECT) ? "RO " : "RW ");
-	pt_dump_seq_puts(m, (pr & _PAGE_NOEXEC) ? "NX\n" : "X\n");
+	pt_dump_seq_puts(m, (pr & _PAGE_NOEXEC) ? "NX" : "X");
+	if (pr & mio_wb_bit_mask)
+		pt_dump_seq_puts(m, " WC");
+	pt_dump_seq_puts(m, "\n");
 }
 
 static void note_prot_wx(struct pg_state *st, unsigned long addr)
@@ -92,7 +95,7 @@ static void note_prot_wx(struct pg_state *st, unsigned long addr)
 	st->wx_pages += (addr - st->start_address) / PAGE_SIZE;
 }
 
-static void note_page_update_state(struct pg_state *st, unsigned long addr, unsigned int prot, int level)
+static void note_page_update_state(struct pg_state *st, unsigned long addr, unsigned long prot, int level)
 {
 	struct seq_file *m = st->seq;
 
@@ -114,11 +117,11 @@ static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level,
 	unsigned long delta;
 	struct pg_state *st;
 	struct seq_file *m;
-	unsigned int prot;
+	unsigned long prot;
 
 	st = container_of(pt_st, struct pg_state, ptdump);
 	m = st->seq;
-	prot = val & (_PAGE_PROTECT | _PAGE_NOEXEC);
+	prot = val & (_PAGE_PROTECT | _PAGE_NOEXEC | mio_wb_bit_mask);
 	if (level == 4 && (val & _PAGE_INVALID))
 		prot = _PAGE_INVALID;
 	/* For pmd_none() & friends val gets passed as zero. */
-- 
2.53.0


  parent reply	other threads:[~2026-12-03 10:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 10:33 [PATCH 00/17] s390/mm: Large kernel mappings for vmalloc and execmem ROX cache Heiko Carstens
2026-12-03 10:33 ` [PATCH 01/17] s390/boot: Initialize asce_limit for init_mm properly Heiko Carstens
2026-12-03 10:33 ` [PATCH 02/17] s390/pageattr: Only account direct mapping in direct map page counters Heiko Carstens
2026-12-03 10:33 ` [PATCH 03/17] s390/mm: Serialize kernel page table changes with init_mm mmap lock Heiko Carstens
2026-12-03 10:33 ` [PATCH 04/17] s390/vmem: Use generic page table allocators for vmem page tables Heiko Carstens
2026-12-03 10:33 ` Heiko Carstens [this message]
2026-12-03 10:33 ` [PATCH 06/17] s390/mm: Implement HAVE_ARCH_HUGE_VMAP Heiko Carstens
2026-12-03 10:33 ` [PATCH 07/17] s390/mm: Implement HAVE_ARCH_HUGE_VMALLOC Heiko Carstens
2026-12-03 10:33 ` [PATCH 08/17] s390/pageattr: Add helpers to replace kernel page table entries Heiko Carstens
2026-12-03 10:33 ` [PATCH 09/17] s390/mm: Add _SEGMENT_ENTRY_TYPE Heiko Carstens
2026-12-03 10:33 ` [PATCH 10/17] s390/pageattr: Use common helper to change kernel page table permissions Heiko Carstens
2026-12-03 10:33 ` [PATCH 11/17] s390/pageattr: Avoid splitting mappings if permissions do not change Heiko Carstens
2026-12-03 10:33 ` [PATCH 12/17] s390/pageattr: Mark intentional 4k kernel mappings Heiko Carstens
2026-12-03 10:33 ` [PATCH 13/17] s390/pageattr: Collapse kernel mappings after changing page attributes Heiko Carstens
2026-12-03 10:33 ` [PATCH 14/17] s390/mm: Add PAGE_KERNEL_ROX Heiko Carstens
2026-12-03 10:33 ` [PATCH 15/17] s390/execmem: Add EXECMEM_KPROBES range Heiko Carstens
2026-12-03 10:33 ` [PATCH 16/17] s390/execmem: Add EXECMEM_FTRACE range Heiko Carstens
2026-12-03 10:33 ` [PATCH 17/17] s390/execmem: Enable EXECMEM_ARCH_ROX Heiko Carstens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203103345.1206548-6-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=rppt@kernel.org \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®