This seems to have been quite an oversight in Xen's NUMA support, albeit it
probably because NUMA was arch-specific at first.
This is unlikely to be useful for CONFIG_SEPARATE_XENHEAP builds, but that's
only ARM32 right now, and unlikely to be interested in NUMA.
Take the opportunity to sort the includes.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <xen/percpu.h>
#include <xen/cpu.h>
#include <xen/init.h>
#include <xen/mm.h>
+#include <xen/numa.h>
+#include <xen/percpu.h>
#include <xen/rcupdate.h>
#include <xen/sections.h>
static int init_percpu_area(unsigned int cpu)
{
+ nodeid_t node = cpu_to_node(cpu);
+ unsigned int memflags = node != NUMA_NO_NODE ? MEMF_node(node) : 0;
char *p;
if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
? 0
: -EBUSY;
- if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
+ if ( (p = alloc_xenheap_pages(PERCPU_ORDER, memflags)) == NULL )
return -ENOMEM;
memset(p, 0, __per_cpu_data_end - __per_cpu_start);