[PATCH 8/8] iommu: Improve map/unmap sanity checks

Jason Gunthorpe jgg at nvidia.com
Fri Sep 22 10:28:31 PDT 2023


On Tue, Sep 19, 2023 at 01:18:31PM +0100, Robin Murphy wrote:

> > This is not a theoretical question - does any in-kernel code actually
> > do that and expect it to work? I didn't notice any..
> 
> I was hoping to have to say I'd only seen it in unmerged (e.g. [1]) and
> downstream code, but then I found drivers/net/ipa/ :(

Aiiie, what is that doing? Mapping something into the dma-api owned
domain!?!

See this is why I think stronger invarients are a good idea, we can't
police the entire kernel but we can make the entry points explode if
someone is doing something WRONG.

> All that said, I don't mind if you want to propose a separate patch to turn
> certain external caller conditions into noisy warnings, but I wouldn't want
> to tie it up with any other changes which would risk getting caught in the
> crossfire if someone does then hit a newly-introduced warning and start
> arguing to revert it. And I'm not going to do so in any of my patches since
> as above I don't personally believe it's a valuable thing to do.

Ok, that make sense

Jason



More information about the linux-arm-kernel mailing list