[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] IOMMU/x86: work around bogus gcc12 warning in hvm_gsi_eoi()
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Fri, 10 Jun 2022 09:20:04 +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=lEA6IMl8YlMCwvCPZ2+wucaeGxQUlLP1gmCEgyAOOs4=; b=O4KY6+ftGbD5jU8CbB1kGhLc0sEZoF6cb7lakB4xzX4VMw5rNbFpN6iiPjwi/heva8Mp1trxTjARLZKzmvZSc7/Q5ulho0unsGqZ1PZ9ejR1gJX6kpFenesO4Ee1yy3UeJgnbVkjkGIxyWJS27M8xRkZdQXbNjF7SIYaRGo362CuLsdiH+h3JDhqNgpdhi0PqZp6XoE5AhyvUtmtWRdzR1BLcoA8T+M+dJbKPVRG0Z2YvxORG/abDqWm08zhg2pjzwjU365dUfUdoxjK95WuDGbTpTmVZSQpqreyU/UY9HGK5E7r3ZZS2kRXjErx8YPaHCohCsxPWvLUhYhWQy9kqQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oCW+STYwHvQ2mjLrWF/fC6A7g/vSCurLkdf+Rj7P5fWZFuI1etUZfTGLqOUQQ5OxDzrbyXv2JsXaU+nvgeCrhjSYkIT9ShQJOPpvy/bzCZhhPh9pKRKdT42uw3nLVcnVJ5ktV9FxKQuKxiJ4WeZgRxj7+ew9mBIzZ1CMSyEE4E+5lLCRDAX2ppOEjgJF+n5+j+lDSZWJyUsELhIP5QQLTTi2YXKRSUBxtzNFXutAXn+GZSD3nD3mqskXam+C0et1kMwIgH4YYpLTWLb2I3XWDw/ExWEJxs3Ol28Orp2LkBW+gk1rdbEv7YHgv6kOSwvp9twI3Jn0o4NRsfktorq7XQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Delivery-date: Fri, 10 Jun 2022 07:21:42 +0000
- Ironport-data: A9a23:fnSW2qLrqVDZ+5wOFE+RoJQlxSXFcZb7ZxGr2PjKsXjdYENShjJTn GAXCzzTbPrfazD9ft1wbti/8E4FusXdydQyTFRlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokf0/0vrav67xZVF/fngqoDUUYYoAQgsA149IMsdoUg7wbRh3Ncw2YHR7z6l4 rseneWOYDdJ5BYsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DQUIhMdtNWc s6YpF2PEsE1yD92Yj+tuu6TnkTn2dc+NyDW4pZdc/DKbhSvOkXee0v0XRYRQR4/ttmHozx+4 OQRp43ucl0SBfLFgb05D0ZpNwxFPJQTrdcrIVDn2SCS52vvViK0ht9IUwQxN4Be/ftrC2ZT8 /BeMCoKch2Im+OxxvS8V/VogcMgasLsOevzuFk5lW2fUalgHsiFGv2UjTNb9G5YasRmB/HRa tBfcTNyRB/BfwdOKhEcD5dWcOKA2SKkK2AH+Qz9Sawf50/Q7QhX4JjUKZmMVIPWZ/cI2Wi3u TeTl4j+KlRAXDCF8hKH+H+xgu7EnQvgRZkfUra/85ZCkFCVg2AeFhASfV+6uuWizF6zXcpFL E4Z8TZoqrI9nGSzR8T5dw21pjiDpBF0ZjZLO+gz6QXIwKyL5Q+cXzAAVmQYMIJgs9IqTzs30 FPPh8nuGTFkrLySTzSa66uQqjSxfyMSKAfueBM5cOfM2PG7yKlbs/4FZo8yeEJpprUZwQ3N/ g0=
- Ironport-hdrordr: A9a23:Hm9nGa0fMV/kyRMbYVtAfwqjBS5yeYIsimQD101hICG9Lfb0qy n+pp4mPEHP4wr5OEtOpTlPAtjkfZr5z+8M3WBxB8baYOCCggeVxe5ZjbcKrweQeBEWs9Qtrp uIEJIOdOEYb2IK6voSiTPQe7hA/DDEytHPuQ639QYRcegAUdAF0+4WMHf4LqUgLzM2f6bRWa DskPZvln6FQzA6f867Dn4KU6zqoMDKrovvZVojCwQ84AeDoDu04PqieiLolis2Yndq+/MP4G LFmwv26uGKtOy68AbV0yv2445NkNXs59NfDIini9QTKB/rlgG0Db4REoGqjXQQmqWC+VwqmN 7Dr1MJONly0WrYeiWPrR7ky2DboUMTwk6n7WXdrWrooMT/Sj5/IdFGn5hlfhzQ7FdllM1g0Y pQtljp+6Z/PFflpmDQ9tLIXxZlmg6funw5i9MeiHRZTM83dKJRl4oC50lYea1wUR4S0LpXXt WGMfuspcq/KTihHjDkVyhUsZaRt00Ib1i7qhNogL3X79BU9EoJvXfwivZv3Evoz6hNNaWs19 60TZiAq4s+P/P+TZgNcNvpEvHHfVAkf3r3QRKvCGWiMp07EFTwjLOyyIkJxYiRCe81Jd0J6d /8bG8=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, May 27, 2022 at 12:37:19PM +0200, Jan Beulich wrote:
> As per [1] the expansion of the pirq_dpci() macro causes a -Waddress
> controlled warning (enabled implicitly in our builds, if not by default)
> tying the middle part of the involved conditional expression to the
> surrounding boolean context. Work around this by introducing a local
> inline function in the affected source file.
>
> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102967
> ---
> This is intended to replace an earlier patch by Andrew [2], open-coding
> and then simplifying the macro in the one problematic place.
>
> Note that, with pirq_dpci() presently used solely in the one file being
> changed here, we could in principle also remove the #define and use just
> an inline(?) function in this file. But then the macro would need
> reinstating as soon as a use elsewhere would become necessary.
>
> As to the inline - I think it's warranted here, but it goes against our
> general policy of using inline only in header files. Hence I'd be okay
> to drop it to avoid controversy.
>
> [2] https://lists.xen.org/archives/html/xen-devel/2021-10/msg01635.html
>
> --- a/xen/drivers/passthrough/x86/hvm.c
> +++ b/xen/drivers/passthrough/x86/hvm.c
> @@ -25,6 +25,18 @@
> #include <asm/hvm/support.h>
> #include <asm/io_apic.h>
>
> +/*
> + * Gcc12 takes issue with pirq_dpci() being used in boolean context (see gcc
> + * bug 102967). While we can't replace the macro definition in the header by
> an
> + * inline function, we can do so here.
> + */
> +static inline struct hvm_pirq_dpci *_pirq_dpci(struct pirq *pirq)
> +{
> + return pirq_dpci(pirq);
> +}
> +#undef pirq_dpci
> +#define pirq_dpci(pirq) _pirq_dpci(pirq)
That's fairly ugly. Seeing as pirq_dpci is only used in hvm.c, would
it make sense to just convert the macro to be a static inline in that
file? (and remove pirq_dpci() from irq.h).
Thanks, Roger.
|