Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1781446rwb; Thu, 17 Nov 2022 01:45:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7MOe5XJWOfwVKC0vI8MtB1tKedlzaKGv2ggFLcGudvQmRZrpErtEnc2NuRi0a71kN1TrsI X-Received: by 2002:a05:6402:4a:b0:461:aa10:cb0c with SMTP id f10-20020a056402004a00b00461aa10cb0cmr1437936edu.383.1668678319447; Thu, 17 Nov 2022 01:45:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668678319; cv=none; d=google.com; s=arc-20160816; b=0Re26BeUg/vXV4jbvxPVGFzKK2XOrjyR0UTixoH60TFwWpHSez4YiYSuD9lgX0Nx2p 6brMS0bkP450KJd1Gr4Cq7QcgUjQ3xVpF0BV3QI/dRifWiM3FcSZyVV1agVFJB+uMFiG mfffueV4R/Eob8ThfwrFIf6+W8aYjuoeYZ2PVoCQKQpNTRDec7WgOE6/ewdSV7+erkuV i3MWWFg2q/WN7vnHnZQUvXiHLM4Hc7WC/ml4/i9Y+2lW2j6I8/qFGiCQaAOGoHOF4kLK QnPJ72t4KlRgrq1EdvB/Pcgozr8BdqDEtwNSuxUDSkMMCF9Ih/+TZ6WzHQ3OZAvCuCdy eTvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=u1qaKDnyy/v30VRyUA4NSH5qeXvkkd40FRaF+9lRfrQ=; b=RIGWgva10QFCFE0FQZ6SYaf/c9hqL+NI1Urk8C07yJNOX7QV00Y+EONQj21TGvx1y0 zcXoOQVqAQJtqFFgDQ/bL1Wg1/VTWgGNSdGq4LhE/laFBmrM+8FS0oVLpNQRspPTCxXY 6nE4ZjO/ygUdBii2Z3zbNbOIerBl5sF+d1j86WXuU3GdU6Wng0PnSyteiggjIPJf0FqH XPqeaTYbTgaeEtk/LeW45QF1TJjZ4sJ9srtH3CbhFY/hFupKEAWX9flM8fIBMM36xiyX 1GUbPgUILQC8qOoq3DeLDJ+n7ymMcKN3XR1C/wQu0uhiOZ7/6QAzSyLCh8h5/mFM8sjk 8J3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=h6YVokPX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=t+QHIk0r; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g27-20020a170906349b00b007ae743c61efsi137708ejb.1002.2022.11.17.01.44.57; Thu, 17 Nov 2022 01:45:19 -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=@linutronix.de header.s=2020 header.b=h6YVokPX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=t+QHIk0r; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234548AbiKQIqS (ORCPT + 92 others); Thu, 17 Nov 2022 03:46:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239673AbiKQIqB (ORCPT ); Thu, 17 Nov 2022 03:46:01 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31EC3BFE; Thu, 17 Nov 2022 00:45:55 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668674753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=u1qaKDnyy/v30VRyUA4NSH5qeXvkkd40FRaF+9lRfrQ=; b=h6YVokPX8fb70te11kTLevM9/Tboh3oKuMtJJqjfaSfvridZtz9knm1PMY7gwzFZeQ3wR0 InixWku56XJk+RjRgkJErnPN390sPFUT8m6hzoLo/iWyR0L6+MMxpg9Bct7Hy8EMwiM8tT X9ABf4vnMDaieCcGsTz77TKOfFzyspa74HP6w0GZ/zQgReOg6wgr+/NgAHX2aJ3yJCSE7J GlzcTOcM+zrDJs0vFcyyvxBI+Vz8hSwgMBn7DKy5uff7GKO4LEehKJfDsACVdDykyfbhMM zHg6Lyp15oyGx4VNVB56XLqtYmP3vZk1wzpzAkS0ltNMGOXEUiA1lnq7/sAFAg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668674753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=u1qaKDnyy/v30VRyUA4NSH5qeXvkkd40FRaF+9lRfrQ=; b=t+QHIk0r5usoqiFoP1tk+PBrdg5zeTk4fanz2TZTeBvICzwCPm2sx3NsyBFjsFhU0n1N5c xfO8A/jSVfLn6JCg== To: Jason Gunthorpe Cc: LKML , x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe , "Ahmed S. Darwish" , Reinette Chatre Subject: Re: [patch 12/33] PCI/MSI: Add support for per device MSI[X] domains In-Reply-To: References: <20221111133158.196269823@linutronix.de> <20221111135205.951710169@linutronix.de> <87tu2yo77n.ffs@tglx> Date: Thu, 17 Nov 2022 09:45:53 +0100 Message-ID: <87wn7um0ji.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 On Wed, Nov 16 2022 at 20:22, Jason Gunthorpe wrote: > On Wed, Nov 16, 2022 at 11:38:52PM +0100, Thomas Gleixner wrote: > >> >> +bool pci_setup_msi_device_domain(struct pci_dev *pdev) >> >> +{ >> >> + if (WARN_ON_ONCE(pdev->msix_enabled)) >> >> + return false; >> >> + >> >> + if (pci_match_device_domain(pdev, DOMAIN_BUS_PCI_DEVICE_MSI)) >> >> + return true; >> >> + if (pci_match_device_domain(pdev, DOMAIN_BUS_PCI_DEVICE_MSIX)) >> >> + msi_remove_device_irq_domain(&pdev->dev, MSI_DEFAULT_DOMAIN); >> >> + >> >> + return pci_create_device_domain(pdev, &pci_msi_template, 1); >> > >> > Hardwired to one 1? What about multi-msi? >> >> MSI has exactly ONE descriptor whether it's single or multi-MSI. >> >> Multi-MSI can have several interrupts hanging off the same descriptor, >> but that's not how MSI looks at it because you write ONE message and the >> hardware does the substitution of the low bits depending on which vector >> is raised. > > Okay, that is very clear, maybe this in a comment right here ? Sure.