devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nate Watterson <nwatters-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Jean-Philippe Brucker
	<jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>,
	linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org,
	sudeep.holla-5wv7dgnIgG8@public.gmane.org,
	rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org,
	okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	tn-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org,
	sunil.kovvuri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 0/7] Add PCI ATS support to SMMUv3
Date: Wed, 31 May 2017 11:27:57 -0400	[thread overview]
Message-ID: <2ae88519-7dbb-97ee-1ef9-8a92c31472d5@codeaurora.org> (raw)
In-Reply-To: <20170524180143.19855-1-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>

Hi Jean-Philippe,

On 5/24/2017 2:01 PM, Jean-Philippe Brucker wrote:
> PCIe devices can implement their own TLB, named Address Translation Cache
> (ATC). In order to support Address Translation Service (ATS), the
> following changes are needed in software:
> 
> * Enable ATS on endpoints when the system supports it. Both PCI root
>    complex and associated SMMU must implement the ATS protocol.
> 
> * When unmapping an IOVA, send an ATC invalidate request to the endpoint
>    in addition to the usual SMMU IOTLB invalidations.
> 
> I previously sent this as part of a lengthy RFC [1] adding SVM (ATS +
> PASID + PRI) support to SMMUv3. The next PASID/PRI version is almost
> ready, but isn't likely to get merged because it needs hardware testing,
> so I will send it later. PRI depends on ATS, but ATS should be useful on
> its own.
> 
> Without PASID and PRI, ATS is used for accelerating transactions. Instead
> of having all memory accesses go through SMMU translation, the endpoint
> can translate IOVA->PA once, store the result in its ATC, then issue
> subsequent transactions using the PA, partially bypassing the SMMU. So in
> theory it should be faster while keeping the advantages of an IOMMU,
> namely scatter-gather and access control.
> 
> The ATS patches can now be tested on some hardware, even though the lack
> of compatible PCI endpoints makes it difficult to assess what performance
> optimizations we need. That's why the ATS implementation is a bit rough at
> the moment, and we will work on optimizing things like invalidation ranges
> later.

Sinan and I have tested this series on a QDF2400 development platform
using a PCIe exerciser card as the ATS capable endpoint. We were able
to verify that ATS requests complete with a valid translated address
and that DMA transactions using the pre-translated address "bypass"
the SMMU. Testing ATC invalidations was a bit more difficult as we
could not figure out how to get the exerciser card to automatically
send the completion message. We ended up having to write a debugger
script that would monitor the CMDQ and tell the exerciser to send
the completion when a hanging CMD_SYNC following a CMD_ATC_INV was
detected. Hopefully we'll get some real ATS capable endpoints to
test with soon.

> 
> Since the RFC [1]:
> * added DT and ACPI patches,
> * added invalidate-all on domain detach,
> * removed smmu_group again,
> * removed invalidation print from the fast path,
> * disabled tagged pointers for good,
> * some style changes.
> 
> These patches are based on Linux v4.12-rc2
> 
> [1] https://www.spinics.net/lists/linux-pci/msg58650.html
> 
> Jean-Philippe Brucker (7):
>    PCI: Move ATS declarations outside of CONFIG_PCI
>    dt-bindings: PCI: Describe ATS property for root complex nodes
>    iommu/of: Check ATS capability in root complex nodes
>    ACPI/IORT: Check ATS capability in root complex nodes
>    iommu/arm-smmu-v3: Link domains and devices
>    iommu/arm-smmu-v3: Add support for PCI ATS
>    iommu/arm-smmu-v3: Disable tagged pointers
> 
>   .../devicetree/bindings/pci/pci-iommu.txt          |   8 +
>   drivers/acpi/arm64/iort.c                          |  10 +
>   drivers/iommu/arm-smmu-v3.c                        | 258 ++++++++++++++++++++-
>   drivers/iommu/of_iommu.c                           |   8 +
>   include/linux/iommu.h                              |   4 +
>   include/linux/pci.h                                |  26 +--
>   6 files changed, 293 insertions(+), 21 deletions(-)
> 

-- 
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

  parent reply	other threads:[~2017-05-31 15:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24 18:01 [PATCH 0/7] Add PCI ATS support to SMMUv3 Jean-Philippe Brucker
2017-05-24 18:01 ` [PATCH 1/7] PCI: Move ATS declarations outside of CONFIG_PCI Jean-Philippe Brucker
2017-05-24 18:01 ` [PATCH 3/7] iommu/of: Check ATS capability in root complex nodes Jean-Philippe Brucker
     [not found] ` <20170524180143.19855-1-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2017-05-24 18:01   ` [PATCH 2/7] dt-bindings: PCI: Describe ATS property for " Jean-Philippe Brucker
2017-05-30 10:01     ` Joerg Roedel
2017-05-30 10:58       ` Jean-Philippe Brucker
     [not found]         ` <035be7ba-e850-a5a9-08fa-802a04feb600-5wv7dgnIgG8@public.gmane.org>
2017-05-31 17:17           ` Rob Herring
     [not found]     ` <20170524180143.19855-3-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2017-05-31 17:23       ` Rob Herring
2017-06-01 12:28         ` Jean-Philippe Brucker
2017-06-05 17:20           ` Rob Herring
2017-06-06 11:11             ` Jean-Philippe Brucker
     [not found]               ` <65aea93f-d516-f045-f216-3f56e96bdeb6-5wv7dgnIgG8@public.gmane.org>
2017-06-20 11:38                 ` Jean-Philippe Brucker
2017-05-24 18:01   ` [PATCH 4/7] ACPI/IORT: Check ATS capability in " Jean-Philippe Brucker
2017-05-24 18:01   ` [PATCH 5/7] iommu/arm-smmu-v3: Link domains and devices Jean-Philippe Brucker
2017-05-24 18:01   ` [PATCH 6/7] iommu/arm-smmu-v3: Add support for PCI ATS Jean-Philippe Brucker
     [not found]     ` <20170524180143.19855-7-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2017-05-30 10:28       ` Joerg Roedel
2017-05-30 10:58         ` Jean-Philippe Brucker
2017-05-24 18:01   ` [PATCH 7/7] iommu/arm-smmu-v3: Disable tagged pointers Jean-Philippe Brucker
2017-05-31 15:27   ` Nate Watterson [this message]
2017-06-01 12:23     ` [PATCH 0/7] Add PCI ATS support to SMMUv3 Jean-Philippe Brucker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ae88519-7dbb-97ee-1ef9-8a92c31472d5@codeaurora.org \
    --to=nwatters-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org \
    --cc=lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sudeep.holla-5wv7dgnIgG8@public.gmane.org \
    --cc=sunil.kovvuri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=tn-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).