From: Jason Gunthorpe <jgg@nvidia.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: bhelgaas@google.com, iommu@lists.linux.dev,
linux-pci@vger.kernel.org, leonro@nvidia.com, hch@lst.de
Subject: Re: PCI_P2PDMA_MAP_BUS_ADDR and PCIe ATS?
Date: Tue, 18 Aug 2026 09:43:09 -0300 [thread overview]
Message-ID: <20260818124309.GA5432@nvidia.com> (raw)
In-Reply-To: <bc44b89c7996c8417a2126ada2cbe7c7bfe7568f.camel@linux.intel.com>
On Tue, Aug 18, 2026 at 11:33:07AM +0200, Thomas Hellström wrote:
> Hi!
>
> I was looking at the way pci_p2pdma_distance() returns
> PCI_P2PDMA_MAP_BUS_ADDR if devices sit beneath a local switch with ACS
> disabled or not present.
>
> The client then programs the bus address directly to perform p2p dma,
> as handed out by the dma layer.
>
> However if the device (p2pdma client) has IOMMU turned on and ATS
> enabled, the device may or may not send a translation request to the
> IOMMU. Wouldn't that fail returnint an IOMMU fault if the device is
> programmed with the bus address rather than the IOVA?
There are many goofy configurations you can setup on PCIe, something
like this would be one of them :)
Linux only (barely) works with a few mainstream ones.
> So if ATS is enabled, shouldn't the device always be handed the IOVA to
> avoid this?
No, Linux has no idea if the device will use ATS or not for a certain
request. ATS is not an all or nothing feature in PCI.
If you want this kind of configuration then set the ACS flags to
achieve it, or disable ATS in the device.
IMHO such a PCIe fabric is misconfigured. I can't see a reason why
anyone would want to have ACS flags allowing fast path and then Linux
setup to never supply an IOVA that can use it.
Jason
next prev parent reply other threads:[~2026-08-18 12:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 9:33 PCI_P2PDMA_MAP_BUS_ADDR and PCIe ATS? Thomas Hellström
2026-08-18 12:43 ` Jason Gunthorpe [this message]
2026-08-18 15:20 ` Thomas Hellström
2026-08-18 19:03 ` Jason Gunthorpe
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=20260818124309.GA5432@nvidia.com \
--to=jgg@nvidia.com \
--cc=bhelgaas@google.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=leonro@nvidia.com \
--cc=linux-pci@vger.kernel.org \
--cc=thomas.hellstrom@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.