[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 11:57:14 +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=KAdz/fKBfUohqW4NY8nypDWZFJbGBsWAmpP3H1gnypU=; b=OTcbfaJUa5MYfDsE6RhKfVu2Sd9/twU05qe4NyDdR+WhuHLIGzb0HFqmgOTSU45DfryndmRyqWlbUYpH2+6tG/mgpKFa1loNL7Tl7CbUEVwRH3j6wgoVNvzlvZDQaDvDjjgV+F16YH2/VncgsoSzD/xm05LSQ7Y6qOATaToxtQsnPdTBIzw0Z5+4Cm0qEPiHiHnDfbnyWJssVx7/d0nFYqYJ6aGqrQ4+K/gQQFmQbEwEla9lCrF4gIyM+HZcFvbW9nMqKcn37SUqtsNdkaIllxVGQeqMTAGIYa01fQT+ZGo6YBWkQ/iz87U1Wq2D3bN6uWj/Zn7f8SqGAQecZEOSOQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VvouZJgs3TzbvE8MLxcsI3zfEuEa5VtXVNSMVtBP/933rt+OLn2n4ZsuYWKC1zPRosgnJd7Yd7MJIWdDP5ptZE6Q78eePg7nSqFi2lzGIc+YnkZjfX6ksgV7GJ9uAdmdKzj8h15DMAlTpWq/GW7HWyMn2SXx6g34m/6euTCShXqn+yBWHR7kKSLy4N/OQIgPoG/NoWTYOWnx+Whp5WUku8x7+6Zhba/VUfqfhhq0XJuvj85hxt1AUE9OAmENCBUhmdG7FeCuZ19nPyFjQZ4sw8f8Ljhipk4DF76Lqiu0q6fvmFlHRfCmfZp1q7ncYmRptayhDuI1yte6dRp48uISug==
  • 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 09:57:27 +0000
  • Ironport-data: A9a23:q6pmeqKy9qVYkwj/FE+Rp5QlxSXFcZb7ZxGr2PjKsXjdYENS0TADz GJLWWHXOP2OZWr1fthzO4jn/BsG68LTmt9lSwBlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokf0/0vrav67xZVF/fngqoDUUYYoAQgsA149IMsdoUg7wbRh3Ncw2YHR7z6l4 rseneWOYDdJ5BYsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DQUIhMdtNWc s6YpF2PEsE1yD92Yj+tuu6TnkTn2dc+NyDW4pZdc/DKbhSvOkXee0v0XRYRQR4/ttmHozx+4 NdL65qpSA4mArD3mO9FWilUPTt6IKITrdcrIVDn2SCS52vvViK1ht5JVQQxN4Be/ftrC2ZT8 /BeMCoKch2Im+OxxvS8V/VogcMgasLsOevzuFk5lW2fUalgHM6FGvqUjTNb9G5YasRmB/HRa tBfcTNyRB/BfwdOKhEcD5dWcOKA2SKmLmcE8QL9SawfuzD96ggu1bfUNoTUfcCnav5xk3e4u TeTl4j+KlRAXDCF8hKH+H+xgu7EnQvgRZkfUra/85ZCkFCVg2AeFhASfV+6uuWizF6zXcpFL E4Z8TZoqrI9nGSzR8T5dw21pjiDpBF0ZjZLO+gz6QXIwa2N5Q+cXzEAVmQYN4Jgs9IqTzs30 FPPh8nuGTFkrLySTzSa66uQqjSxfyMSKAfueBM5cOfM2PG7yKlbs/4FZo8L/HKd5jEtJQzN/ g==
  • Ironport-hdrordr: A9a23:jICWmKkVC5Mdu4nrpo3E2IsJFk3pDfO+imdD5ihNYBxZY6Wkfp +V8cjzhCWftN9OYhodcLC7V5Voj0mskKKdxbNhRYtKOzOWw1dATbsSlLcKpgeNJ8SQzI5gPM tbAstD4ZjLfCJHZKXBkXaF+rQbsb66GcmT7I+xrkuFDzsaDZ2Ihz0JdjpzeXcGIDWua6BJdq Z1saF81kedkDksH42GL0hAe9KGi8zAlZrgbxJDLxk76DOWhTftzLLhCRCX0joXTjsKmN4ZgC P4uj28wp/mn+Cwyxfa2WOWx5NKmOH5wt8GIMCXkMAaJhjllw7tToV8XL+puiwzvYiUmR4Xue iJhy1lE9V46nvXcG3wiRzx2zP42DJr0HPmwU/wuwqWneXJABYBT+ZRj4NQdRXUr2A6ustn7a 5N12WF87JKEBLphk3Glpf1fiAvsnDxjWspkOYVgXAae5AZcqVtoYsW+14QOIscHRj99JssHI BVfY3hDc5tABKnhk3izylSKITGZAVxIv7GeDlOhiWt6UkZoJgjpHFohvD2nR87hecAotd/lq H5259T5cBzp/8tHNxA7dg6MLuK40z2MGXx2TGpUCLa/J9uAQO/l7fHpJMI2cqNRLskiLMPpb WpaiIriYd1QTOlNfGz
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Jun 10, 2022 at 09:29:44AM +0200, Jan Beulich wrote:
> On 10.06.2022 09:20, Roger Pau Monné wrote:
> > 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.
> 
> Did you read this before ...
> 
> >> 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).
> 
> ... saying so? IOW I'm not entirely opposed, but I'm a little afraid we might
> be setting us up for later trouble. 

Sorry, started replying yesterday but had to leave and left the reply
open.  Then when I came back this morning I just read the code and not
the commit message.

Hm, so ideally we would also then move dpci_pirq() to hvm.c in order
to match the move of pirq_dpci(), but that's not possible due to that
helper having other callers outside of hvm.c.

We could always export the function from hvm.c if we gained outside
callers.  In any case, I don't want to block you further on this, so:

Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks, Roger.



 


Rackspace

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