x86/p2m: {get,set}_entry hooks and p2m-pt.c are HVM-only
authorJan Beulich <jbeulich@suse.com>
Mon, 3 May 2021 13:29:24 +0000 (15:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 3 May 2021 13:29:24 +0000 (15:29 +0200)
commit8d012d3ddffcf9433befb756e14200c9a810f137
treec5057b266f34c176f838307c4ba7a692d9979682
parent936830c99dad6de757f5153206ccd334cc950bb2
x86/p2m: {get,set}_entry hooks and p2m-pt.c are HVM-only

With the hooks no longer needing setting, p2m_pt_init() degenerates to
(about) nothing when !HVM. As a result, p2m-pt.c doesn't need building
anymore in this case, as long as p2m_pt_init() has proper surrogates put
in place.

Unfortunately this means some new #ifdef-ary in p2m.c, but the mid-term
plan there is to get rid of (almost) all of it by splitting out the then
hopefully very few remaining non-HVM pieces.

While the movement of the paging_mode_translate() check from
p2m_remove_page() to guest_physmap_remove_page() may not be strictly
necessary anymore (it was in an early version of this change), it looks
more logical to live in the latter function, allowing to avoid acquiring
the lock in the PV case. All other callers of p2m_remove_page() already
have such a check anyway (in the altp2m case up the call stack).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/mm/Makefile
xen/arch/x86/mm/p2m-pt.c
xen/arch/x86/mm/p2m.c
xen/include/asm-x86/p2m.h
xen/include/xen/p2m-common.h