]> xenbits.xensource.com Git - xen.git/commit
xen/common: Add NUMA node id bounds check to page_alloc.c/node_to_scrub
authorShawn Anastasio <sanastasio@raptorengineering.com>
Tue, 26 Sep 2023 22:37:39 +0000 (17:37 -0500)
committerStefano Stabellini <stefano.stabellini@amd.com>
Wed, 27 Sep 2023 23:28:55 +0000 (16:28 -0700)
commita363089e68ed677fef12c296253535753fe817e3
tree86160fec26de6e7541809996426f0562749ab636
parent0595f9685466cafd6fb4c91c2319de481e6b7ec0
xen/common: Add NUMA node id bounds check to page_alloc.c/node_to_scrub

When building for Power with CONFIG_DEBUG unset, a compiler error gets
raised inside page_alloc.c's node_to_scrub function:

common/page_alloc.c: In function 'node_to_scrub.part.0':
common/page_alloc.c:1217:29: error: array subscript 1 is above array
            bounds of 'long unsigned int[1]' [-Werror=array-bounds]
 1217 |         if ( node_need_scrub[node] )

It appears that this is a false positive, given that in practice
cycle_node should never return a node ID >= MAX_NUMNODES as long as the
architecture's node_online_map is properly defined and initialized, so
this additional bounds check is only to satisfy GCC.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/common/page_alloc.c