Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

From: Christoph Hellwig
Date: Thu Dec 20 2018 - 10:37:24 EST


On Wed, Dec 19, 2018 at 02:14:52PM +0100, Gerd Hoffmann wrote:
>
> > > > +    if (!dma_map_sg(dev->dev, xen_obj->sgt->sgl, xen_obj->sgt->nents,
> > > > +            DMA_BIDIRECTIONAL)) {
> > >
> > >
> > > Are you using the DMA streaming API as a way to flush the caches?
> > Yes
> > > Does this mean that GFP_USER isn't making the buffer coherent?
> >
> > No, it didn't help. I had a question [1] if there are any other better way
> > to achieve the same, but didn't have any response yet. So, I implemented
> > it via DMA API which helped.
>
> set_pages_array_*() ?
>
> See arch/x86/include/asm/set_memory.h

That sounds even more bogus, don't go there.