dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* iommu/smmu/PCI ATS + TTM unmaps + nouveau best way forward
@ 2026-06-30  9:39 Dave Airlie
  2026-06-30 11:24 ` Christian König
  2026-06-30 11:39 ` Jason Gunthorpe
  0 siblings, 2 replies; 12+ messages in thread
From: Dave Airlie @ 2026-06-30  9:39 UTC (permalink / raw)
  To: dri-devel, iommu
  Cc: Jason Gunthorpe, Alistair Popple, Matthew Brost,
	Koenig, Christian

I've been bringing up nouveau on NVIDIA Spark GB10 and fallen down a
hole of why is the GPU writing to pages I've released back to the CPU
page allocator. I've wasted a lot of time on GPU L2 cache and explicit
handling for it, which might be needed but hasn't solved my problem.
I've also invalidated and flushed the GPU TLB excessively.

Today I finally hit up iommu.strict=1 makes things a lot happier,
non-strict IOMMU seems to allow a race between dma_unmap_page and
free_page where the unmap goes into the IOMMU flush queue, where the
actual unmap are delayed until something triggers a flush later, and
the ATS translations stay alive past when they should, and after the
page has been allocated by some subsequent user.

The options I seem to have: (but I'm probably very wrong)
1. force my own iommu domain and use iommu_map/unmap explicitly in the
driver which avoids the flush queue?
2. split ttm page unmap/free into two stages, and force an iommu
flush/ATS sync operation after the unmap before the free. (I don't
think iommu has an interface for this).
3. force untrusted on the PCI device?

I just want to see if anyone else has hit this problem before in this
space and I'm missing something, just feel solving this in the driver
is a workaround for ttm/dma API impedance mismatch.

Thanks,
Dave.

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

end of thread, other threads:[~2026-07-01 23:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30  9:39 iommu/smmu/PCI ATS + TTM unmaps + nouveau best way forward Dave Airlie
2026-06-30 11:24 ` Christian König
2026-06-30 11:51   ` Jason Gunthorpe
2026-06-30 20:45     ` Dave Airlie
2026-06-30 21:00       ` Dave Airlie
2026-07-01  0:17         ` Jason Gunthorpe
2026-07-01  1:22           ` Alistair Popple
2026-06-30 23:59       ` Jason Gunthorpe
2026-06-30 11:39 ` Jason Gunthorpe
2026-06-30 23:21   ` Matthew Brost
2026-07-01  1:30     ` Alistair Popple
2026-07-01 23:34       ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox