[PATCH] iommu: omap_iovmm: support non page-aligned buffers in iommu_vmap

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Aug 31 07:27:27 EDT 2011


Hi Ohad,

On Wednesday 31 August 2011 12:52:08 Ohad Ben-Cohen wrote:
> On Mon, Aug 29, 2011 at 10:36 PM, Ohad Ben-Cohen <ohad at wizery.com> wrote:
> > From: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > 
> > omap_iovmm requires page-aligned buffers, and that sometimes causes
> > omap3isp failures (i.e. whenever the buffer passed from userspace is not
> > page-aligned).
> > 
> > Remove this limitation by rounding the address of the first page entry
> > down, and adding the offset back to the device address.
> 
> I'm having second thoughts about this.
> 
> Obviously it works for omap3isp and its users because the buffer gets
> mapped and everyone is happy.
> 
> But I'm not sure this is a valid IOMMU interface that the kernel
> should have, because effectively we're now mapping physical memory
> which nobody asked us to, and which might contain sensitive stuff we
> don't want to give the device (e.g. a remote processor which might be
> running rogue code) access to.
> 
> Thoughts ?

That can indeed be an issue, depending on whether we consider the device as 
trusted or not. This decision can't obviously be taken by the IOMMU layer.

Do you think it would be better to move this code to the OMAP3 ISP driver ?

-- 
Regards,

Laurent Pinchart



More information about the linux-arm-kernel mailing list