[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Core parking broken with NR_CPUS=1
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 22 Feb 2023 17:17:05 +0100
- 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=ZedYKDsnFMcEA9XU9STZjvC78cDO0bEbNWZr8fKPBsE=; b=S+6xdy9fEW6BW6tt6DoHvly05hLxzk0LDMUzl7iJ2EryQ2+YE0kewbh/eWJoBbdOwC26xhNe9zS4HafGmfC4kTLppo2kDAmxXxPAdVxgfCuAknKYjKfnYys7NWv36dmlCkpd2DoJKVsqF9+yS+1Kk70L5u/KreDR8M7tUn3wRPAsQ9hOCoe8QGj5dGWsOvR5zMYc2/2qs2ukPxWOhg/zuNcZLm+tH2XgL08nhgfNeF+bz17Q99n7/fDHeAKozzWPXq8HiC783mBmJAy1+FlXqJJ8vmke1ButEqHq5uZbEjb6tRMQYDeEDpHIOvGTd2RRJ1eXhBr1k9wbwszvpssBKQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V7VZHdKUQH5bdDV5oifPuzsOIz+nLyBu26gS9ZypsK19GWXA3spwZJvjYt2i2wSxxzWMq2ianKogtos9cFm5axbU40irR/lvXae0+Sms5U71EUFhDiUw8KZmJdPDLTAbkOXAzTeGQerAT3VNGmPyoF6/j0GlCs7x4pmKI53fVMGuDIilvrbHR+x+5m57TrVpGlUHy3+Rnt6C76+d25XCu40+BZD3xg1hmp9aGAc3fScsI2fk5NnoYzybrwk65EchOOmHfD7c5EWJcAcrnw5J1u99j+ITZrCJkNraJscF2qwxc2+yErkqLSbVOP08LDzajpNUlorGrSiC7aPH73N8SA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 22 Feb 2023 16:17:11 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 22.02.2023 17:04, Andrew Cooper wrote:
> While testing the rebuilt debian unstable container, I found:
>
> common/core_parking.c: In function 'core_parking_remove':
> common/core_parking.c:230:53: error: array subscript 1 is above array
> bounds of 'unsigned int[1]' [-Werror=array-bounds]
> 230 | core_parking_cpunum[i] = core_parking_cpunum[i + 1];
> | ~~~~~~~~~~~~~~~~~~~^~~~~~~
> common/core_parking.c:31:21: note: while referencing 'core_parking_cpunum'
> 31 | static unsigned int core_parking_cpunum[NR_CPUS] = {[0 ...
> NR_CPUS-1] = -1};
> | ^~~~~~~~~~~~~~~~~~~
>
>
> which is an legitimate complaint - this logic is simply broken with
> NR_CPUS=1.
>
> In principle, I think the best fix is probably to have CORE_PARKING
> depend on NR_CPUS > 1, except none of the interacting x86 code has been
> written in a way that would be compatible.
>
> But it also occurs to me that this is the kind of thing an embedded x86
> usecase would want to compile. Frankly, its niche even on regular x86
> use-cases.
>
> Except having looked at the code, it's a different to the other thing we
> call core parking which is the smt=0 logic to keep the stacks valid for
> cores/threads we don't want to use, because of #MC broadcast problems -
> and this logic does need to stay.
>
> Thoughts?
See "core-parking: fix build with gcc12 and NR_CPUS=1" sent back in September
last year.
Jan
|