2020-05-19 15:12:11

by Jan Beulich

[permalink] [raw]
Subject: [PATCH] ix86: keep page table dumping off hypervisor area

Commit bba42affa732 ("x86/mm: Fix dump_pagetables with Xen PV") took
care of only the 64-bit case, albeit I think the 32-bit issue predates
the commit mentioned there in the Fixes: tag. For the 32-bit case, as
long as this space is mapped (by the hypervisor) with large pages, no
(noticable) harm results from walking even that area. If there are 4k
mappings, though, HIGHPTE=y configurations wanting to also dump that
range will find a need to map page tables owned by the hypervisor (which
hence doesn't allow them to be mapped). With DEBUG_WX this in turn
causes booting to fail.

Signed-off-by: Jan Beulich <[email protected]>

--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -366,7 +366,7 @@ static void ptdump_walk_pgd_level_core(s
{0, PTRS_PER_PGD * PGD_LEVEL_MULT / 2},
{GUARD_HOLE_END_ADDR, ~0UL},
#else
- {0, ~0UL},
+ {0, __FIXADDR_TOP + PAGE_SIZE ?: ~0UL},
#endif
{0, 0}
};