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

Re: [PATCH] rombios: Work around GCC issue 99578


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 18 Aug 2023 10:44:31 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=dkkICFPreOaQveNDAg4ZJAP9zGfSiosFc50pt6gdbsI=; b=f3Ur3U5aYx+afFCNV0K+v8rmi+qrNF1hXBrEkQvL+G+iZ148Ng78+nGmd1UVvJddiIo5SGw/RcM7PAXqm889oxuvDnMks958L0JPYo9eWD78KpJ7xHGHtfzI/J5GoosoHHwpQBrQbJPbHiF1r1CYwADVp9n/05eoO2E52B3hgO2u/n0T40P+Ax/q2q5Jjz5NHK10oc2baFifmcQPOCVtr1eS0pGmLOOF54++a08znFfXpcF4bE+94FRwQuOy3vbw8o6Bkw9RdN6BQV+m1m4BAbOAUmiYr52HgH7ICm+Yaxl10Xq9JZG6z8Hje3eUbTOVIj+7+PmwxA9NMnJ4b+k+LQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SbbT4H3GXwFDD0KEg9jJXQEjwrSBi8CrhVetv5JHYYAMCZX53XAxxxOcLIHxW/ewmAml5ayQNzZqDEhcfkFsewh+eiK6UIOwj+EE1rWPvNFamuxGXEMKdg0X6ISURaeSdKBgA3PoTmhVvlZjQgSuHeuGALjWancZltDW8rfA0276nZUSRm4UMU8tj9Iu0oko+524L1A3axiogNqc1m5fTOqZbTw8JEtMBItdz7Di1SCtJCyHJeWStGw5+Fajmt3dSKfzObMdaDU+XoRV/DIKttOtdTt20eNpLULL6RhkFIuPmVDEt/z9lOpKdFcHuwsRsGVcVgl+P+IsThYON3b+FQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 18 Aug 2023 09:44:59 +0000
  • Ironport-data: A9a23:El8lNa19C6i2mf2j1fbD5f5wkn2cJEfYwER7XKvMYLTBsI5bp2RTx mcbXjjQafqKZTSmfY1/adjnp0sCsJ/TxodiTgVkpC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gxnNagS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfMVxA0 dglBBkxKR293u+zwon8EstomZF2RCXrFNt3VnBI6xj8VapjZK+ZBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxouC6Kk1QZPLvFabI5fvSjQ8lPk1nej WXB52njWTkRNcCFyCrD+XWp7gPKtXqhANlLSObjrZaGhnWO/VRNFjcaSWG4//6CuGXjBNlgM UA9r39GQa8asRbDosPGdx+yrWOAvxUcc8FNCOB84waIooLL5y6JC25CSSROAPQ2uclzSTE02 1uhm9LyGScpoLCTUWia9LqfsXW1Iyd9EIMZTSoNTA9A5sa5pog21k7LVow6T/bzicDpEzbtx TzMtDI5m7gYkc8M0eO84EzDhDWv4JPOS2bZ+znqY45s1SshDKbNWmBiwQGzASpoRGpBcmS8g Q==
  • Ironport-hdrordr: A9a23:mlotI6ocNL1ahUmhojFbTK4aV5rveYIsimQD101hICG9Evb0qy nOpoV/6faQslwssR4b9uxoVJPvfZq+z+8W3WByB9eftWDd0QPFEGgL1+DfKlbbak7DH4BmtJ uJc8JFeafN5VoRt7eG3OFveexQvOVu88qT9JjjJ28Gd3APV0n5hT0JcjpyFCdNNW57LKt8Lr WwzOxdqQGtfHwGB/7LfUXsD4D41rv2fIuNW29+OyIa
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18/08/2023 7:50 am, Jan Beulich wrote:
> On 17.08.2023 22:45, Andrew Cooper wrote:
>> GCC 12 objects to pointers derived from a constant:
>>
>>   util.c: In function 'find_rsdp':
>>   util.c:429:16: error: array subscript 0 is outside array bounds of 
>> 'uint16_t[0]' {aka 'short unsigned int[]'} [-Werror=array-bounds]
>>     429 |     ebda_seg = *(uint16_t *)ADDR_FROM_SEG_OFF(0x40, 0xe);
>>   cc1: all warnings being treated as errors
>>
> Yet supposedly the bug was fixed in 12.1 (and the fix also backported to
> 11.3). Did you spot anything in ADDR_FROM_SEG_OFF() and this particular
> use of it that is different from the patterns mentioned in that bug?

$ gcc --version
gcc (GCC) 12.2.1 20221121

At a guess, only a partial fix was backported into 12.1.  AIUI, it was
an area of logic which had already seen significant development in 13
before the behaviour was reverted.

The only thing interesting about ADDR_FROM_SEG_OFF() is the constant
folding required for the expression to become *(uint16_t *)0x40e, which
(I suspect) is why it compiles fine at -Og but fails at -O2.

>> This is a GCC bug, but work around it rather than turning array-bounds
>> checking off generally.
> I certainly agree here. I guess it's not worth trying to restrict the
> workaround for rombios (I will want to try doing so in the hypervisor).

Can I translate this to an ack?

~Andrew



 


Rackspace

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