On Fri, Aug 24, 2018 at 12:11:23PM +0100, Robin Murphy wrote:
> On 24/08/18 07:53, Christoph Hellwig wrote:
>> When a device has a DMA offset the dma capable result will change due
>> to the difference between the physical and DMA address.  Take that into
>> account.
>
> The "phys_to_dma(..., DMA_BIT_MASK(...))" idiom always looks like a glaring 
> error at first glance, but this whole function is fairly unintuitive 
> anyway, and ultimately I think the change does work out to be correct.
>
> It might be nicer if we could reference max_zone_pfns[] for a bit more 
> clarity, but I guess that's not arch-independent.

Not just arch specific, but also local variables.  There is
arch_zone_lowest_possible_pfn in page_alloc.c, but that gets discarded
after init.  That being said this is the right direction and I'll
look into it for 4.20 or later.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to