Skip to content

Commit 0713ff3

Browse files
lyctwpalmer-dabbelt
authored andcommitted
riscv: Introduce PBMT field to PTDUMP
This patch introduces the PBMT field to the PTDUMP, so it can display the memory attributes for NC or IO. Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Tested-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent d5d2c26 commit 0713ff3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

arch/riscv/mm/ptdump.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ struct prot_bits {
135135

136136
static const struct prot_bits pte_bits[] = {
137137
{
138+
#ifdef CONFIG_64BIT
139+
.mask = _PAGE_MTMASK_SVPBMT,
140+
.set = "MT(%s)",
141+
.clear = " .. ",
142+
}, {
143+
#endif
138144
.mask = _PAGE_SOFT,
139145
.set = "RSW(%d)",
140146
.clear = " .. ",
@@ -205,6 +211,16 @@ static void dump_prot(struct pg_state *st)
205211
if (val) {
206212
if (pte_bits[i].mask == _PAGE_SOFT)
207213
sprintf(s, pte_bits[i].set, val >> 8);
214+
#ifdef CONFIG_64BIT
215+
else if (pte_bits[i].mask == _PAGE_MTMASK_SVPBMT) {
216+
if (val == _PAGE_NOCACHE_SVPBMT)
217+
sprintf(s, pte_bits[i].set, "NC");
218+
else if (val == _PAGE_IO_SVPBMT)
219+
sprintf(s, pte_bits[i].set, "IO");
220+
else
221+
sprintf(s, pte_bits[i].set, "??");
222+
}
223+
#endif
208224
else
209225
sprintf(s, "%s", pte_bits[i].set);
210226
} else {

0 commit comments

Comments
 (0)