x86/mm: Consolidate all Xen L4 slot writing into init_xen_l4_slots()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 29 Aug 2017 10:35:31 +0000 (10:35 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Oct 2017 11:40:40 +0000 (12:40 +0100)
commit8d7b633adab76a778ccf3e3417e903b35333c528
treecca55b8dca5aa5029c75999a42bcef91206f4ec5
parent5cf67895f8c9fb4adcaab9172b43076599003db4
x86/mm: Consolidate all Xen L4 slot writing into init_xen_l4_slots()

There are currently three functions which write L4 pagetables for Xen, but
they all behave subtly differently.  sh_install_xen_entries_in_l4() in
particular is catering for two different usecases, which makes the safety of
the linear mappings hard to follow.

By consolidating the L4 pagetable writing in a single function, the resulting
setup of Xen's virtual layout is easier to understand.

No practical changes to the resulting L4, although the logic has been
rearranged to avoid rewriting some slots.  This changes the zap_ro_mpt
parameter to simply ro_mpt.

Both {hap,sh}_install_xen_entries_in_l4() get folded into their callers.  The
hap side only a single caller, while the shadow side has two.  The shadow
split helps highlight the correctness of the linear slots.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Release-acked-by: Julien Grall <julien.gral@linaro.org>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm.c
xen/arch/x86/mm/hap/hap.c
xen/arch/x86/mm/shadow/multi.c
xen/arch/x86/pv/dom0_build.c
xen/arch/x86/pv/domain.c
xen/include/asm-x86/mm.h