True, but dma_alloc_coherent also allows for a NULL dev pointer, and
uses a dummy struct dev (fallback_device). So it should be callable
without any dev struct pointer.
In that case, I hit the BUG() check warning in iommu_is_span_boundary()
because boundary_size was calculated as (unsigned long) 0xffffffff + 1 = 0.
That's why we must cast to "unsigned long long".
ie) it is possible to hit this BUG() right now.
I've pinged someone at AMD to see if I can get my hands on a system (or
if to see if there is a system available locally).
As for Calgary, I'm looking into it ATM. I think I can get my hands on one.
If I find the problem on those platforms I'll ping the maintainers and
post separate patches. ATM I'm much more concerned about GART.
Tomonori-san, I think I understand where your confusion may lie. The
size argument in the iommu-helper.c code is NOT the same size in
dma_alloc_coherent() and gart_map_simple(). In iommu-helper.c the size
is the # of pages, and the in the exported function calls it is an
actual size. Is that what is confusing you?
I no longer think the above suggested change is necessary. AFAICT, the
code is doing exactly the right thing. "size-1" is correct.
P.
--