[PATCH 05/17] s390/mm: Show write-combining attribute in page table dump
From: Heiko Carstens
Date: Thu Dec 03 2026 - 05:34:02 EST
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@xxxxxxxxxxxxx>
Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
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