x86/shadow: defer/avoid paging_mfn_is_dirty() invocation
authorJan Beulich <jbeulich@suse.com>
Mon, 6 Dec 2021 13:10:42 +0000 (14:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 6 Dec 2021 13:10:42 +0000 (14:10 +0100)
commitb4411416fee92cea6cd7a04bfda95bdf377f631e
tree0191a908970bae03779defbd4785928efb5c6b88
parentea0c08bc77fe7bd7e4e65c648e17752e91912d01
x86/shadow: defer/avoid paging_mfn_is_dirty() invocation

paging_mfn_is_dirty() is moderately expensive, so avoid its use unless
its result might actually change anything. This means moving the
surrounding if() down below all other checks that can result in clearing
_PAGE_RW from sflags, in order to then check whether _PAGE_RW is
actually still set there before calling the function.

While moving the block of code, fold two if()s and make a few style
adjustments.

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