linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Oleksandr Andrushchenko <andr2000@gmail.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, daniel.vetter@intel.com,
	jgross@suse.com, boris.ostrovsky@oracle.com,
	"Oleksandr Andrushchenko" <oleksandr_andrushchenko@epam.com>
Subject: Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent
Date: Wed, 19 Dec 2018 15:10:00 +0100	[thread overview]
Message-ID: <20181219141000.k426c7o6ncsdzrn5@sirius.home.kraxel.org> (raw)
In-Reply-To: <dd166576-6771-a03f-bdee-ef798f789aed@gmail.com>

  Hi,

> > Sure this actually helps?  It's below 4G in guest physical address
> > space, so it can be backed by pages which are actually above 4G in host
> > physical address space ...
> 
> Yes, you are right here. This is why I wrote about the IOMMU
> and other conditions. E.g. you can have a device which only
> expects 32-bit, but thanks to IOMMU it can access pages above
> 4GiB seamlessly. So, this is why I *hope* that this code *may* help
> such devices. Do you think I don't need that and have to remove?

I would try without that, and maybe add a runtime option (module
parameter) later if it turns out some hardware actually needs that.
Devices which can do 32bit DMA only become less and less common these
days.

> > > > > +    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
> Well, x86... I am on arm which doesn't define that...

Oh, arm.  Maybe ask on a arm list then.  I know on arm you have to care
about caching a lot more, but that also is where my knowledge ends ...

Using dma_map_sg for cache flushing looks like a sledge hammer approach
to me.  But maybe it is needed to make xen flush the caches (xen guests
have their own dma mapping implementation, right?  Or is this different
on arm than on x86?).

cheers,
  Gerd


  reply	other threads:[~2018-12-19 14:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 10:32 [PATCH] drm/xen-front: Make shmem backed display buffer coherent Oleksandr Andrushchenko
2018-12-13 10:17 ` Oleksandr Andrushchenko
2018-12-13 15:48   ` Daniel Vetter
2018-12-14  7:09     ` Oleksandr Andrushchenko
2018-12-14  8:35       ` Daniel Vetter
2018-12-17  8:03         ` Oleksandr Andrushchenko
2018-12-18 19:20 ` Noralf Trønnes
2018-12-19  8:18   ` Oleksandr Andrushchenko
2018-12-19 13:14     ` Gerd Hoffmann
2018-12-19 13:21       ` Oleksandr Andrushchenko
2018-12-19 14:10         ` Gerd Hoffmann [this message]
2018-12-20 11:19           ` Oleksandr Andrushchenko
2018-12-20 15:37       ` Christoph Hellwig
2018-12-19 16:14     ` Noralf Trønnes
2018-12-20 11:24       ` Oleksandr Andrushchenko
2018-12-20 15:36   ` Christoph Hellwig
2018-12-20 15:49     ` Oleksandr Andrushchenko
2018-12-20 17:39       ` Christoph Hellwig
2018-12-20 18:29         ` Daniel Vetter
2018-12-20 18:33           ` Christoph Hellwig
2018-12-20 18:35             ` Daniel Vetter
2018-12-20 18:38               ` Christoph Hellwig
2018-12-21  9:16                 ` Oleksandr Andrushchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181219141000.k426c7o6ncsdzrn5@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=andr2000@gmail.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).