aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2014-11-03 08:02:01 -0500
committerThomas Gleixner <tglx@linutronix.de>2014-11-16 05:04:26 -0500
commitf439c429c320981943f8b64b2a4049d946cb492b (patch)
tree95ba3c1354e67444560ec2ce3c9657a41e27f68c /arch/x86/mm
parent87ad0b713b1034b6caf559976c35ce47f6d1d1e9 (diff)
x86: Support PAT bit in pagetable dump for lower levels
Dumping page table protection bits is not correct for entries on levels 2 and 3 regarding the PAT bit, which is at a different position as on level 4. Based-on-patch-by: Stefan Bader <stefan.bader@canonical.com> Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: stefan.bader@canonical.com Cc: xen-devel@lists.xensource.com Cc: konrad.wilk@oracle.com Cc: ville.syrjala@linux.intel.com Cc: david.vrabel@citrix.com Cc: jbeulich@suse.com Cc: toshi.kani@hp.com Cc: plagnioj@jcrosoft.com Cc: tomi.valkeinen@ti.com Cc: bhelgaas@google.com Link: http://lkml.kernel.org/r/1415019724-4317-16-git-send-email-jgross@suse.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/dump_pagetables.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
index 95a427e57887..6c2ca03a5346 100644
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -126,7 +126,7 @@ static void printk_prot(struct seq_file *m, pgprot_t prot, int level, bool dmsg)
126 126
127 if (!pgprot_val(prot)) { 127 if (!pgprot_val(prot)) {
128 /* Not present */ 128 /* Not present */
129 pt_dump_cont_printf(m, dmsg, " "); 129 pt_dump_cont_printf(m, dmsg, " ");
130 } else { 130 } else {
131 if (pr & _PAGE_USER) 131 if (pr & _PAGE_USER)
132 pt_dump_cont_printf(m, dmsg, "USR "); 132 pt_dump_cont_printf(m, dmsg, "USR ");
@@ -145,18 +145,16 @@ static void printk_prot(struct seq_file *m, pgprot_t prot, int level, bool dmsg)
145 else 145 else
146 pt_dump_cont_printf(m, dmsg, " "); 146 pt_dump_cont_printf(m, dmsg, " ");
147 147
148 /* Bit 9 has a different meaning on level 3 vs 4 */ 148 /* Bit 7 has a different meaning on level 3 vs 4 */
149 if (level <= 3) { 149 if (level <= 3 && pr & _PAGE_PSE)
150 if (pr & _PAGE_PSE) 150 pt_dump_cont_printf(m, dmsg, "PSE ");
151 pt_dump_cont_printf(m, dmsg, "PSE "); 151 else
152 else 152 pt_dump_cont_printf(m, dmsg, " ");
153 pt_dump_cont_printf(m, dmsg, " "); 153 if ((level == 4 && pr & _PAGE_PAT) ||
154 } else { 154 ((level == 3 || level == 2) && pr & _PAGE_PAT_LARGE))
155 if (pr & _PAGE_PAT) 155 pt_dump_cont_printf(m, dmsg, "pat ");
156 pt_dump_cont_printf(m, dmsg, "pat "); 156 else
157 else 157 pt_dump_cont_printf(m, dmsg, " ");
158 pt_dump_cont_printf(m, dmsg, " ");
159 }
160 if (pr & _PAGE_GLOBAL) 158 if (pr & _PAGE_GLOBAL)
161 pt_dump_cont_printf(m, dmsg, "GLB "); 159 pt_dump_cont_printf(m, dmsg, "GLB ");
162 else 160 else