From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
iommu@lists.linux.dev, linux-media@vger.kernel.org,
linux-arm-msm@vger.kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, Robin Murphy <robin.murphy@arm.com>,
Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Sibi Sankar <sibi.sankar@oss.qualcomm.com>,
Honglei Huang <honghuan@amd.com>,
prakash.gupta@oss.qualcomm.com,
Alex Williamson <alex@shazbot.org>,
Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH 1/4] media: venus: use dma_iova_size() to check the reserved IOVA size
Date: Fri, 27 Nov 2026 17:24:36 +0200 [thread overview]
Message-ID: <20261127152436.GA774860@unreal> (raw)
In-Reply-To: <20261127142912.GK114472@nvidia.com>
On Fri, Nov 27, 2026 at 10:29:12AM -0400, Jason Gunthorpe wrote:
> On Fri, Nov 27, 2026 at 12:58:45PM +0100, Marek Szyprowski wrote:
> > The IOVA reservation code compares dma_iova_state::__size directly with
> > the requested chunk size. __size is internal to the DMA IOVA API and may
> > carry flags in its upper bits, so use the dma_iova_size() accessor
> > instead.
>
> WTF is this even doing?
>
> Fix this by reserving the 0-600MB range, below the boundary the
> non-pixel stream cannot address, using dma_iova_try_alloc() so the
> IOMMU-DMA core never hands that range out to a real DMA mapping. This
> reserves only IOVA space, it does not allocate any physical memory.
>
> That isn't what this API is for, and it isn't how it even works! It is
> pure luck that the first call to it happens to take out the lower
> address space.
>
> We even had a long discussion about this driver and this need in
> another thread and this is the hack job you guys merged?
You should also mention that NONE of the DMA/IOMMU developers or the authors
of that API were CCed when the change was merged.
https://lore.kernel.org/all/20260818-reserve_iova_in_driver-v2-2-5005a1154408@oss.qualcomm.com/
>
> And it couldn't even use the right APIs??!
And proposed for the stable@ :(
>
> Jason
next prev parent reply other threads:[~2026-11-27 15:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20261127115858eucas1p1ac63e4ce0f221453e8666ab9723a2ae0@eucas1p1.samsung.com>
2026-11-27 11:58 ` [PATCH 0/4] iommu/dma: restore flush queue use in dma_iova_destroy() Marek Szyprowski
2026-11-27 11:58 ` [PATCH 1/4] media: venus: use dma_iova_size() to check the reserved IOVA size Marek Szyprowski
2026-11-27 12:41 ` Vikash Garodia
2026-11-27 14:29 ` Jason Gunthorpe
2026-11-27 15:24 ` Leon Romanovsky [this message]
2026-11-27 11:58 ` [PATCH 2/4] media: iris: " Marek Szyprowski
2026-11-27 12:41 ` Vikash Garodia
2026-11-27 11:58 ` [PATCH 3/4] dma-mapping: add DMA_IOVA_FLAGS mask for the dma_iova_state size flags Marek Szyprowski
2026-11-27 14:37 ` Jason Gunthorpe
2026-11-27 11:58 ` [PATCH 4/4] iommu/dma: restore flush queue use in dma_iova_destroy() Marek Szyprowski
2026-11-27 14:37 ` Jason Gunthorpe
2026-11-27 14:45 ` Marek Szyprowski
2026-11-27 15:17 ` Jason Gunthorpe
2026-11-27 16:29 ` Marek Szyprowski
2026-11-27 15:31 ` Leon Romanovsky
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=20261127152436.GA774860@unreal \
--to=leon@kernel.org \
--cc=abhinav.kumar@linux.dev \
--cc=alex@shazbot.org \
--cc=bod@kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=honghuan@amd.com \
--cc=hverkuil+cisco@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@kernel.org \
--cc=prakash.gupta@oss.qualcomm.com \
--cc=robin.murphy@arm.com \
--cc=sibi.sankar@oss.qualcomm.com \
--cc=stable@vger.kernel.org \
--cc=vikash.garodia@oss.qualcomm.com \
--cc=will@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