Skip to content

Commit

Permalink
x86/shadow: move shadow_set_l<N>e() to their own source file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jbeulich committed Apr 12, 2021
1 parent a3621d6 commit b49f8bd
Show file tree
Hide file tree
Showing 4 changed files with 450 additions and 400 deletions.
2 changes: 1 addition & 1 deletion xen/arch/x86/mm/shadow/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ifeq ($(CONFIG_SHADOW_PAGING),y)
obj-y += common.o guest_2.o guest_3.o guest_4.o
obj-y += common.o guest_2.o guest_3.o guest_4.o set.o
obj-$(CONFIG_HVM) += hvm.o
obj-$(CONFIG_PV) += pv.o
else
Expand Down

0 comments on commit b49f8bd

Please sign in to comment.