[PATCH v2 1/8] drm: Add dummy page per device or GEM object

Pekka Paalanen ppaalanen at gmail.com
Mon Jun 22 14:28:18 UTC 2020


On Mon, 22 Jun 2020 16:24:38 +0200
Daniel Vetter <daniel at ffwll.ch> wrote:

> On Mon, Jun 22, 2020 at 4:22 PM Pekka Paalanen <ppaalanen at gmail.com> wrote:
> >
> > On Mon, 22 Jun 2020 11:35:01 +0200
> > Daniel Vetter <daniel at ffwll.ch> wrote:
> >  
> > > On Sun, Jun 21, 2020 at 02:03:01AM -0400, Andrey Grodzovsky wrote:  
> > > > Will be used to reroute CPU mapped BO's page faults once
> > > > device is removed.
> > > >
> > > > Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>
> > > > ---
> > > >  drivers/gpu/drm/drm_file.c  |  8 ++++++++
> > > >  drivers/gpu/drm/drm_prime.c | 10 ++++++++++
> > > >  include/drm/drm_file.h      |  2 ++
> > > >  include/drm/drm_gem.h       |  2 ++
> > > >  4 files changed, 22 insertions(+)  
> >
> > ...
> >  
> > > > diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> > > > index 0b37506..47460d1 100644
> > > > --- a/include/drm/drm_gem.h
> > > > +++ b/include/drm/drm_gem.h
> > > > @@ -310,6 +310,8 @@ struct drm_gem_object {
> > > >      *
> > > >      */
> > > >     const struct drm_gem_object_funcs *funcs;
> > > > +
> > > > +   struct page *dummy_page;
> > > >  };  
> > >
> > > I think amdgpu doesn't care, but everyone else still might care somewhat
> > > about flink. That also shares buffers, so also needs to allocate the
> > > per-bo dummy page.  
> >
> > Do you really care about making flink not explode on device
> > hot-unplug? Why not just leave flink users die in a fire?
> > It's not a regression.  
> 
> It's not about exploding, they won't. With flink you can pass a buffer
> from one address space to the other, so imo we should avoid false
> sharing. E.g. if you happen to write something $secret into a private
> buffer, but only $non-secret stuff into shared buffers. Then if you
> unplug, your well-kept $secret might suddenly be visible by lots of
> other processes you never intended to share it with.
> 
> Just feels safer to plug that hole completely.

Ah! Ok, I clearly didn't understand the consequences.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20200622/b3d63f0f/attachment-0001.sig>


More information about the amd-gfx mailing list