Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1522679ybp; Wed, 9 Oct 2019 15:47:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlHOeA8i66JAfAwTQ3Z0KI5Os/rhj6YA9Ie43oEpYszCcvEh8A9EhsjO5A1vJc76Tqv9s7 X-Received: by 2002:aa7:d045:: with SMTP id n5mr5252413edo.24.1570661231049; Wed, 09 Oct 2019 15:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570661231; cv=none; d=google.com; s=arc-20160816; b=HzDbBTYcNFLk9W/7oBNTcLYZYt9G82rUPLUNFMrI2AJQcyOJXHVW7h5S23LrCtHwyT DEUtzRVoIlx2ioIzpRz6tbOf5aYFpclSH9c74vgrpQVoQqfTrklbu1jV9l4FFZJQdw/Y zy66W/fX5pulVk7JpqkE5bUjGsSkw0BXCWkefdfEwCKP6fEqAQUHsCXncugYTzHJ+jD5 6Ukbv+6Ry/fr5l8aFOIKo/9KHsYre+PItpXAkOTVXcdhg8HRhcEy/X6UHYFlDyajO+HE lFWwqF9HvHgDSXMoM902N8VmFfvC7wv65cCTqK7SjltsTzP4lu45RMsRB0uMqjYT75tY HLrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sjbZLEAdry5pbkBtkej48sa254IzozAMCZV0bkTCNxc=; b=GJ78f17jCPyeeu4Yt46AYuSDfzV+/SaEYOAh8PCwSIRye8wLHO1u/ccSggTu8ag2SY MToIAdM2duiW4H6Xi0/59mJ5fWCUvK39g3q9jJeveY9HXOUuT4LKoGKJfVXeFB10xuCt 2xb9mRTEmq4mUBjDMWaNiqi4NII87L9MZyjcgjWDhEESvItfI5/PHNobf9NHQbkQrdUs vMAcAC0QyTL7VghFrBc9s4UjRotbAaUvLj1qpb8FWkIMgJ17MbOgAvaVGpbT4TN2mSko f6xQEICT2MzdJOdrYvTj0cQRFtREsledrqa609Uc4dEdvJhau8EQjVar1pQrthX63F7a 8NoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YAQZDCIM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c28si2180585ede.3.2019.10.09.15.46.47; Wed, 09 Oct 2019 15:47:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YAQZDCIM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732168AbfJIWqf (ORCPT + 99 others); Wed, 9 Oct 2019 18:46:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:59952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731736AbfJIWqf (ORCPT ); Wed, 9 Oct 2019 18:46:35 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7882920B7C; Wed, 9 Oct 2019 22:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570661194; bh=X4MnfuIslLW8blcOn4yQwQq8QlC4Uf+as3cLP18fUQI=; h=From:To:Cc:Subject:Date:From; b=YAQZDCIMKr0xvp1BCRV8R3czGYmhTwPYvtPlXjdmDagf29hifU2QtsQOGvEkD/Yf0 BvdjTgSXdPoCd9eUT91GNFqh8p5vmX+6Yj4S49nyuXpDoE3IdlwcozlNUgF2OJi8Id TikkS8ndWH0JWv2gbWpMTfJk6adpqFpp5mhOnFv8= From: Bjorn Helgaas To: Kuppuswamy Sathyanarayanan , David Woodhouse , Joerg Roedel Cc: Ashok Raj , Keith Busch , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Bjorn Helgaas Subject: [PATCH 0/2] iommu/vt-d: Select PCI_PRI for INTEL_IOMMU_SVM Date: Wed, 9 Oct 2019 17:45:49 -0500 Message-Id: <20191009224551.179497-1-helgaas@kernel.org> X-Mailer: git-send-email 2.23.0.581.g78d2f28ef7-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas I think intel-iommu.c depends on CONFIG_AMD_IOMMU in an undesirable way: When CONFIG_INTEL_IOMMU_SVM=y, iommu_enable_dev_iotlb() calls PRI interfaces (pci_reset_pri() and pci_enable_pri()), but those are only implemented when CONFIG_PCI_PRI is enabled. If CONFIG_PCI_PRI is not enabled, there are stubs that just return failure. The INTEL_IOMMU_SVM Kconfig does nothing with PCI_PRI, but AMD_IOMMU selects PCI_PRI. So if AMD_IOMMU is enabled, intel-iommu.c gets the full PRI interfaces. If AMD_IOMMU is not enabled, it gets the PRI stubs. This seems wrong. The first patch here makes INTEL_IOMMU_SVM select PCI_PRI so intel-iommu.c always gets the full PRI interfaces. The second patch moves pci_prg_resp_pasid_required(), which simply returns a bit from the PCI capability, from #ifdef CONFIG_PCI_PASID to #ifdef CONFIG_PCI_PRI. This is related because INTEL_IOMMU_SVM already *does* select PCI_PASID, so it previously always got pci_prg_resp_pasid_required() even though it got stubs for other PRI things. Since these are related and I have several follow-on ATS-related patches in the queue, I'd like to take these both via the PCI tree. Bjorn Helgaas (2): iommu/vt-d: Select PCI_PRI for INTEL_IOMMU_SVM PCI/ATS: Move pci_prg_resp_pasid_required() to CONFIG_PCI_PRI drivers/iommu/Kconfig | 1 + drivers/pci/ats.c | 55 +++++++++++++++++++---------------------- include/linux/pci-ats.h | 11 ++++----- 3 files changed, 31 insertions(+), 36 deletions(-) -- 2.23.0.581.g78d2f28ef7-goog