iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] iommu/vt-d: Enable PCI ACS for platform opt in hint
@ 2020-06-08 23:17 Lu Baolu
  2020-06-09 12:35 ` Mika Westerberg
  0 siblings, 1 reply; 2+ messages in thread
From: Lu Baolu @ 2020-06-08 23:17 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Ashok Raj, linux-kernel, Lalithambika Krishnakumar, iommu,
	Mika Westerberg

PCI ACS is disabled if Intel IOMMU is off by default or intel_iommu=off
is used in command line. Unfortunately, Intel IOMMU will be forced on if
there're devices sitting on an external facing PCI port that is marked
as untrusted (for example, thunderbolt peripherals). That means, PCI ACS
is disabled while Intel IOMMU is forced on to isolate those devices. As
the result, the devices of an MFD will be grouped by a single group even
the ACS is supported on device.

[    0.691263] pci 0000:00:07.1: Adding to iommu group 3
[    0.691277] pci 0000:00:07.2: Adding to iommu group 3
[    0.691292] pci 0000:00:07.3: Adding to iommu group 3

Fix it by requesting PCI ACS when Intel IOMMU is detected with platform
opt in hint.

Fixes: 89a6079df791a ("iommu/vt-d: Force IOMMU on for platform opt in hint")
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Co-developed-by: Lalithambika Krishnakumar <lalithambika.krishnakumar@intel.com>
Signed-off-by: Lalithambika Krishnakumar <lalithambika.krishnakumar@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/iommu/dmar.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 60a2970c37ff..9e3e9067a71d 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -898,7 +898,8 @@ int __init detect_intel_iommu(void)
 	if (!ret)
 		ret = dmar_walk_dmar_table((struct acpi_table_dmar *)dmar_tbl,
 					   &validate_drhd_cb);
-	if (!ret && !no_iommu && !iommu_detected && !dmar_disabled) {
+	if (!ret && !no_iommu && !iommu_detected &&
+	    (!dmar_disabled || dmar_platform_optin())) {
 		iommu_detected = 1;
 		/* Make sure ACS will be enabled */
 		pci_request_acs();
-- 
2.17.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] iommu/vt-d: Enable PCI ACS for platform opt in hint
  2020-06-08 23:17 [PATCH 1/1] iommu/vt-d: Enable PCI ACS for platform opt in hint Lu Baolu
@ 2020-06-09 12:35 ` Mika Westerberg
  0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2020-06-09 12:35 UTC (permalink / raw)
  To: Lu Baolu; +Cc: Ashok Raj, Lalithambika Krishnakumar, iommu, linux-kernel

On Tue, Jun 09, 2020 at 07:17:20AM +0800, Lu Baolu wrote:
> PCI ACS is disabled if Intel IOMMU is off by default or intel_iommu=off
> is used in command line. Unfortunately, Intel IOMMU will be forced on if
> there're devices sitting on an external facing PCI port that is marked
> as untrusted (for example, thunderbolt peripherals). That means, PCI ACS
> is disabled while Intel IOMMU is forced on to isolate those devices. As
> the result, the devices of an MFD will be grouped by a single group even
> the ACS is supported on device.
> 
> [    0.691263] pci 0000:00:07.1: Adding to iommu group 3
> [    0.691277] pci 0000:00:07.2: Adding to iommu group 3
> [    0.691292] pci 0000:00:07.3: Adding to iommu group 3
> 
> Fix it by requesting PCI ACS when Intel IOMMU is detected with platform
> opt in hint.
> 
> Fixes: 89a6079df791a ("iommu/vt-d: Force IOMMU on for platform opt in hint")
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-09 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 23:17 [PATCH 1/1] iommu/vt-d: Enable PCI ACS for platform opt in hint Lu Baolu
2020-06-09 12:35 ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).