[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 11:18:13 +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=y8rxcG5NehhkNjXvZQ5+TFotq+ci1Zucu0pwzb5LsSI=; b=hbRSyS2hpzw173LR0Nvjr3LDFWwjPAj7uoKNuRMSUNlBIPG7P2cFikeBSZAfhHUrXf5rrELaDS6758yBngoLH7MoK+98qzS2lKBnOiWtLqjVxGiBLjBcCVPn0pIu4Ts4zaKrQz6P/QQZ5FPg5Z6rA6vq3t/B3zHIqHjtx4R2faAJFuxN3XBVBzYd0CJXSD1/VET+fa5CLPG0VsQTEi7AXkliNzNT1EhGwYfLHntK5DqiZ/YB+lHtFIesrKz//K/Lo3xKTIrS1FSXFcSSbhLXa8f5ftQTo919MzhTV10RYYofosutT6mE9+wriONY9TnzBNodH71B5LESnmcjxfA01g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e0ggcCamaLiVaSHXdQeZHz4RogHUlLp2Sy4QCXD+vAKSxJf6AUs7lwtA3tlUatAiAVr7iUSIuEJBFBN34x9Wz8k+TdQUAYxUWTqBCEeOtqnPXYF1tfX35Q7oE+67ZayK/JzUsnN7rKE13gfjLOxEnA/CywubYzg0jOK411Zq693dW8nJ7/aLoIvmqqvs2l7RpCCmDKtJYnbwzsekrNQTl81ClIY2cL5osmk6h03h4Mn5IuPMRpOamVfv6pCbVBAE7dQqJykACUCu/ueUjWYquYlki24z6fGfNLn5HvhCn97yCH6H7VzHtkJwo3x5J3zipB6v5MTLvqyTanzzSCcTbQ==
- 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 10:18:39 +0000
- Ironport-data: A9a23:nisOXKlMaqST8p9BtY4glXvo5gyjJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xIXWGCOMquDMWrxedsjYN/jo05SuZ/XyddlTwNlry0wQSMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgb5Q+GzhH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 fk/FW0OPz6AvOyZkI67V8Zi3sY7PMa+aevzulk4pd3YJdAPZMmZBoD1v5pf1jp2gd1SF/HDY cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVklI3jOeF3Nn9I7RmQe18mEqCq 32A1GP+GhwAb/SUyCaf82LqjejK9c/+cNtITuDmr6I03TV/wEQ3WDoabAPjoMK6iwnlae9WB xFJ/SMh+P1aGEuDC4OVsweDiHyOswMYWtFQO/Yn8wzLwa3Riy6GAkAUQzgHb8Yp3OcmSDpv2 lKXktfBAT10rKbTWX+b7q2Trz65JW4SN2BqWMMfZQ4M4t2mpZ5piBvKF4xnCPTt0oKzHizsy TeXqiR4n68UkcMAy6S8+xbAni6ooZ/KCAUy4207Q16Y0++wX6b9D6TA1LQRxa8owFqxJrVZg EU5pg==
- Ironport-hdrordr: A9a23:a53gL6lq4VKbcP+QG1poCrYaSW/pDfLS3DAbv31ZSRFFG/Fw9v re+MjzuiWatN98Yh8dcLO7Scy9qBHnhP1ICOAqVN/INmSLhILPFuBfBODZsl/d8kPFltJ15O NYaK55B8T3DV9myejHwCTQKadH/PC3tJmyg+HQ1nFsShwvTZpBwUNWNia3e3cGIzWvP/ACZe KhDw581kOdUGVSV9+8AHYdWejFupnwrbrDJTMHHQcg8gmSjTWugYSKaCSl4g==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 18/08/2023 11:09 am, Jan Beulich wrote:
> On 18.08.2023 11:44, Andrew Cooper wrote:
>> 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.
> Hmm, for 12 I didn't think there was any backporting involved.
>
>> 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.
> Oh, the relevant aspect may be that is is below 4k (which I think is
> their heuristic offset to guess "almost NULL" dereferencing).
Ah yes, I remember that aspect now you've pointed it out.
Yeah, that's probably it.
>>>> 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?
> You can now:
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Thanks.
|