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

Re: [PATCH for-4.16] x86/passthrough: Fix hvm_gsi_eoi() build with GCC 12


  • To: Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 4 Nov 2021 09:07:47 +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=9gcqew/cT6mEn33a5vopPSuLysDz0wbCMrM2k/usQCU=; b=AwvyW7Pltg7di158DlYnW2QyTeBEsqGrLVgmvRbCUHoYPouD+3+/oRetL3KGneoa4DfjcYafDdm50947QS1egfs4J/jjHN9tC2/Nl/+KMvAslw3hG3IFpA1fAs0BucpY5tkcoGd7oFYeS90i5QqaEQ0QubDefY1+FTR1YCvD4MQTFSdw0k8TSug2iR6aR7PuZHnlGFxlT4SMocQXhDenI+VoI1owXM1y+Wos/FoX+Obuicc9MBACB4wb6DnXV39PGvKHNx6ZjPqBZLrl7bycW9l5tublucWTVaBZB1rPgTdpENjFCdEt0yVlWFoa9XrHag2/NH+uhBHwRCvllswcOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X7BEDNpnlY3V4pYZBlFbg7eZeEH6kIHaurvjZa+h/Ab4Vs0GmGxZnpqifgldxHmRYZX33UkBIL85QTpg4ONbUnDieA2KdXBsPTVuVixciZTNd+95TXSRwhHVWs7DFfPFQUUNFyT7qEaVEgjl6izprwsCRgo7U1CGt7sKqzpmTBgKeCwZO+wK1WHhpYFhG7XhD5KJEHoB8k3iZNqeU0LEAV/W6s9ZMproDvbueNruf81Yko8DvuhdzFv07r8H5GLWWtEk6bs6y+E0cxK/gIIFV7/toaoM086fyHZAuVt6OMVDujbN/t/8rDgy5qj48M/+2+a42C/4udpAr8e3regalw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 04 Nov 2021 08:08:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.11.2021 17:13, Ian Jackson wrote:
> Jan Beulich writes ("Re: [PATCH] x86/passthrough: Fix hvm_gsi_eoi() build 
> with GCC 12"):
>> On 27.10.2021 22:07, Andrew Cooper wrote:
>>>   if ( !((pirq) ? &(pirq)->arch.hvm.dpci : NULL) )
>>
>> I disagree with the compiler's analysis: While &(pirq)->arch.hvm.dpci
>> indeed can't be NULL, that's not the operand of !. The operand of !
>> can very well be NULL, when pirq is.
>>
>>> which is a hint that the code is should be simplified to just:
>>>
>>>   if ( !pirq )
>>>
>>> Do so.
>>
>> And I further agree with Roger's original reply (despite you
>> apparently having managed to convince him): You shouldn't be open-
>> coding pirq_dpci(). Your observation that the construct's result
>> isn't otherwise used in the function is only one half of it. The
>> other half is that hvm_pirq_eoi() gets called from here, and that
>> one does require the result to be non-NULL.
> 
> Can you (collectively) please come to some agreement here ?
> I think this is mostly a question of taste or style.

Personally I don't think open-coding of constructs is merely a style /
taste issue. The supposed construct changing and the open-coded
instance then being forgotten (likely not even noticed) can lead to
actual bugs. I guess the issue should at least be raised as one against
gcc12, such that the compiler folks can provide their view on whether
the warning is actually appropriate in that case (and if so, what their
take is on a general approach towards silencing such warnings when
they're identified as false positives).

Jan




 


Rackspace

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