Re: [GIT PULL] dma-mapping fix for Linux 5.14

From: Christoph Hellwig
Date: Sun Jul 25 2021 - 13:37:11 EST


On Sun, Jul 25, 2021 at 09:50:29AM -0700, Linus Torvalds wrote:
> On Sat, Jul 24, 2021 at 11:03 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> >
> > dma-mapping fix for Lonux 5.14
>
> We're calling it "Lonux" now?

Only on weekends :)

> > - handle vmalloc addresses in dma_common_{mmap,get_sgtable}
> > (Roman Skakun)
>
> I've pulled this, but my reaction is that we've tried to avoid this in
> the past. Why is Xen using vmalloc'ed addresses and passing those in
> to the dma mapping routines?
>
> It *smells* to me like a Xen-swiotlb bug, and it would have been
> better to try to fix it there. Was that just too painful?

vmalloc (or rather vmap) addresses actually are the most common
way to provide uncachable mappings on architectures that are not
cache coherent. The only Xen part here is that swiotlb-xen is a mess
and gets the address from the dma-direct allocator which does vmapping
for arm/arm64, but then uses the common helpers later due to a variety
of issues that will take a while to address.