xen: switch to post-init routines in xen mmu.c earlier
authorJuergen Gross <jgross@suse.com>
Wed, 10 Dec 2014 15:56:03 +0000 (16:56 +0100)
committerDavid Vrabel <david.vrabel@citrix.com>
Thu, 11 Dec 2014 12:05:53 +0000 (12:05 +0000)
commitcdfa0badfc8849ad1b7fc0188e17e2a0ede81ba9
tree7ab467f8725f1a0e07b01ef32f3b3f412a3384d2
parentdbdd74763f1faf799fbb9ed30423182e92919378
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: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/xen/mmu.c