]> xenbits.xensource.com Git - xen.git/commit
x86/shadow: slightly consolidate sh_unshadow_for_p2m_change() (part III)
authorJan Beulich <jbeulich@suse.com>
Thu, 18 Aug 2022 07:29:04 +0000 (09:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Aug 2022 07:29:04 +0000 (09:29 +0200)
commit6270081c57978ff32d76d8eb11196fd217f7af2d
treebd8b155f0f5bbc83c69f8506e3f7c1da17069db1
parent241702e064604dbb3e0d9b731aa8f45be448243b
x86/shadow: slightly consolidate sh_unshadow_for_p2m_change() (part III)

In preparation for reactivating the presently dead 2M page path of the
function, also deal with the case of replacing an L1 page table all in
one go. Note that the prior comparing of MFNs to bypass the removal of
shadows was insufficient (but kind of benign, for being dead code so
far) - at the very least the R/W bit also needs considering there (to be
on the safe side, compare the full [virtual] PTEs).

While adjusting the first conditional in the loop for the use of the new
local variable "nflags", also drop mfn_valid(): If anything we'd need to
compare against INVALID_MFN, but that won't come out of l1e_get_mfn().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/hvm.c