I've had a look at the x86 code where this error comes from:
/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
static inline const struct cpumask *cpumask_of_node(int node)
{
return node_to_cpumask_map[node];
}
So it seems the error arises because it is asked for a negative index from the node_to_cpumask_map array. Interestingly the same name for sparc has handling for the case the argument is -1:
in drivers/base/arch_numa.c there is a debug version for this name which returns cpu_all_mask as sparc and powerpc for NUMA_NO_NODE (include/linux/numa.h:#define NUMA_NO_NODE (-1)):
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
/*
* Returns a pointer to the bitmask of CPUs on Node 'node'.
*/
const struct cpumask *cpumask_of_node(int node)
{
if (node == NUMA_NO_NODE) return cpu_all_mask;
if (WARN_ON(node < 0 || node >= nr_node_ids)) return cpu_none_mask;
if (WARN_ON(node_to_cpumask_map[node] == NULL)) return cpu_online_mask;
I've had a look at the x86 code where this error comes from:
/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ of_node( int node) cpumask_ map[node] ;
static inline const struct cpumask *cpumask_
{
return node_to_
}
So it seems the error arises because it is asked for a negative index from the node_to_cpumask_map array. Interestingly the same name for sparc has handling for the case the argument is -1:
#define cpumask_ of_node( node) ((node) == -1 ? \
cpu_ all_mask : \
&numa_ cpumask_ lookup_ table[node] )
and so does powerpc:
#define cpumask_ of_node( node) ((node) == -1 ? \
cpu_ all_mask : \
node_ to_cpumask_ map[node] )
in drivers/ base/arch_ numa.c there is a debug version for this name which returns cpu_all_mask as sparc and powerpc for NUMA_NO_NODE (include/ linux/numa. h:#define NUMA_NO_NODE (-1)):
#ifdef CONFIG_ DEBUG_PER_ CPU_MAPS
/* of_node( int node)
* Returns a pointer to the bitmask of CPUs on Node 'node'.
*/
const struct cpumask *cpumask_
{
if (node == NUMA_NO_NODE)
return cpu_all_mask;
if (WARN_ON(node < 0 || node >= nr_node_ids))
return cpu_none_mask;
if (WARN_ON( node_to_ cpumask_ map[node] == NULL))
return cpu_online_mask;
return node_to_ cpumask_ map[node] ; SYMBOL( cpumask_ of_node) ;
}
EXPORT_
#endif
Based on these alternative implementations it seems as though cpumask_of_node for x86 should be something like:
/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ of_node( int node) cpumask_ map[node] ;
static inline const struct cpumask *cpumask_
{
return node == -1 ? cpu_all_mask : node_to_
}
I have insufficient knowledge about this stuff to say that is definitely the case though.