Re: [PATCH 1/4] media: venus: use dma_iova_size() to check the reserved IOVA size
From: Jason Gunthorpe
Date: Mon Nov 30 2026 - 14:55:29 EST
On Mon, Nov 30, 2026 at 01:10:03AM +0000, Bryan O'Donoghue wrote:
> The other direction is to have venus and iris register their own IOMMU
> domain and then the address allocator they will provide places the floor at
> 600MB for the SID.
>
> Jason, do you think this is the right approach ?
There is yet another thread about this too, and you shouldn't this
because you loose the DMA API and all the cache flushing it gives.
I suggested that people who want this should follow the old design of
PASID to get a dummy struct device just for the DMA API to use with
its own private iommu domain.
However, that still leaves us with the issue here that the DMA API is
not aware of the weird HW limitation.
> drivers/media/platform/nvidia/tegra-vde/
>
> vde->domain = iommu_paging_domain_alloc(dev);
> if (IS_ERR(vde->domain)) {
> err = PTR_ERR(vde->domain);
> vde->domain = NULL;
> goto put_group;
> }
>
> err = iova_cache_get();
> if (err)
> goto free_domain;
>
> order = __ffs(vde->domain->pgsize_bitmap);
> init_iova_domain(&vde->iova, 1UL << order, 0);
>
> err = iommu_attach_group(vde->domain, vde->group);
> if (err)
> goto put_iova;
>
> /*
> * We're using some static addresses that are not accessible by VDE
> * to trap invalid memory accesses.
> */
> shift = iova_shift(&vde->iova);
> iova = reserve_iova(&vde->iova, 0x60000000 >> shift,
> 0x70000000 >> shift);
Is this HW or software that is motivating this carve out? I was never
clear on that..
Jason