Re: [PATCH 1/4] media: venus: use dma_iova_size() to check the reserved IOVA size
From: Marek Szyprowski
Date: Wed Dec 02 2026 - 11:47:50 EST
On 02.12.2026 16:38, Jason Gunthorpe wrote:
> On Wed, Dec 02, 2026 at 04:16:18PM +0100, Marek Szyprowski wrote:
>
>>>> /*
>>>> * 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..
>> If I got it right, the addresses below 600M have special meaning for the hw,
>> so it is the driver role to avoid putting generic buffers there. IMHO it is
>> not strictly a HW limitation and I'm not sure if the early mentioned
>> device-tree based approach is the right way of solving this.
> Is it a special meaning the driver setup and programmed in or a
> special meaning hard wired into the HW
Such limits are rather wired into the HW...
> And what is the special meaning anyhow?
Commit 953439251b59 ("media: venus: Fix iova allocation from restrict region")
gives very cryptic explanation:
+-----------------------------------------------------------+
| non-pixel stream addressable range (600 MB - 3.5 GB) |
| 0x25800000 - 0xe0000000 |
+-----------------------------------------------------------+
| pixel stream addressable range (0 - 3.5 GB) |
| 0x00000000 - 0xe0000000 |
+-----------------------------------------------------------+
Whatever the 'non-pixel stream' means. BTW, this also shows that the upper 0.5GB
of IOVA space is also not supported by this device. What if the buffer lands
there?
IMHO allowing the drivers to mark some IOVA space as reserved (for whatever reasons)
would let us cleanly support such weird cases (it would also cover my case of legacy
Exynos drivers, which have very limited IOVA address space; it must not start
at 0, so it was not possible to limit it via dma_mask).
> Answering those questions will be important if asking Robin to add a
> reserved allocation to dma-iommu.c
>
> Who builds HW that should work with Linux and gives special meaning to
> IOVA anyhow :( :(
Its not that uncommon in multimedia integrated peripherals world, I already saw
it a few times in other IPs.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland