linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] PCI/ATS: Device-tree support and other improvements
@ 2020-02-13 16:50 Jean-Philippe Brucker
  2020-02-13 16:50 ` [PATCH 01/11] dt-bindings: PCI: generic: Add ats-supported property Jean-Philippe Brucker
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: Jean-Philippe Brucker @ 2020-02-13 16:50 UTC (permalink / raw)
  To: bhelgaas, will, robh+dt, lorenzo.pieralisi, joro, baolu.lu,
	linux-doc, linux-pci, linux-arm-kernel, devicetree, linux-acpi,
	iommu
  Cc: corbet, mark.rutland, liviu.dudau, sudeep.holla, guohanjun, rjw,
	lenb, robin.murphy, dwmw2, amurray, frowand.list

Enable ATS on device-tree based systems, and factor the common ATS
enablement checks into pci_enable_ats().

ATS support in PCIe endpoints is discovered through the ATS capability,
but there is no common method for discovering whether the host bridge
supports ATS. Each vendor provides their own ACPI method:
* DMAR (Intel) reports ATS support per domain or per root port.
* IVRS (AMD) reports negative ATS support for a range of devices.
* IORT (ARM) reports ATS support for a root complex.

In my opinion it's important that we only enable ATS if the host bridge
supports it, but I don't think a finer granularity is useful. If the
host bridge ignores the Address Translation field of TLP headers, it
could in theory treat a Translation Request as a Memory Read Request,
and a Translated Request as a normal memory access, which could result
in silent memory corruption.

Patches 1-3 add a device-tree property that declares ATS support in host
controllers. We only add it to the generic host, but the property can
easily be reused by other PCI hosts. Alternatively, the host drivers can
directly set the new ats_supported property of the host bridge
introduced in patch 1.

Patch 4 uses the new ats_supported host bridge property for IORT. Patch
9 removes the old method that set a flag in each endpoint's fwspec.

Patches 5-8 put all checks required for enabling ATS in common, along
with the new host bridge check.

Jean-Philippe Brucker (11):
  dt-bindings: PCI: generic: Add ats-supported property
  PCI: Add ats_supported host bridge flag
  PCI: OF: Check whether the host bridge supports ATS
  ACPI/IORT: Check ATS capability in root complex node
  PCI/ATS: Gather checks into pci_ats_supported()
  iommu/amd: Use pci_ats_supported()
  iommu/arm-smmu-v3: Use pci_ats_supported()
  iommu/vt-d: Use pci_ats_supported()
  ACPI/IORT: Drop ATS fwspec flag
  arm64: dts: fast models: Enable PCIe ATS for Base RevC FVP
  Documentation: Generalize the "pci=noats" boot parameter

 .../admin-guide/kernel-parameters.txt         |  4 +-
 .../bindings/pci/host-generic-pci.yaml        |  6 +++
 arch/arm64/boot/dts/arm/fvp-base-revc.dts     |  1 +
 drivers/acpi/arm64/iort.c                     | 38 +++++++++++++------
 drivers/acpi/pci_root.c                       |  3 ++
 drivers/iommu/amd_iommu.c                     | 12 ++----
 drivers/iommu/arm-smmu-v3.c                   | 18 ++-------
 drivers/iommu/intel-iommu.c                   |  9 ++---
 drivers/pci/ats.c                             | 30 ++++++++++++++-
 drivers/pci/controller/pci-host-common.c      |  1 +
 drivers/pci/of.c                              |  9 +++++
 drivers/pci/probe.c                           |  7 ++++
 include/linux/acpi_iort.h                     |  8 ++++
 include/linux/iommu.h                         |  4 --
 include/linux/of_pci.h                        |  3 ++
 include/linux/pci-ats.h                       |  3 ++
 include/linux/pci.h                           |  1 +
 17 files changed, 110 insertions(+), 47 deletions(-)

-- 
2.25.0


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

end of thread, other threads:[~2020-03-06  9:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 16:50 [PATCH 00/10] PCI/ATS: Device-tree support and other improvements Jean-Philippe Brucker
2020-02-13 16:50 ` [PATCH 01/11] dt-bindings: PCI: generic: Add ats-supported property Jean-Philippe Brucker
2020-02-19 22:24   ` Rob Herring
2020-02-13 16:50 ` [PATCH 02/11] PCI: Add ats_supported host bridge flag Jean-Philippe Brucker
2020-02-15 21:10   ` Bjorn Helgaas
2020-02-17 15:40     ` Jean-Philippe Brucker
2020-02-13 16:50 ` [PATCH 03/11] PCI: OF: Check whether the host bridge supports ATS Jean-Philippe Brucker
2020-02-13 18:26   ` Rob Herring
2020-02-17 12:40     ` Jean-Philippe Brucker
2020-02-13 16:50 ` [PATCH 04/11] ACPI/IORT: Check ATS capability in root complex node Jean-Philippe Brucker
2020-03-06  9:37   ` Hanjun Guo
2020-02-13 16:50 ` [PATCH 05/11] PCI/ATS: Gather checks into pci_ats_supported() Jean-Philippe Brucker
2020-02-13 16:50 ` [PATCH 06/11] iommu/amd: Use pci_ats_supported() Jean-Philippe Brucker
2020-02-13 16:50 ` [PATCH 07/11] iommu/arm-smmu-v3: " Jean-Philippe Brucker
2020-02-13 16:50 ` [PATCH 08/11] iommu/vt-d: " Jean-Philippe Brucker
2020-02-13 16:50 ` [PATCH 09/11] ACPI/IORT: Drop ATS fwspec flag Jean-Philippe Brucker
2020-03-06  9:42   ` Hanjun Guo
2020-02-13 16:50 ` [PATCH 10/11] arm64: dts: fast models: Enable PCIe ATS for Base RevC FVP Jean-Philippe Brucker
2020-02-13 16:50 ` [PATCH 11/11] Documentation: Generalize the "pci=noats" boot parameter Jean-Philippe Brucker
2020-02-19 10:42 ` [PATCH 00/10] PCI/ATS: Device-tree support and other improvements Joerg Roedel
2020-03-06  9:32 ` Hanjun Guo

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).