Commit cdfa0bad authored by Juergen Gross's avatar Juergen Gross Committed by David Vrabel

xen: switch to post-init routines in xen mmu.c earlier

With the virtual mapped linear p2m list the post-init mmu operations
must be used for setting up the p2m mappings, as in case of
CONFIG_FLATMEM the init routines may trigger BUGs.

paging_init() sets up all infrastructure needed to switch to the
post-init mmu ops done by xen_post_allocator_init(). With the virtual
mapped linear p2m list we need some mmu ops during setup of this list,
so we have to switch to the correct mmu ops as soon as possible.

The p2m list is usable from the beginning, just expansion requires to
have established the new linear mapping. So the call of
xen_remap_memory() had to be introduced, but this is not due to the
mmu ops requiring this.

Summing it up: calling xen_post_allocator_init() not directly after
paging_init() was conceptually wrong in the beginning, it just didn't
matter up to now as no functions used between the two calls needed
some critical mmu ops (e.g. alloc_pte). This has changed now, so I
corrected it.
Reported-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent dbdd7476
...@@ -1225,6 +1225,7 @@ static void __init xen_pagetable_p2m_setup(void) ...@@ -1225,6 +1225,7 @@ static void __init xen_pagetable_p2m_setup(void)
static void __init xen_pagetable_init(void) static void __init xen_pagetable_init(void)
{ {
paging_init(); paging_init();
xen_post_allocator_init();
xen_pagetable_p2m_setup(); xen_pagetable_p2m_setup();
...@@ -1236,7 +1237,6 @@ static void __init xen_pagetable_init(void) ...@@ -1236,7 +1237,6 @@ static void __init xen_pagetable_init(void)
xen_remap_memory(); xen_remap_memory();
xen_setup_shared_info(); xen_setup_shared_info();
xen_post_allocator_init();
} }
static void xen_write_cr2(unsigned long cr2) static void xen_write_cr2(unsigned long cr2)
{ {
......
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