x86/shadow: move shadow_set_l<N>e() to their own source file
authorJan Beulich <jbeulich@suse.com>
Mon, 12 Apr 2021 10:31:19 +0000 (12:31 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 12 Apr 2021 10:31:19 +0000 (12:31 +0200)
commitb49f8bda2399002e3cfaa472cc6959ec2ac20526
tree73a02905b7053016db62639e15b64ef3900f8737
parenta3621d6b4a919c49fc04234776569c435bae0ce7
x86/shadow: move shadow_set_l<N>e() to their own source file

The few GUEST_PAGING_LEVELS dependencies (of shadow_set_l2e() only) can
be easily expressed by function parameters; I suppose the extra indirect
call is acceptable for the increasingly little used 32-bit non-PAE case.
This way shadow_set_l[12]e(), each of which compiles to almost 1k of
code, need building just once.

The implication is the need for some "relaxation" in types.h: The
underlying PTE types don't vary anymore (and aren't expected to down the
road), so they as well as some basic helpers can be exposed even in the
new, artificial GUEST_PAGING_LEVELS == 0 case.

Almost pure code movement - exceptions are the conversion of
"#if GUEST_PAGING_LEVELS == 2" to runtime conditionals and style
corrections (including to avoid open-coding mfn_to_maddr() and
PAGE_OFFSET()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/Makefile
xen/arch/x86/mm/shadow/multi.c
xen/arch/x86/mm/shadow/set.c [new file with mode: 0644]
xen/arch/x86/mm/shadow/types.h