x86: initialize memnodemapsize while faking NUMA node
authorWei Chen <wei.chen@arm.com>
Fri, 24 Sep 2021 09:02:20 +0000 (11:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 24 Sep 2021 09:02:20 +0000 (11:02 +0200)
commit728998f6f2b7e1420e771236efec65cbf6143b7b
tree307255b92fac0e79e5963f74af52f2dc550f2f68
parenta16cf950fc22fe269d9bbbae270203811bafab67
x86: initialize memnodemapsize while faking NUMA node

When system turns NUMA off or system lacks of NUMA support,
Xen will fake a NUMA node to make system works as a single
node NUMA system.

In this case the memory node map doesn't need to be allocated
from boot pages, it will use the _memnodemap directly. But
memnodemapsize hasn't been set. Xen should assert in phys_to_nid.
Because x86 was using an empty macro "VIRTUAL_BUG_ON" to replace
ASSERT, this bug will not be triggered on x86.

Actually, Xen will only use 1 slot of memnodemap in this case.
So we set memnodemap[0] to 0 and memnodemapsize to 1 in this
patch to fix it.

Signed-off-by: Wei Chen <wei.chen@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/numa.c