aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2017-04-14 01:45:16 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2017-04-27 08:20:27 -0400
commitfd893fe56a1307d348fe5c077eb9b654288ce0c5 (patch)
tree6c2f204a6203864550dce7f2fd6be8565a6a0f00
parent6c01bbd2cf8cbc1906818b402b10bca2283c4e7e (diff)
powerpc/mm: Fix missing page attributes in page table dump
On some targets, _PAGE_RW is 0 and this is _PAGE_RO which is used. There is also _PAGE_SHARED that is missing. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/book3s/64/pgtable.h1
-rw-r--r--arch/powerpc/mm/dump_linuxpagetables.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index fb8380a2d8d5..85bc9875c3be 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -13,6 +13,7 @@
13#define _PAGE_BIT_SWAP_TYPE 0 13#define _PAGE_BIT_SWAP_TYPE 0
14 14
15#define _PAGE_RO 0 15#define _PAGE_RO 0
16#define _PAGE_SHARED 0
16 17
17#define _PAGE_EXEC 0x00001 /* execute permission */ 18#define _PAGE_EXEC 0x00001 /* execute permission */
18#define _PAGE_WRITE 0x00002 /* write access allowed */ 19#define _PAGE_WRITE 0x00002 /* write access allowed */
diff --git a/arch/powerpc/mm/dump_linuxpagetables.c b/arch/powerpc/mm/dump_linuxpagetables.c
index bb136ac6ac55..ec4906994726 100644
--- a/arch/powerpc/mm/dump_linuxpagetables.c
+++ b/arch/powerpc/mm/dump_linuxpagetables.c
@@ -121,8 +121,13 @@ static const struct flag_info flag_array[] = {
121 .set = "user", 121 .set = "user",
122 .clear = " ", 122 .clear = " ",
123 }, { 123 }, {
124#if _PAGE_RO == 0
124 .mask = _PAGE_RW, 125 .mask = _PAGE_RW,
125 .val = _PAGE_RW, 126 .val = _PAGE_RW,
127#else
128 .mask = _PAGE_RO,
129 .val = 0,
130#endif
126 .set = "rw", 131 .set = "rw",
127 .clear = "ro", 132 .clear = "ro",
128 }, { 133 }, {
@@ -222,6 +227,10 @@ static const struct flag_info flag_array[] = {
222 .mask = _PAGE_SPECIAL, 227 .mask = _PAGE_SPECIAL,
223 .val = _PAGE_SPECIAL, 228 .val = _PAGE_SPECIAL,
224 .set = "special", 229 .set = "special",
230 }, {
231 .mask = _PAGE_SHARED,
232 .val = _PAGE_SHARED,
233 .set = "shared",
225 } 234 }
226}; 235};
227 236