All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Julien Grall <julien@xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] core-parking: fix build with gcc12 and NR_CPUS=1
Date: Fri, 9 Sep 2022 14:14:04 +0200	[thread overview]
Message-ID: <6da822fb-e900-156b-334d-8bc573b74aee@suse.com> (raw)
In-Reply-To: <bf0d5470-efce-c7f7-d429-78d7fb9517d1@xen.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


  reply	other threads:[~2022-09-09 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 10:18 [PATCH] core-parking: fix build with gcc12 and NR_CPUS=1 Jan Beulich
2022-09-09 11:00 ` Julien Grall
2022-09-09 12:14   ` Jan Beulich [this message]
2022-09-09 12:27     ` Julien Grall
2022-09-09 14:21       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6da822fb-e900-156b-334d-8bc573b74aee@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.