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

Re: [PATCH] core-parking: fix build with gcc12 and NR_CPUS=1


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 9 Sep 2022 14:14:04 +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=AeDyfZx8AvLEIZUYNderXlon8dG0bY8Eyiwiv/Ay7lg=; b=I0Jz8ShgVZuy0IJ9qQj5bZme+ACQr4OAjlLVFdEkKOPQz8L1y3qTc+jU21W0Y85u3pkL+Urf6H7dwMwqDb4cLsWvdy1+NYr05YwmFZkgpkjaXwaubCDiyRyCEPY/uRX2vYtCF1y+f8hHgCMMPQMYweopyDxWwOoZO5pdL/pBgE3RcvQR3YhSJXwcInAU15UKr8HRUrYzgS0OhngqrugY8KgKPvkV/u8MhdMTj5wRyPFDu7eBThonHWYmEezGYAVS5VWNwpmQt51S3bAvgA3a3o6OlIZ50/GhkcTvh9Z2sb7TPv6y1m+9ETHlthmomE+EEhiMzNkYAbMcGq8Lnp7wSQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RteA2+wYAKaVHXHF6l7Xyc2YGEusYuUn6JoCsjDLu/XjghhS0mY5dpk+05baooZe1NW314ncmHmfogUGvyVr5zPCZnqrTYe/w0nEN0+oCX2OfSu88Cd7Lzg2huSGsV0wX10CI7tEumVKyv6b3JRhZ27ZUA5CS2/RGmb45xHX0rlbG2mdtFRJvEfyPlr0Dv5sBso/fHQ+x67VEDubVydwrIFB1DqQ8XAzjf5XgmWlM4Qc+JojI4wOTNa1HRY3rV5JT3n9kAAwiHRP5yijFiLNfHgBBr2pzWCcVvanTQgKYDsifCB+CL8VOHUCz8X/Loz2XSAspfktk5iIPnrubocCtQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 09 Sep 2022 12:14:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09.09.2022 13:00, Julien Grall wrote:
> On 09/09/2022 11:18, Jan Beulich wrote:
>> Gcc12 takes issue with core_parking_remove()'s
>>
>>      for ( ; i < cur_idle_nums; ++i )
>>          core_parking_cpunum[i] = core_parking_cpunum[i + 1];
>>
>> complaining that the right hand side array access is past the bounds of
>> 1. Clearly the compiler can't know that cur_idle_nums can only ever be
>> zero in this case (as the sole CPU cannot be parked).
>>
>> Beyond addressing the immediate issue also adjust core_parking_init():
>> There's no point registering any policy when there's no CPU to park.
>> Since this still doesn't result in the compiler spotting that
>> core_parking_policy is never written (and hence is continuously NULL),
>> also amend core_parking_helper() to avoid eventual similar issues there
>> (minimizing generated code at the same time).
> 
> Given that CONFIG_NR_CPUS is a build time option. Wouldn't it be better
> to set CONFIG_CORE_PARKING=n and provide dummy helper for any function 
> that may be called unconditionally?

That might be an option, yes; not sure whether that's really better. It's
likely a more intrusive change ...

Jan



 


Rackspace

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