[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/passthrough: Fix hvm_gsi_eoi() build with GCC 12
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 28 Oct 2021 09:31:24 +0200
- 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=OXHP1hrv9uTrfHr1OoxQoKeUCSVR/pziD6tkAO1sNQw=; b=PWdAX4aytmqtt6t8rDrIDfrVBDQ2b/+jGnf8n7rtZYIF0zgH4DriuAPgeRwkBl0kQTqEVaeN598YN8EB4sc3qEMDO48pvyA0wWpAiuTQ+r1HZC+PhJfzofb6ESNa05bw2OE2fz2iYRFNZggSJsN0EMcKcdAbq3P/2T2Q0mpCiZNaaGPl+STLg/A6fB7VAd1B73WEpicBv7Tm5MuSZjSGfecB57Zjw7b2PHdmJkO71Qnk7XUDmVvlfPfVAkiMCrRZwxzSbr6PEU/A6ORL2MSvhY2nOJL0qqMrJPfBkqegyY5xwY//lUix+a/PNjK/AxUImixIfNNFtYKM3u+TU88Lkg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UPc35hQhDhXv+hTms8Xz/VfCGKe4qJgrYzRJBt+9UpZpgGqCE6iSPdJNouSVARx+RRRRyQJvsIGbL0YyL9UEgQ3H1+6x2lNnxGv8Agoiyv9le3xQxsQ6YrfwW6It7Gd0e4wgx7fFnzNDfFJYhPETrUv82ALl7BjZ81iU1tCriMIVDgTEXFHl9nTmepl//MmS6Bh6ZqawgeZ280MvEzfgf/mrw03T9xePxRFGmE7b+cYBkiYeMRPsUAEpwz8mZ0XGx4bViJnVVfeBWC/KZBTbQuRaoX/T9k8mU1x9ah/NtB8Tp5eVhOO+xniwAV/XZM0VyufwK3j5KaQQgo3RKUrhhw==
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
- Delivery-date: Thu, 28 Oct 2021 07:31:43 +0000
- Ironport-data: A9a23:uHQ4IaIlvqatxLKBFE+RJ5IlxSXFcZb7ZxGr2PjKsXjdYENS3mdRm zBLX27Sb67eambxc4glbIuzpk5T75CDytc3TVBlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUZUideSc+EH140Eo5y7Zg6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB3Ypf581 tRHm6euWEQOGYHxgaMCXzJxRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsF2gcsuNo/zNZ43sXB81zDJS/0hRPgvRo2Xu44BjGZu16iiG97RN o0VMz1FNC77YhtOYHYlLZUkjMa30yyXnzpw9wvO+PtfD3Lo5BN1+KjgNpzSYNPibcRKnG6Iq 2Te5WP7DxoGctuFxlKt4n+qw+PCgy7/cIYTD6GjsO5nhkWJwW4eAwFQUkG0ydGboEOjX9NUK 2QP5zEj66M18SSWosLVBkPi5iTe51hFBoQWQ7ZSBByxJrT8sjy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O11HYSb2KgbGSpwEIXheOitK1tp 0QApSWaueAdWSS5PySiGLTfqdCsbv3gJxAx92utEuFJTsaFZ2IhD0JczpzfHcGIzWvUvECZe WhD4d81nCdUEVSSv7+KmgOXuDFqdGOvJX6YSQeDxpizAWVlzun5JPzDhDdh34lIn9y6IZn1V KAvx3y562lvf3+4hjA11XL55ATvNf60NNMCOGFl8BQADTxjQSDYphnRtS5zX0IidDqzGxvvM jHoh8mMcg2w3TNflutqR+o4AXk2CZG0Q6q9XaoxV/Y5eDpTjMzDMRMwahDdAHC1kYmtNZglI pWwmOwrfNsfFL9tRW4w+KNewBhl0Kyr3Znu/UUlWZjXYwXb6IUhZAD/XlSDIwLEEvBmc4a+d FVfYLhDcttABGnhyizhBgr/DXsZAV9Iv6+eDlDhiTPuAIm2EyQzCMjtboidzk7hdUAoqJ/lp b525JT5cZzp/8tHNFA7dg6ML6K40z2MFrx2TGpUB/a/J9uAQO4l3ew2sRy2N2X
- Ironport-sdr: XRCSgrGeoXAi6NUaueYdd3aoBgTk5pTSYcD3kSHP0WUtKilbCfbz3mviN3eaQthCAI7vGbyzQo KbeZmHc8v7u2J3z2iodTyQQ2XMJHqvbOc/nOiomXpDb72XNadW2FjMTayk+3x0rulrVmk4mULd 2GcfOjV4Sqiy89a2uiboAVMGR5eRDI3JIK8x0UkQRuEE8Cjmt0lxJjraIgk45YGVWGd1Qc2JRh SAG9ryWsLyBWzRdRYNdsu2GMHHD+3HYWdzxFC04IZy5M511MNsyDez+W2BNujBS4FaBNozAdpJ FwNgUup4WeK402FB9S4qXv6V
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Oct 27, 2021 at 09:07:13PM +0100, Andrew Cooper wrote:
> GCC master (nearly version 12) complains:
>
> hvm.c: In function 'hvm_gsi_eoi':
> hvm.c:905:10: error: the comparison will always evaluate as 'true' for the
> address of 'dpci' will never be NULL [-Werror=address]
> 905 | if ( !pirq_dpci(pirq) )
> | ^
> In file included from /local/xen.git/xen/include/xen/irq.h:73,
> from /local/xen.git/xen/include/xen/pci.h:13,
> from /local/xen.git/xen/include/asm/hvm/io.h:22,
> from /local/xen.git/xen/include/asm/hvm/domain.h:27,
> from /local/xen.git/xen/include/asm/domain.h:7,
> from /local/xen.git/xen/include/xen/domain.h:8,
> from /local/xen.git/xen/include/xen/sched.h:11,
> from /local/xen.git/xen/include/xen/event.h:12,
> from hvm.c:20:
> /local/xen.git/xen/include/asm/irq.h:140:34: note: 'dpci' declared here
> 140 | struct hvm_pirq_dpci dpci;
> | ^~~~
>
> The location marker is unhelpfully positioned and upstream may get around to
> fixing it. The complaint is intended to be:
>
> if ( !((pirq) ? &(pirq)->arch.hvm.dpci : NULL) )
> ^~~~~~~~~~~~~~~~~~~~~~
>
> which is a hint that the code is should be simplified to just:
>
> if ( !pirq )
I likely need more coffee, but doesn't this exploit how the macro
(pirq_dpci) is currently coded?
IOW we could change how pirq_dpci is implemented and then that
relation might no longer be true. What we care in hvm_gsi_eoi is not
only having a valid pirq, but also having a valid dpci struct which
will only be the case if the PIRQ is bound to an HVM domain, and that
is what the check tries to represent.
I know this is not how pirq_dpci is currently implemented, but I don't
see why it couldn't change in the future.
Thanks, Roger.
|