From nobody Sun Apr 28 21:09:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1635365301; cv=none; d=zohomail.com; s=zohoarc; b=Z6/sGQVIIkPo7WycI4i3WSSsQ4xcj+Sm1A6T608DePgELjkiNjUkfQ5b5bAnng5VafTfVmgB744Icuo7IRYqgoIvPer9p3WXg8WzGinZWTN8OE/Hi24vp9ijB1HausIsj/gldeisrQeKuFVyB2SG4sXJW9kmmeDcjCy+Lf2TK4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635365301; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=vHbaaonAuyfALO0VWrYY6LVZBRbvrRx71ueDZ+VUa4M=; b=dvTZdehd7Sof33pNsHDr26rJ/LxHlEDf10d6JDYfDgLgb6NwuS5h86+S0wQ41igYdK/D+b+EzBFVEkanNk1Qp59BBY723qAQz40ATLHldNBkqg18DC2m6kubF4rwaarCBXKHMucqxcegw9t7JNy+mAKlJercQ2QV2VBI/thg1xU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1635365300852684.8692747463866; Wed, 27 Oct 2021 13:08:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.217198.377090 (Exim 4.92) (envelope-from ) id 1mfpCp-0001xy-EY; Wed, 27 Oct 2021 20:07:27 +0000 Received: by outflank-mailman (output) from mailman id 217198.377090; Wed, 27 Oct 2021 20:07:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mfpCp-0001xr-B1; Wed, 27 Oct 2021 20:07:27 +0000 Received: by outflank-mailman (input) for mailman id 217198; Wed, 27 Oct 2021 20:07:25 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mfpCn-0001xl-N5 for xen-devel@lists.xenproject.org; Wed, 27 Oct 2021 20:07:25 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7fd9d3ba-3761-11ec-8484-12813bfff9fa; Wed, 27 Oct 2021 20:07:24 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7fd9d3ba-3761-11ec-8484-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1635365244; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=V33m3v63LC16O+vDvWblrhoA4NK0Cb2mmG8ztXFT6fo=; b=T2hUGOEmjyod3q4D91ozKKseDFumI7WNr+K8lFrjL6Ra9+w5RuE3up/Z YETTGZmbC/2o1LXppltrK+ba1OLRbcDp8ncKYuFe/tqE4U6qKJcB61mXm 8NcMAFmZP+AMW26aPcSrnHAMl3X2DKyyvG30lWEZ/sNM2Unid+wq9mQ7K 8=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: BbQZr1aRdwIkuFaquRS7cSViqFtnf+JMrqL/1ynUsz42973fNPxg/r+H4Pwjs8itO3LMt2kCPF /nHD07j70Ue0yXmnvdK6cipIA7y8c2q0dpzCAv1qu+1/l0rMqEdezpT5B4V50oIx7A8G54p6hm TxyCtMUMUMEpLxy3t7fHas7oHFy5lAxylikD1yFDRnUKFw2fl+fAotJfSF1uRBtNCoxvk4Qxcg s5mVzYsXRNHg7xO7yWLBOwalOIVdyh2ZgYEjuyOy65L+h/7csxLbOjRS9aGaSWFxLNYIUIMBqG pKAjOvt7dZ1wtCs+EOShxPko X-SBRS: 5.1 X-MesageID: 56878025 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:1nTlQ68AZdzE8JI8GSZ+DrUDZHmTJUtcMsCJ2f8bNWPcYEJGY0x3n 2seWTvUOPqJM2Gjet1wOY3go0wGscCDyNdlQAtl+S48E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si9AttENlFEkvU2ybuOU5NXsZ2YhGmeIdA970Ug6wrZj3dYy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPgp7 dpvs7/gWT1yI7Hnkb8/aUhcMAhhaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguwKKsXxMZxZkXZn1TzDVt4tQIzZQrWM7thdtNs1rp0QTamOP 5BEAdZpRBXqTRRtYkwcMZlgk+H4v3XOXRhRo13A8MLb5ECMlVcsgdABKuH9ZdiiVchT2EGCq Qru/nv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k+DWI+orL9Y04lQ7vn2YSXRuE/Bw8P re+sjztCWE7wr5N0tQ+uxoVJPufZq+z+8Q3WByB8bBYOCOggLBR+sOgbcKqweQYhEWndQ86U 4PScZD4aXLfD1Hsfo= X-IronPort-AV: E=Sophos;i="5.87,187,1631592000"; d="scan'208";a="56878025" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Ian Jackson Subject: [PATCH] x86/passthrough: Fix hvm_gsi_eoi() build with GCC 12 Date: Wed, 27 Oct 2021 21:07:13 +0100 Message-ID: <20211027200713.22625-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1635365302608100001 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=3Daddress] 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 ) Do so. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu CC: Ian Jackson Request for 4.16, as being very low risk. This is a build problem with a soon-to-be-released compiler, but the issue = it highlights is real and the fix is a clear improvement in code quality. The= re is no difference in the compiled binary as a result of this change. $ diff -u dis-before dis-after --- dis-before 2021-10-27 21:00:07.512530321 +0100 +++ dis-after 2021-10-27 21:00:25.996752544 +0100 @@ -1,5 +1,5 @@ -xen-syms-before: file format elf64-x86-64 +xen-syms-after: file format elf64-x86-64 Disassembly of section .text: If this does not get taken at this point, it will need backporting after the release, when GCC 12 is released. --- xen/drivers/passthrough/x86/hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/x86/hvm.c b/xen/drivers/passthrough/x8= 6/hvm.c index 351daafdc9bf..22bf84639f22 100644 --- a/xen/drivers/passthrough/x86/hvm.c +++ b/xen/drivers/passthrough/x86/hvm.c @@ -902,7 +902,7 @@ static void hvm_gsi_eoi(struct domain *d, unsigned int = gsi) struct pirq *pirq =3D pirq_info(d, gsi); =20 /* Check if GSI is actually mapped. */ - if ( !pirq_dpci(pirq) ) + if ( !pirq ) return; =20 hvm_gsi_deassert(d, gsi); --=20 2.11.0