[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f803659b-d98a-4472-98e4-7deebb9df45f@arm.com>
Date: Tue, 27 Aug 2024 12:57:58 +0100
From: Robin Murphy <robin.murphy@....com>
To: Christoph Hellwig <hch@....de>
Cc: Leon Romanovsky <leon@...nel.org>, Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>, Marek Szyprowski <m.szyprowski@...sung.com>,
Leon Romanovsky <leonro@...dia.com>,
Easwar Hariharan <eahariha@...ux.microsoft.com>,
linux-kernel@...r.kernel.org, iommu@...ts.linux.dev,
Jason Gunthorpe <jgg@...dia.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v4 2/2] dma: add IOMMU static calls with clear default ops
On 20/08/2024 1:22 pm, Christoph Hellwig wrote:
> On Mon, Aug 19, 2024 at 02:16:56PM +0100, Robin Murphy wrote:
>> Thanks, I've just had a quick look over what you queued on
>> dma-iommu-direct-calls, and you're welcome to stick my ack on that if you
>> like.
>
> Yes, thank you a lot for your review!
>
> While I have your attention - with these two patches we stop building
> dummy_dma_ops for most common configs. Do you think we need additional
> safeguards for this case? My idea would be to remove them and force the
> bus_dma_mask to zero where we currently set the dummy ops, but I could
> use a little reality check for that idea.
Yeah, the dummy ops were a nice idea at the time, but have been looking
increasingly anachronistic for a while - in fact I think they're
effectively broken already now, since if arm64 stops selecting DMA_OPS
via IOMMU_DMA then the set_dma_ops() in the ACPI path isn't going to be
effective anyway.
I certainly don't hate the idea of using bus_dma_limit as the next most
functionally robust way to deny DMA for now. It would probably be a bit
awkward to upheave the existing notion of 0 meaning no limit, but
setting it to 1 would have the desired effect in practice (at least with
dma-direct), plus would look nicely deliberate - for completeness we'd
probably just want an extra check or two in the right place(s) to ensure
that such a DMA-denied device still can't end up being given ops other
than dma-direct, but that seems simple enough.
Thanks,
Robin.
Powered by blists - more mailing lists