linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Rob Clark <robdclark@chromium.org>
Cc: Sean Paul <sean@poorly.run>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	David Airlie <airlied@linux.ie>, Rob Clark <robdclark@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Daniel Vetter <daniel@ffwll.ch>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Will Deacon <will@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Allison Randal <allison@lohutok.net>
Subject: Re: [PATCH 1/2] drm: add cache support for arm64
Date: Thu, 8 Aug 2019 12:00:31 +0200	[thread overview]
Message-ID: <20190808100031.GA32658@lst.de> (raw)
In-Reply-To: <CAJs_Fx7tqbr_gqRdqJEwOcRFReP0DqZzOu11Dxhxkp8+PygUQw@mail.gmail.com>

On Wed, Aug 07, 2019 at 09:09:53AM -0700, Rob Clark wrote:
> > > (Eventually I'd like to support pages passed in from userspace.. but
> > > that is down the road.)
> >
> > Eww.  Please talk to the iommu list before starting on that.
> 
> This is more of a long term goal, we can't do it until we have
> per-context/process pagetables, ofc.
> 
> Getting a bit off topic, but I'm curious about what problems you are
> concerned about.  Userspace can shoot it's own foot, but if it is not
> sharing GPU pagetables with other processes, it can't shoot other's
> feet.  (I'm guessing you are concerned about non-page-aligned
> mappings?)

Maybe I misunderstood what you mean above, I though you mean messing
with page cachability attributes for userspace pages.  If what you are
looking into is just "standard" SVM I only hope that our APIs for that
which currently are a mess are in shape by then, as all users currently
have their own crufty and at least slightly buggy versions of that.  But
at least it is an issue that is being worked on.

> > So back to the question, I'd like to understand your use case (and
> > maybe hear from the other drm folks if that is common):
> >
> >  - you allocate pages from shmem (why shmem, btw?  if this is done by
> >    other drm drivers how do they guarantee addressability without an
> >    iommu?)
> 
> shmem for swappable pages.  I don't unpin and let things get swapped
> out yet, but I'm told it starts to become important when you have 50
> browser tabs open ;-)

Yes,  but at that point the swapping can use the kernel linear mapping
and we are going into aliasing problems that can disturb the cache.  So
as-is this is going to problematic without new hooks into shmemfs.

> >  - then the memory is either mapped to userspace or vmapped (or even
> >    both, althrough the lack of aliasing you mentioned would speak
> >    against it) as writecombine (aka arm v6+ normal uncached).  Does
> >    the mapping live on until the memory is freed?
> 
> (side note, *most* of the drm/msm supported devices are armv8, the
> exceptions are 8060 and 8064 which are armv7.. I don't think drm/msm
> will ever have to deal w/ armv6)

Well, the point was that starting from v6 the kernels dma uncached
really is write combine.  So that applied to v7 and v8 as well.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-08 10:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 21:14 [PATCH 1/2] drm: add cache support for arm64 Rob Clark
2019-08-06  8:48 ` Christoph Hellwig
2019-08-06  9:38   ` Daniel Vetter
2019-08-06 11:38     ` Christoph Hellwig
2019-08-06 14:11   ` Rob Clark
2019-08-06 14:34     ` Mark Rutland
2019-08-06 16:31       ` Rob Clark
2019-08-07 12:38         ` Mark Rutland
2019-08-07 16:15           ` Rob Clark
2019-08-07 16:49             ` Mark Rutland
2019-08-07 17:30               ` Rob Clark
2019-08-08  7:59                 ` Christoph Hellwig
2019-08-08 16:44                   ` Rob Clark
2019-08-09  8:18                     ` Christoph Hellwig
2019-08-08  7:58               ` Christoph Hellwig
2019-08-08 10:20                 ` Mark Rutland
2019-08-08 10:24                   ` Mark Rutland
2019-08-08 10:32                   ` Will Deacon
2019-08-08  7:53           ` Christoph Hellwig
2019-08-06 15:50     ` Christoph Hellwig
2019-08-06 16:23       ` Rob Clark
2019-08-06 16:26         ` Rob Clark
2019-08-07  6:25         ` Christoph Hellwig
2019-08-07  8:48           ` Daniel Vetter
2019-08-08  9:55             ` Christoph Hellwig
2019-08-08 11:58               ` Daniel Vetter
2019-08-09  8:14                 ` Christoph Hellwig
2019-08-07 16:09           ` Rob Clark
2019-08-08 10:00             ` Christoph Hellwig [this message]
2019-08-08 16:32               ` Rob Clark

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=20190808100031.GA32658@lst.de \
    --to=hch@lst.de \
    --cc=airlied@linux.ie \
    --cc=allison@lohutok.net \
    --cc=catalin.marinas@arm.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=robdclark@chromium.org \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.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).