x86/shadow: streamline shadow_get_page_from_l1e()
authorJan Beulich <jbeulich@suse.com>
Tue, 27 Apr 2021 12:36:13 +0000 (14:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 27 Apr 2021 12:36:13 +0000 (14:36 +0200)
commit972ba1d1d4bcb77018b50fd2bb63c0e628859ed3
treeaf13578d051b2905d606164095ee3a72d76d4279
parenta76f6ea1ebc67f5ce27ee4a19c226dc0fd390d6b
x86/shadow: streamline shadow_get_page_from_l1e()

Trying get_page_from_l1e() up to three times isn't helpful; in debug
builds it may lead to log messages making things look as if there was a
problem somewhere. And there's no need to have more than one try: The
function can only possibly succeed for one domain passed as 3rd
argument (unless the page is an MMIO one to which both have access,
but MMIO pages should be "got" by specifying the requesting domain
anyway). Re-arrange things so just the one call gets made which has a
chance of succeeding.

The code could in principle be arranged such that there's only a single
call to get_page_from_l1e(), but the conditional would become pretty
complex then and hence hard to follow / understand / adjust.

The redundant (with shadow_mode_refcounts()) shadow_mode_translate()
gets dropped.

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