x86/numa: allow arbitrary value of PXM in PXM<->node mapping
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Thu, 26 Feb 2015 13:05:13 +0000 (14:05 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 26 Feb 2015 13:05:13 +0000 (14:05 +0100)
commitebeefe181c50a05e91052aa0503f69f9f8ea0cba
tree5346d97d6261e1859b6dfe1ebd5654b3d17bf2c5
parentccb50193a76ada949cd3707f82c6c17303e4ad74
x86/numa: allow arbitrary value of PXM in PXM<->node mapping

ACPI defines proximity domain identifier as a 32-bit integer. While
in most cases the values will be zero-based this is not guaranteed,
making current pxm2node[256] mapping structure not appropriate.

We will instead use MAX_NUMNODES-sized array of struct pxm2node to
store PXM-to-node mapping. To accommodate common case of zero-based
and contiguios PXMs we will, whenever possible, try to use PXM as
index into this array for fast lookups.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Use ARRAY_SIZE(pxm2node) instead of MAX_NUMNODES in bounds checks.
Rename struct pxm_to_node to struct pxm2node (the structure tag
aliasing with the array defined using it is better than it aliasing
with a function name).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/srat.c
xen/include/asm-x86/numa.h