[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] xen/common: Add NUMA node id bounds check to page_alloc.c/node_to_scrub


  • To: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 26 Sep 2023 09:36:59 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DMGChRXatFv19aPSq+AYc7mOaZLe2KktImoXX6jxMMk=; b=jnOoev5bOOx+xM8uLo7Yk8Yr/ByTIkfkeePCArXpc3V5wYY+RfLBv6KLlnolwkC8a1uAkQyyzJaUFZFDTPONKu+SUKhYokXFM7mQztbMcYzfe+Yb98aHh7FbKy6s1nSzz8j/ydrvCMiTd3J0Owqh/9bfFR2u5hmrxcXrteLOwFd3HHRRNEi1lnKfHXbnHQPxqwBq7CUqZBsuWqpkB//pW8l58Zf5jIt9666Oq3sIrRTbZN81+3DCZHVgfAlWlSj3B9uP1TsjkQDsHsjqSwiUPc5dd0opmlOC/o89kWjVifNzCu6T4d3/NWmhCzLpSHlhhIv9Nd52ImZxNFgr1ssx1A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=auCCB/rXJlnOuAbceL4LPNFNlinqT2w4Hoxym3+Ta2iqrGOQA9Yk+zn5u6CqIiHp+w7EU6ZeBVg8rbFojftJ9o6uma2DmUFI+kj7Jxh8sxLlNGxVlrCreCE2PdAP5WM+fYXyNkiAa0UscpBXp4A2iUKmTlaZV5R/ui5ET6QZx8qKd62JzV89eYL5oG2l80Thm/Sa0lgdrOEqPrZc3gid8EoWeIj9frMdZVfhhvu1zyZwQ+dfg202sECeS4m96X1DQHYkLyTBmF4NacuDisPcs4O4w1xVmVdTdb8Ez1n999xNvdGCYl5YsCLKoCsPZKngF5Gnj9SgcXTZ5sajsyTM1Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 26 Sep 2023 07:37:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.09.2023 09:32, Jan Beulich wrote:
> On 26.09.2023 00:42, Shawn Anastasio wrote:
>> When building for Power with CONFIG_DEBUG unset,

Hmm, depending on what gcc versions are used in CI, the above may be the
reason why ...

>> a compiler error gets
>> raised inside page_alloc.c's node_to_scrub function, likely due to the
>> increased optimization level:
>>
>> 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] )
> 
> That's gcc13?
> 
>> 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.
> 
> Looks very similar to the situation that c890499871cc ("timer: fix
> NR_CPUS=1 build with gcc13") was dealing with, just that here it's
> MAX_NUMNODES. I'd therefore prefer a solution similar to the one
> taken there, i.e. make code conditional rather than add yet more
> code.
> 
> Otherwise, ...
> 
>> --- a/xen/common/page_alloc.c
>> +++ b/xen/common/page_alloc.c
>> @@ -1211,6 +1211,9 @@ static unsigned int node_to_scrub(bool get_node)
>>          } while ( !cpumask_empty(&node_to_cpumask(node)) &&
>>                    (node != local_node) );
>>
>> +        if ( node >= MAX_NUMNODES )
>> +            break;
> 
> ... this clearly redundant check would need to gain a comment.
> 
> What I'm puzzled by is that on Arm we had no reports of a similar
> problem, despite NUMA also not getting selected there (yet).

... this wasn't observed, yet. As far as I'm concerned, all my Arm builds
are debug ones (which I may need to change).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.