Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2034125rwb; Thu, 17 Nov 2022 05:48:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Jo4ccVV/A3MxoeokEANG7sBx2udWAUnOoUZ0c9doW6ltVhFQdGr0Gk1PQ2h06Vjjn+G+u X-Received: by 2002:aa7:c6c8:0:b0:461:be33:ad25 with SMTP id b8-20020aa7c6c8000000b00461be33ad25mr2248082eds.138.1668692916946; Thu, 17 Nov 2022 05:48:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668692916; cv=none; d=google.com; s=arc-20160816; b=p+wLjJg55FU8AiN0IZiUijQv2fxbjdTOvw7EM0LSLXdSQ7n200hQcw5h/Midw0jNo2 Szx/EGwJ+y1hFyKxJ29tUKxEBwEtiCOq2QlSQyWSruMi895sOWm+vhpX0Da7ATi7eRE3 HqNSB7H3WX15fZOppSH6iusdy2OAfHSTLI02ye9rD4jHtvImvRO4mUymd9ljPvvCyONm fEuNHoNgbRvsAFKgiF0EV4dgRSQuekzyxpzCet0Atp4zaEtD8IF8kFM2J4xvolnsrDAg LUFuRCEQ+/pg9xjlooe6Y7opMuxD5aRIlYD9FAW5QNYSrG/m7WoCrPCSI4uEct0F5Hzm YpYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=nEhR7pMCw3FhT/lMNgCiEBfKk2fj+LcGrS37oNxSJro=; b=kGA7csU2rJUZpbRI0VXYbeZsrdbI0+vzaL1NZPFj7LoYZ8udUzUukyVMh8XDot7llt PNDGD/b/+R+XKCrPtaGcCxoFs97F69H8JLnnnhYCHxoXqzz3fy3XN+BIxi56Pl2vdatF SgVniBcflS4rs7IcCUQh/btaUSCh7r9o8T+FCKvTdOG+qCrTF89+/6W/X56nvrmv1eXF Bnuowen5ew0XA3VcftQLbLQlYQ0drpESiM7CwPRQs8yOgzL1WSJSVZ68T6PdEc9EP6Td ameI7XgqvccNTLl+WL9k5v5Y6ruR7kLtt3EBWfn3GOvXfxdohI4yyouWCSQ3mHevW7vQ NTFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b=tYiS7Q2K; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=XWumqYaE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp11-20020a1709073e0b00b0079744630e4asi597728ejc.780.2022.11.17.05.48.14; Thu, 17 Nov 2022 05:48:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b=tYiS7Q2K; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=XWumqYaE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239809AbiKQNNY (ORCPT + 92 others); Thu, 17 Nov 2022 08:13:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239700AbiKQNNT (ORCPT ); Thu, 17 Nov 2022 08:13:19 -0500 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5A7F6D495 for ; Thu, 17 Nov 2022 05:13:17 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id ACC613200B37; Thu, 17 Nov 2022 08:13:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 17 Nov 2022 08:13:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1668690792; x= 1668777192; bh=nEhR7pMCw3FhT/lMNgCiEBfKk2fj+LcGrS37oNxSJro=; b=t YiS7Q2KpFt+zCX59+TZBrjYf3nUm7hq3hXo+1j8FQ3xm6WoiMN9V5Dfag6tBG9hn UoF3q4WD1QIUOZgkKYQB82uYsUKm037Sie+6sg8Lsv39PBoSZxAKvlc8A2O7j0ft gIfmdu+SQvPDO57ZMVcBDQY9UaV0m+iGPHFb7tEFC7ohunegdyD07fncHQlzMlEl O8SNj+va7/zco4xudc4RNh1lB2H1jLABhjSDs2Peo0XTwehLaC/Ngm2oKVhHftrQ Z7gds+bUnWfD0Kaq9VhgV51hz3Flg6zMUoHnFUDnQlgbI85DU/3/Z0srylLXVjPm xqiKIHan8hS4dvGmOuzCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1668690792; x=1668777192; bh=nEhR7pMCw3FhT/lMNgCiEBfKk2fj +LcGrS37oNxSJro=; b=XWumqYaEWqMNBnVsg/ykzRMnmY/VHi7Ba6GO8ga97YO9 6oIJn3AKEiB5l/hoiCUjLqbMus7TQE2TePOAoIJgPrD6D7hkbHeLnWq54hSJXqhx 7O54uKBSwJCJABBAWQGkFDwBGozq5C0RHt5oRq9iIIUQ0InWVLP6FbYKgvEWoRc2 uluFz+l4vAFpNURNtQjDlQf8u40cjJo2DEHnWSDj0yUwjat3rgReHGYhf04itPMK MkCDwczeWfw03FCDhyF+IxUaCGIenmbKTjNjGU388uWPd6G2aDCeULaDPhpUmILT bo02ylNhpgjGHu9d5odBcU59EhoO5ADQ1TB6AkerTA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeekgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefgudel teefvefhfeehieetleeihfejhfeludevteetkeevtedtvdegueetfeejudenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Nov 2022 08:13:10 -0500 (EST) Date: Thu, 17 Nov 2022 14:13:04 +0100 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: David Vrabel Cc: linux-kernel@vger.kernel.org, Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Jan Beulich , "moderated list:XEN HYPERVISOR INTERFACE" Subject: Re: [PATCH] xen-pciback: Consider MSI-X enabled only when MASKALL bit is cleared Message-ID: References: <20221117114122.1588338-1-marmarek@invisiblethingslab.com> <0afe3f35-1b25-d1c6-89bb-8dae7a4070e9@cantab.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QOL0n3NG2/pM9Yw2" Content-Disposition: inline In-Reply-To: <0afe3f35-1b25-d1c6-89bb-8dae7a4070e9@cantab.net> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --QOL0n3NG2/pM9Yw2 Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Thu, 17 Nov 2022 14:13:04 +0100 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: David Vrabel Cc: linux-kernel@vger.kernel.org, Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Jan Beulich , "moderated list:XEN HYPERVISOR INTERFACE" Subject: Re: [PATCH] xen-pciback: Consider MSI-X enabled only when MASKALL bit is cleared On Thu, Nov 17, 2022 at 12:54:51PM +0000, David Vrabel wrote: > On 17/11/2022 11:41, Marek Marczykowski-G=C3=B3recki wrote: > > Linux enables MSI-X before disabling INTx, but keeps MSI-X masked until > > the table is filled. Then it disables INTx just before clearing MASKALL > > bit. Currently this approach is rejected by xen-pciback. > > Allow setting PCI_MSIX_FLAGS_ENABLE while INTx is still enabled as long > > as PCI_MSIX_FLAGS_MASKALL is set too. >=20 > The use of MSI-X interrupts is conditional on only the MSI-X Enable bit. > Setting MSI-X Enable effectively overrides the Interrupt Disable bit in t= he > Command register. That means the second chunk of the patch may even drop the '(new_value & PCI_MSIX_FLAGS_MASKALL)' part, right?=20 > PCIe 6.0.1 section 7.7.2.2. "MSI-X Enable ... is prohibited from using IN= Tx > interrupts (if implemented)." And there is similar wording for MSI Enable. And this would mean the 'field_config->int_type =3D=3D INTERRUPT_TYPE_MSIX' part isn't necessary either. Jan in another thread pointed out that disabling INTx explicitly is still a useful workaround for a flawed hardware. But if that isn't mandated by the spec, maybe it doesn't need to be enforced by pciback either? > I think you need to shuffle the checks for MSI/MSI-X in > xen_pcibk_get_interrupt_type() so they are _before_ the check of the > Interrupt Disable bit in the Command register. Note the xen_pcibk_get_interrupt_type() returns a bitmask of enabled types. It seems it should consider INTx only if both MSI and MSI-X are disabled. I'll make the adjustment. But this alone, won't cover enabling part, as INTx is the only one active at the time. --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --QOL0n3NG2/pM9Yw2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmN2M2MACgkQ24/THMrX 1yy7Xgf/VXm1tljAkL14zb63jld+ZWk8SJp3bJmR29my72LkJSDRptt56K2JKUo7 Morpduk3y63d4eOWbR1QQ+Ms3fXXn6anDTweGWq3wChZZu1v4ZwWcUD1tZNBpIk2 b1dDJOIJyYBYaVN084X874y6Lt1sh8OKzbwzCB0smNtsTNSxFMUKEwTqAOLpYOxg 2QYhy3zzvrDEQPgMzCSMJV5kcJSXl8+Tkpt2RYVBu6y9VuatGYnlOSI66p/bH4t7 0i/QrAUZc7FgYWkH8gzr3M6kcOzRfHy44Ye1IS78/7Z387M3qwyLnLnS8dcuMxuX mTpZ640102hfSbQzQAT9HMY8E7PN7Q== =2Ltr -----END PGP SIGNATURE----- --QOL0n3NG2/pM9Yw2--