From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECA5BC55ABD for ; Sun, 15 Nov 2020 11:26:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A936E216C4 for ; Sun, 15 Nov 2020 11:26:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gX6z1dqv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uDucKq0Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726974AbgKOL0Z (ORCPT ); Sun, 15 Nov 2020 06:26:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbgKOL0Y (ORCPT ); Sun, 15 Nov 2020 06:26:24 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B77A6C0613D1; Sun, 15 Nov 2020 03:26:24 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605439583; 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=saojbe8LdPKGDAiEz1jquPkUf3s7kcI/f55Y0htbe4s=; b=gX6z1dqvU6cHYqV4K37jeiKwqt9/r5FZtOrjMklEE164vtcEPLoskDnhjpLpkwXVi/mkok a0d3XbPvOVslLTwHh5GyzUkLTfx2n4KWvHpAVhPYjeH4g4YvKYP0EjeSz8THofHULnMrVa gjV8K9OelqUuMEpkTClS3sMIbflOe1yTG9xANj0CWOZL2KrvdPM0UkjA39dmqiKi7NdffM b19/rbwfkxLIcJaXvwaaVtU+ThIhr5bLyWhfZsHD/PKKOoh64RBlWJLQVlfWnBT7RsuzSF y+KdnS+0d2STzdiulCS6F9rjlC51PGr76OwksQDHNYj0DzPMurPxgPyTyy+f5Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605439583; 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=saojbe8LdPKGDAiEz1jquPkUf3s7kcI/f55Y0htbe4s=; b=uDucKq0Zw4iyNGZ4Yc4IghjkqXIuPJiROE8suqA7ipywdSIASEW260Z8Nix9NpRG3KHIS/ ECkoErT6aeUjNVBg== To: "Raj\, Ashok" , Christoph Hellwig Cc: Konrad Rzeszutek Wilk , "Tian\, Kevin" , Jason Gunthorpe , "Williams\, Dan J" , "Jiang\, Dave" , Bjorn Helgaas , "vkoul\@kernel.org" , "Dey\, Megha" , "maz\@kernel.org" , "bhelgaas\@google.com" , "alex.williamson\@redhat.com" , "Pan\, Jacob jun" , "Liu\, Yi L" , "Lu\, Baolu" , "Kumar\, Sanjay K" , "Luck\, Tony" , "kwankhede\@nvidia.com" , "eric.auger\@redhat.com" , "parav\@mellanox.com" , "rafael\@kernel.org" , "netanelg\@mellanox.com" , "shahafs\@mellanox.com" , "yan.y.zhao\@linux.intel.com" , "pbonzini\@redhat.com" , "Ortiz\, Samuel" , "Hossain\, Mona" , "dmaengine\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , "linux-pci\@vger.kernel.org" , "kvm\@vger.kernel.org" , Ashok Raj Subject: Re: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection In-Reply-To: <20201114211837.GB12197@araj-mobl1.jf.intel.com> References: <874klykc7h.fsf@nanos.tec.linutronix.de> <20201109173034.GG2620339@nvidia.com> <87pn4mi23u.fsf@nanos.tec.linutronix.de> <20201110051412.GA20147@otc-nc-03> <875z6dik1a.fsf@nanos.tec.linutronix.de> <20201110141323.GB22336@otc-nc-03> <20201112193253.GG19638@char.us.oracle.com> <877dqqmc2h.fsf@nanos.tec.linutronix.de> <20201114103430.GA9810@infradead.org> <20201114211837.GB12197@araj-mobl1.jf.intel.com> Date: Sun, 15 Nov 2020 12:26:22 +0100 Message-ID: <877dqmamjl.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 14 2020 at 13:18, Ashok Raj wrote: > On Sat, Nov 14, 2020 at 10:34:30AM +0000, Christoph Hellwig wrote: >> On Thu, Nov 12, 2020 at 11:42:46PM +0100, Thomas Gleixner wrote: >> Which is why I really think we need explicit opt-ins for "native" >> SIOV handling and for paravirtualized SIOV handling, with the kernel >> not offering support at all without either or a manual override on >> the command line. > > opt-in by device or kernel? The way we are planning to support this is: > > Device support for IMS - Can discover in device specific means > Kernel support for IMS. - Supported by IOMMU driver. And why exactly do we have to enforce IOMMU support? Please stop looking at IMS purely from the IDXD perspective. We are talking about the general concept here and not about the restricted Intel universe. > each driver can check > > if (dev_supports_ims() && iommu_supports_ims()) { > /* Then IMS is supported in the platform.*/ > } Please forget this 'each driver can check'. That's just wrong. The only thing the driver has to check is whether the device supports IMS or not. Everything else has to be handled by the underlying infrastructure. That's pretty much the same thing like PCI/MSI[X]. The driver does not have to check 'device_has_msix() && platform_supports_msix()'. Enabling MSI[X] will simply fail if it's not supported. So for IMS creating the underlying irqdomain has to fail when the platform does not support it and the driver can act upon the fail and fallback to MSI[X] or just refuse to load when IMS is required for the device to be functional. Thanks, tglx