From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: bhelgaas@google.com, bhelgaas@google.com
Cc: iommu@lists.linux.dev, linux-pci@vger.kernel.org,
leonro@nvidia.com, jgg@nvidia.com, hch@lst.de
Subject: PCI_P2PDMA_MAP_BUS_ADDR and PCIe ATS?
Date: Tue, 18 Aug 2026 11:33:07 +0200 [thread overview]
Message-ID: <bc44b89c7996c8417a2126ada2cbe7c7bfe7568f.camel@linux.intel.com> (raw)
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?
So if ATS is enabled, shouldn't the device always be handed the IOVA to
avoid this? Granted, untranslated transactions will then take the
round-trip to the host bridge, but pre-translated transactions will
still benefit from the direct routing through the switch, although that
is not directly visible to the kernel p2pdma layer?
Does pci_p2pdma_distance() need to be client ATS-enabled aware?
Any input appreciated,
Thanks,
Thomas
next reply other threads:[~2026-08-18 9:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 9:33 Thomas Hellström [this message]
2026-08-18 12:43 ` PCI_P2PDMA_MAP_BUS_ADDR and PCIe ATS? Jason Gunthorpe
2026-08-18 15:20 ` Thomas Hellström
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=bc44b89c7996c8417a2126ada2cbe7c7bfe7568f.camel@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-pci@vger.kernel.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