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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 4DA8DC433E1 for ; Thu, 28 May 2020 16:33:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3854920721 for ; Thu, 28 May 2020 16:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405046AbgE1QdR (ORCPT ); Thu, 28 May 2020 12:33:17 -0400 Received: from mga17.intel.com ([192.55.52.151]:28295 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404897AbgE1QdP (ORCPT ); Thu, 28 May 2020 12:33:15 -0400 IronPort-SDR: S1iTSRFFHhDlpaoa/fMjeg9/MogrLf9V8h52IQvop+1K7KlZOmrsR2xBFk4vErB91dtBmWXAUa cEeQ+ECUeUOA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2020 09:33:15 -0700 IronPort-SDR: g+sBksrbZ/XPPBDhZNXgLL2wNxU+emyH9f97Pnz6m4VoyQfhHez3cx0vTlXK0xPEnkI0Os675G e4jdi87hHCwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,445,1583222400"; d="scan'208";a="310974192" Received: from ssp-nc-cdi361.jf.intel.com (HELO otc-nc-03) ([10.54.39.25]) by FMSMGA003.fm.intel.com with ESMTP; 28 May 2020 09:33:15 -0700 Date: Thu, 28 May 2020 09:33:15 -0700 From: "Raj, Ashok" To: Alex Williamson Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Joerg Roedel , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Lu Baolu , Darrel Goeddel , Mark Scott , Romil Sharma , Ashok Raj Subject: Re: [PATCH] iommu: Relax ACS requirement for Intel RCiEP devices. Message-ID: <20200528163315.GA6461@otc-nc-03> References: <1590531455-19757-1-git-send-email-ashok.raj@intel.com> <20200526170715.18c0ee98@x1.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200526170715.18c0ee98@x1.home> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex On Tue, May 26, 2020 at 05:07:15PM -0600, Alex Williamson wrote: > > --- > > drivers/iommu/iommu.c | 13 ++++++++++++- > > 1 file changed, 12 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > > index 2b471419e26c..31b595dfedde 100644 > > --- a/drivers/iommu/iommu.c > > +++ b/drivers/iommu/iommu.c > > @@ -1187,7 +1187,18 @@ static struct iommu_group *get_pci_function_alias_group(struct pci_dev *pdev, > > struct pci_dev *tmp = NULL; > > struct iommu_group *group; > > > > - if (!pdev->multifunction || pci_acs_enabled(pdev, REQ_ACS_FLAGS)) > > + /* > > + * Intel VT-d Specification Section 3.16, Root-Complex Peer to Peer > > + * Considerations manadate that all transactions in RCiEP's and > > + * even Integrated MFD's *must* be sent up to the IOMMU. P2P is > > + * only possible on translated addresses. This gives enough > > + * guarantee that such devices can be forgiven for lack of ACS > > + * support. > > + */ > > + if (!pdev->multifunction || > > + (pdev->vendor == PCI_VENDOR_ID_INTEL && > > + pci_pcie_type(pdev) == PCI_EXP_TYPE_RC_END) || > > + pci_acs_enabled(pdev, REQ_ACS_FLAGS)) > > return NULL; > > > > for_each_pci_dev(tmp) { > > Hi Ashok, > > As this is an Intel/VT-d standard, not a PCIe standard, why not > implement this in pci_dev_specific_acs_enabled() with all the other > quirks? Thanks, Yes, that sounds like the right place.. I have a new patch, once its tested i'll resend it. Thanks for pointing it out. Cheers, Ashok 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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 6014BC433DF for ; Thu, 28 May 2020 16:33:24 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2025B20829 for ; Thu, 28 May 2020 16:33:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2025B20829 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E2C5187DDD; Thu, 28 May 2020 16:33:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nf6b7adRokAW; Thu, 28 May 2020 16:33:23 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 6573387AC5; Thu, 28 May 2020 16:33:23 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3F7AFC088D; Thu, 28 May 2020 16:33:23 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 57C40C016F for ; Thu, 28 May 2020 16:33:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 46B4087D56 for ; Thu, 28 May 2020 16:33:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hwSf7AMV7Yrd for ; Thu, 28 May 2020 16:33:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3735787AC5 for ; Thu, 28 May 2020 16:33:20 +0000 (UTC) IronPort-SDR: laAP8v0KQM91jSGaz3K3ve+7Vj9DiXs7GWRzQDAZ8rC0Q9GKXt77BfmzTldH5bF4fnyT8oAmh0 ro7ydVRVaOsA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2020 09:33:15 -0700 IronPort-SDR: g+sBksrbZ/XPPBDhZNXgLL2wNxU+emyH9f97Pnz6m4VoyQfhHez3cx0vTlXK0xPEnkI0Os675G e4jdi87hHCwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,445,1583222400"; d="scan'208";a="310974192" Received: from ssp-nc-cdi361.jf.intel.com (HELO otc-nc-03) ([10.54.39.25]) by FMSMGA003.fm.intel.com with ESMTP; 28 May 2020 09:33:15 -0700 Date: Thu, 28 May 2020 09:33:15 -0700 From: "Raj, Ashok" To: Alex Williamson Subject: Re: [PATCH] iommu: Relax ACS requirement for Intel RCiEP devices. Message-ID: <20200528163315.GA6461@otc-nc-03> References: <1590531455-19757-1-git-send-email-ashok.raj@intel.com> <20200526170715.18c0ee98@x1.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200526170715.18c0ee98@x1.home> User-Agent: Mutt/1.5.24 (2015-08-30) Cc: Ashok Raj , Darrel Goeddel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Mark Scott , Romil Sharma , Bjorn Helgaas X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi Alex On Tue, May 26, 2020 at 05:07:15PM -0600, Alex Williamson wrote: > > --- > > drivers/iommu/iommu.c | 13 ++++++++++++- > > 1 file changed, 12 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > > index 2b471419e26c..31b595dfedde 100644 > > --- a/drivers/iommu/iommu.c > > +++ b/drivers/iommu/iommu.c > > @@ -1187,7 +1187,18 @@ static struct iommu_group *get_pci_function_alias_group(struct pci_dev *pdev, > > struct pci_dev *tmp = NULL; > > struct iommu_group *group; > > > > - if (!pdev->multifunction || pci_acs_enabled(pdev, REQ_ACS_FLAGS)) > > + /* > > + * Intel VT-d Specification Section 3.16, Root-Complex Peer to Peer > > + * Considerations manadate that all transactions in RCiEP's and > > + * even Integrated MFD's *must* be sent up to the IOMMU. P2P is > > + * only possible on translated addresses. This gives enough > > + * guarantee that such devices can be forgiven for lack of ACS > > + * support. > > + */ > > + if (!pdev->multifunction || > > + (pdev->vendor == PCI_VENDOR_ID_INTEL && > > + pci_pcie_type(pdev) == PCI_EXP_TYPE_RC_END) || > > + pci_acs_enabled(pdev, REQ_ACS_FLAGS)) > > return NULL; > > > > for_each_pci_dev(tmp) { > > Hi Ashok, > > As this is an Intel/VT-d standard, not a PCIe standard, why not > implement this in pci_dev_specific_acs_enabled() with all the other > quirks? Thanks, Yes, that sounds like the right place.. I have a new patch, once its tested i'll resend it. Thanks for pointing it out. Cheers, Ashok _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu