dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 00/16] DRM VMA Access Management
Date: Tue, 13 Aug 2013 21:38:21 +0200	[thread overview]
Message-ID: <1376422717-12229-1-git-send-email-dh.herrmann@gmail.com> (raw)

Hi

This is the second part of the unified VMA manager. It implements proper access
management so applications can map only buffers that they own handles for.

Patches of interest probably are:
 #1: Implement VMA access management helpers
 #9: Make TTM deny unprivileged mmap() calls
 #10: Do the same for GEM
The remaining patches just hook it up in all drivers.

The implementation is pretty easy. On gem_open_object() drivers add the "struct
file*" pointer to the list of allowed open-files of a bo. On gem_close_object()
drivers remove it again. For TTM, drivers do this manually as there is no access
to TTM bo's from generic GEM code. For GEM, drivers can set DRIVER_GEM_MMAP
(copied from airlied's proposal) and GEM core will take care of this.

If we want this to be more uniform, I can add gem_open_object() and
gem_close_object() callbacks to all the GEM drivers and call
drm_vma_node_allow() and drm_vma_node_revoke() respectively. Just let me know
what you think is cleaner.

Cheers
David

David Herrmann (16):
  drm/vma: add access management helpers
  drm/ast: implement mmap access managament
  drm/cirrus: implement mmap access managament
  drm/mgag200: implement mmap access managament
  drm/nouveau: implement mmap access managament
  drm/radeon: implement mmap access managament
  drm/qxl: implement mmap access managament
  drm/vmwgfx: implement mmap access managament
  drm/ttm: prevent mmap access to unauthorized users
  drm/gem: implement mmap access management
  drm/i915: enable GEM mmap access management
  drm/exynos: enable GEM mmap access management
  drm/gma500: enable GEM mmap access management
  drm/omap: enable GEM mmap access management
  drm/udl: enable GEM mmap access management
  drm/host1x: enable GEM mmap access management

 Documentation/DocBook/drm.tmpl           |  13 +++
 drivers/gpu/drm/ast/ast_drv.c            |   2 +
 drivers/gpu/drm/ast/ast_drv.h            |   4 +
 drivers/gpu/drm/ast/ast_main.c           |  15 +++
 drivers/gpu/drm/cirrus/cirrus_drv.h      |   4 +
 drivers/gpu/drm/cirrus/cirrus_main.c     |  15 +++
 drivers/gpu/drm/drm_gem.c                |  37 +++++++-
 drivers/gpu/drm/drm_vma_manager.c        | 155 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/exynos/exynos_drm_drv.c  |   3 +-
 drivers/gpu/drm/gma500/psb_drv.c         |   3 +-
 drivers/gpu/drm/i915/i915_drv.c          |   3 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c    |   2 +
 drivers/gpu/drm/mgag200/mgag200_drv.h    |   4 +
 drivers/gpu/drm/mgag200/mgag200_main.c   |  15 +++
 drivers/gpu/drm/nouveau/nouveau_gem.c    |  19 +++-
 drivers/gpu/drm/omapdrm/omap_drv.c       |   3 +-
 drivers/gpu/drm/qxl/qxl_gem.c            |   7 +-
 drivers/gpu/drm/radeon/radeon_gem.c      |   7 ++
 drivers/gpu/drm/ttm/ttm_bo_vm.c          |   9 +-
 drivers/gpu/drm/udl/udl_drv.c            |   3 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c |  29 +++---
 drivers/gpu/host1x/drm/drm.c             |   2 +-
 include/drm/drmP.h                       |   1 +
 include/drm/drm_vma_manager.h            |  21 ++++-
 24 files changed, 342 insertions(+), 34 deletions(-)

-- 
1.8.3.4

             reply	other threads:[~2013-08-13 19:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 19:38 David Herrmann [this message]
2013-08-13 19:38 ` [PATCH 01/16] drm/vma: add access management helpers David Herrmann
2013-08-13 19:38 ` [PATCH 02/16] drm/ast: implement mmap access managament David Herrmann
2013-08-13 19:38 ` [PATCH 03/16] drm/cirrus: " David Herrmann
2013-08-13 19:38 ` [PATCH 04/16] drm/mgag200: " David Herrmann
2013-08-13 19:38 ` [PATCH 05/16] drm/nouveau: " David Herrmann
2013-08-13 19:38 ` [PATCH 06/16] drm/radeon: " David Herrmann
2013-08-13 19:38 ` [PATCH 07/16] drm/qxl: " David Herrmann
2013-08-13 19:38 ` [PATCH 08/16] drm/vmwgfx: " David Herrmann
2013-08-13 21:44   ` David Herrmann
2013-08-14 17:35     ` Thomas Hellstrom
2013-08-16 13:19       ` David Herrmann
2013-08-16 15:33         ` Thomas Hellstrom
2013-08-16 17:01           ` David Herrmann
2013-08-16 17:27             ` Thomas Hellstrom
2013-08-13 19:38 ` [PATCH 09/16] drm/ttm: prevent mmap access to unauthorized users David Herrmann
2013-08-13 19:38 ` [PATCH 10/16] drm/gem: implement mmap access management David Herrmann
2013-08-13 21:05   ` Daniel Vetter
2013-08-23 11:14     ` David Herrmann
2013-08-13 19:38 ` [PATCH 11/16] drm/i915: enable GEM " David Herrmann
2013-08-13 19:38 ` [PATCH 12/16] drm/exynos: " David Herrmann
2013-08-13 19:38 ` [PATCH 13/16] drm/gma500: " David Herrmann
2013-08-13 19:38 ` [PATCH 14/16] drm/omap: " David Herrmann
2013-08-13 19:46   ` Rob Clark
2013-08-13 19:38 ` [PATCH 15/16] drm/udl: " David Herrmann
2013-08-13 19:38 ` [PATCH 16/16] drm/host1x: " David Herrmann

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=1376422717-12229-1-git-send-email-dh.herrmann@gmail.com \
    --to=dh.herrmann@gmail.com \
    --cc=dri-devel@lists.freedesktop.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