lkml.org 
[lkml]   [2017]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 4/4] x86/mm/dump_pagetables: Use helper to get the shadow PGD
Use kernel_to_shadow_pgdp() instead of open coding it.

Fixes: ca646ac417b8 ("x86/mm/debug_pagetables: Allow dumping current pagetables")
Fixes: 04bafab4b2ee ("x86/mm/dump_pagetables: Check Kaiser shadow page table for WX pages")
Requested-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/mm/dump_pagetables.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -504,8 +504,10 @@ void ptdump_walk_pgd_level(struct seq_fi

void ptdump_walk_pgd_level_debugfs(struct seq_file *m, pgd_t *pgd, bool shadow)
{
+#ifdef CONFIG_KAISER
if (shadow && kaiser_enabled)
- pgd += PTRS_PER_PGD;
+ pgd = kernel_to_shadow_pgdp(pgd);
+#endif
ptdump_walk_pgd_level_core(m, pgd, false, false);
}
EXPORT_SYMBOL_GPL(ptdump_walk_pgd_level_debugfs);
@@ -518,7 +520,7 @@ void ptdump_walk_shadow_pgd_level_checkw
if (!kaiser_enabled)
return;
pr_info("x86/mm: Checking shadow page tables\n");
- pgd += PTRS_PER_PGD;
+ pgd = kernel_to_shadow_pgdp(pgd);
ptdump_walk_pgd_level_core(NULL, pgd, true, false);
#endif
}

\
 
 \ /
  Last update: 2017-11-27 22:18    [W:0.055 / U:6.536 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site