]> git.proxmox.com Git - mirror_qemu.git/commit
spapr_numa.c: parametrize FORM1 macros
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 20 Sep 2021 17:49:43 +0000 (14:49 -0300)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 30 Sep 2021 02:26:06 +0000 (12:26 +1000)
commit3a6e4ce684e48988f9736aecc6b365609e83f8d1
treeceec284e31c35daa819f8466b02cd27f3a5e0adf
parentafa3b3c9ee8ae2c7c25c93f2d6eebe09e962cd3a
spapr_numa.c: parametrize FORM1 macros

The next preliminary step to introduce NUMA FORM2 affinity is to make
the existing code independent of FORM1 macros and values, i.e.
MAX_DISTANCE_REF_POINTS, NUMA_ASSOC_SIZE and VCPU_ASSOC_SIZE. This patch
accomplishes that by doing the following:

- move the NUMA related macros from spapr.h to spapr_numa.c where they
are used. spapr.h gets instead a 'NUMA_NODES_MAX_NUM' macro that is used
to refer to the maximum number of NUMA nodes, including GPU nodes, that
the machine can support;

- MAX_DISTANCE_REF_POINTS and NUMA_ASSOC_SIZE are renamed to
FORM1_DIST_REF_POINTS and FORM1_NUMA_ASSOC_SIZE. These FORM1 specific
macros are used in FORM1 init functions;

- code that uses MAX_DISTANCE_REF_POINTS now retrieves the
max_dist_ref_points value using get_max_dist_ref_points().
NUMA_ASSOC_SIZE is replaced by get_numa_assoc_size() and VCPU_ASSOC_SIZE
is replaced by get_vcpu_assoc_size(). These functions are used by the
generic device tree functions and h_home_node_associativity() and will
allow them to switch between FORM1 and FORM2 without changing their core
logic.

Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20210920174947.556324-4-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_numa.c
include/hw/ppc/spapr.h