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

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


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 24 Oct 2022 09:26:00 +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=uPaDHwW2Nd27hbTBtl7yBYj4ui9VHqKZz/zBBXiF8uA=; b=W0KQHi3vnEOJm8oCijW9TtWOYlQqoXO50S3cuC4RQqQHu4IpzxtsfckMN9YG2Du8RwozL90FYA3VZOxwMRsAZOTHyaro5j/Dj4fmnPYaIXahMv1Ppw+v6tzLup0jIwYi9eDAFLtjtu+UTsqKugke9YP1+YRp5iaRBQA7KN12hNKSkT0ESKQ328ISgBf2r+yTlW8YO/Nt7nO228SpmVX0ZZvELdpEPuQDV5ABMN7ycTvKkQJ2OwltHK7ldS/dpXPTt8oYiczehLYsxOITrRWpXrki6YhETYBOOAZfhF1QuG9tfEvGpLUVg6URuZnKwcWM50ZKeFyC2DIzNHcIruemJA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yu1OAr9bbNPUeIz3liHC+lbbzWZav4XNvf+JvBZfrcIMs5M45dfM9mESU0P0mA1jlMWoZc2sB5E5stNKGmMz2/FbrAmvMukpEv07Zt1KYzbFj2C+34/JWcE49YArXD+rgaWKZBiyNTuhA5WYcJJQw8qb/3cbd02uZDuAJaLec8WJut52ZQYPRoncwb5B8Eqf6lphOfQwSvf1n6hXwDcwiiSXJNbsIDDPYgCgj7aIl4fu/bLk0ZzIT0PXZ7YMvHNhI41zIhAAYHwUxyNc1PNMZ2uFNmuVof01lM1aPqjUxKUbXwmrKclACtD3wjpZA+H6+4W7mcYSn1Whp+s3L3dzRA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
  • Delivery-date: Mon, 24 Oct 2022 07:26:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.10.2022 17:30, Julien Grall wrote:
> Is this intended for 4.17?

Well, yes, it was meant to be - it has been ...

> On 09/09/2022 15:30, Jan Beulich wrote:

... well over a month since it was sent.

>> --- a/xen/arch/x86/sysctl.c
>> +++ b/xen/arch/x86/sysctl.c
>> @@ -157,7 +157,7 @@ long arch_do_sysctl(
>>           long (*fn)(void *);
>>           void *hcpu;
>>   
>> -        switch ( op )
>> +        switch ( op | -(CONFIG_NR_CPUS == 1) )
> This code is quite confusing to read and potentially risky as you are 
> are relying the top bit of 'op' to never be 1. While I am expecting this 
> will ever be the case, this will be a "fun" issue to debug if this ever 
> happen. So I would suggest to check CONFIG_NR_CPUS == 1 separately.

You're aware that we use this pattern in a few other places already (I
guess in my local tree I have one or two which aren't upstream yet)? Just
grep for "switch[^_].*[|]" to see them. Also note that it's not just the
top bit of "op" - we merely assume "op" will never be ~0. Personally I
prefer this way of coding the logic, but if at least one of the other x86
maintainers agreed with you, I'd be okay to switch to using a separate
if().

Jan



 


Rackspace

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