Commit 0713ff33 authored by Yu Chien Peter Lin's avatar Yu Chien Peter Lin Committed by Palmer Dabbelt

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: default avatarYu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Tested-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20230921025022.3989723-3-peterlin@andestech.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent d5d2c264
...@@ -135,6 +135,12 @@ struct prot_bits { ...@@ -135,6 +135,12 @@ struct prot_bits {
static const struct prot_bits pte_bits[] = { static const struct prot_bits pte_bits[] = {
{ {
#ifdef CONFIG_64BIT
.mask = _PAGE_MTMASK_SVPBMT,
.set = "MT(%s)",
.clear = " .. ",
}, {
#endif
.mask = _PAGE_SOFT, .mask = _PAGE_SOFT,
.set = "RSW(%d)", .set = "RSW(%d)",
.clear = " .. ", .clear = " .. ",
...@@ -205,6 +211,16 @@ static void dump_prot(struct pg_state *st) ...@@ -205,6 +211,16 @@ static void dump_prot(struct pg_state *st)
if (val) { if (val) {
if (pte_bits[i].mask == _PAGE_SOFT) if (pte_bits[i].mask == _PAGE_SOFT)
sprintf(s, pte_bits[i].set, val >> 8); sprintf(s, pte_bits[i].set, val >> 8);
#ifdef CONFIG_64BIT
else if (pte_bits[i].mask == _PAGE_MTMASK_SVPBMT) {
if (val == _PAGE_NOCACHE_SVPBMT)
sprintf(s, pte_bits[i].set, "NC");
else if (val == _PAGE_IO_SVPBMT)
sprintf(s, pte_bits[i].set, "IO");
else
sprintf(s, pte_bits[i].set, "??");
}
#endif
else else
sprintf(s, "%s", pte_bits[i].set); sprintf(s, "%s", pte_bits[i].set);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment