x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
authorJan Beulich <jbeulich@suse.com>
Tue, 30 Mar 2021 13:32:59 +0000 (15:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 30 Mar 2021 13:32:59 +0000 (15:32 +0200)
commit90629587e16e2efdb61da77f25c25fba3c4a5fd7
tree2fdef36ad3771e59245d257dc04dd207e7ebbc2a
parentd26a4691ea3a5eea7df9c8b49e09aad7f067cdfc
x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()

15 apparently once used to be the last valid type to request a callback
for, and the dimension of the respective array. The arrays meanwhile are
larger than this (in a benign way, i.e. no caller ever sets a mask bit
higher than 15), dimensioned by SH_type_unused. Have the ASSERT()s
follow suit and add build time checks at the call sites.

Sadly at least some Clang versions aren't as flexible with
_Static_assert() as gcc is - they demand a truly integer constant
expression, while gcc also permits constant variables.

Also adjust a comment naming the wrong of the two functions.

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