x86/shadow: replace bogus return path in shadow_get_page_from_l1e()
authorJan Beulich <jbeulich@suse.com>
Tue, 2 Mar 2021 11:30:30 +0000 (12:30 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 2 Mar 2021 11:30:30 +0000 (12:30 +0100)
commit4834936549f788378918da8e9bc97df7dd3ee16d
tree4add3931674db5653407579e67c2a24426a11804
parent2de43f834ad2d758dd7b3441a6d1398491f18eae
x86/shadow: replace bogus return path in shadow_get_page_from_l1e()

Prior to be640b1800bb ("x86: make get_page_from_l1e() return a proper
error code") a positive return value did indicate an error. Said commit
failed to adjust this return path, but luckily the only caller has
always been inside a shadow_mode_refcounts() conditional.

Subsequent changes caused 1 to end up at the default (error) label in
the caller's switch() again, but the returning of 1 (== _PAGE_PRESENT)
is still rather confusing here, and a latent risk.

Convert to an ASSERT() instead, just in case any new caller would
appear.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/arch/x86/mm/shadow/multi.c