* [PATCH] drm: Limite blob creation to drm master
@ 2018-07-02 8:12 Daniel Vetter
2018-07-02 10:24 ` Ville Syrjälä
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2018-07-02 8:12 UTC (permalink / raw)
To: DRI Development
Cc: Daniel Stone, Daniel Vetter, Michel Dänzer, Daniel Vetter,
Intel Graphics Development
This interface allows pretty much unlimited kernel memory allocations,
which isn't all that great. But we allow that anyway for any drm
master client (through pinning display buffers and stuff, at least for
UMA gpus), so just limiting it to the active master seems like a
reasonable stopgap measure.
Fixes: e2f5d2ea479b ("drm/mode: Add user blob-creation ioctl")
Cc: Daniel Stone <daniels@collabora.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
drivers/gpu/drm/drm_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index c148eb3be8c2..dc740c381f9e 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -656,8 +656,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_SETPROPERTY, drm_mode_obj_set_property_ioctl, DRM_MASTER|DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR2, drm_mode_cursor2_ioctl, DRM_MASTER|DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_ATOMIC, drm_mode_atomic_ioctl, DRM_MASTER|DRM_UNLOCKED),
- DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATEPROPBLOB, drm_mode_createblob_ioctl, DRM_UNLOCKED),
- DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROYPROPBLOB, drm_mode_destroyblob_ioctl, DRM_UNLOCKED),
+ DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATEPROPBLOB, drm_mode_createblob_ioctl, DRM_MASTER|DRM_UNLOCKED),
+ DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROYPROPBLOB, drm_mode_destroyblob_ioctl, DRM_MASTER|DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_CREATE, drm_syncobj_create_ioctl,
DRM_UNLOCKED|DRM_RENDER_ALLOW),
--
2.18.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm: Limite blob creation to drm master
2018-07-02 8:12 [PATCH] drm: Limite blob creation to drm master Daniel Vetter
@ 2018-07-02 10:24 ` Ville Syrjälä
2018-07-04 9:35 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2018-07-02 10:24 UTC (permalink / raw)
To: Daniel Vetter
Cc: Michel Dänzer, Daniel Vetter, Intel Graphics Development,
Daniel Stone, DRI Development
On Mon, Jul 02, 2018 at 10:12:21AM +0200, Daniel Vetter wrote:
> This interface allows pretty much unlimited kernel memory allocations,
> which isn't all that great. But we allow that anyway for any drm
> master client (through pinning display buffers and stuff, at least for
> UMA gpus),
At least on i915 memory used by pinned display buffers has some kind
of upper bound based on the number of planes+max fb size and/or ggtt
size.
Anyways, patch makes sense so
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> so just limiting it to the active master seems like a
> reasonable stopgap measure.
>
> Fixes: e2f5d2ea479b ("drm/mode: Add user blob-creation ioctl")
> Cc: Daniel Stone <daniels@collabora.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Michel Dänzer <michel@daenzer.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> drivers/gpu/drm/drm_ioctl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index c148eb3be8c2..dc740c381f9e 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -656,8 +656,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
> DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_SETPROPERTY, drm_mode_obj_set_property_ioctl, DRM_MASTER|DRM_UNLOCKED),
> DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR2, drm_mode_cursor2_ioctl, DRM_MASTER|DRM_UNLOCKED),
> DRM_IOCTL_DEF(DRM_IOCTL_MODE_ATOMIC, drm_mode_atomic_ioctl, DRM_MASTER|DRM_UNLOCKED),
> - DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATEPROPBLOB, drm_mode_createblob_ioctl, DRM_UNLOCKED),
> - DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROYPROPBLOB, drm_mode_destroyblob_ioctl, DRM_UNLOCKED),
> + DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATEPROPBLOB, drm_mode_createblob_ioctl, DRM_MASTER|DRM_UNLOCKED),
> + DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROYPROPBLOB, drm_mode_destroyblob_ioctl, DRM_MASTER|DRM_UNLOCKED),
>
> DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_CREATE, drm_syncobj_create_ioctl,
> DRM_UNLOCKED|DRM_RENDER_ALLOW),
> --
> 2.18.0
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm: Limite blob creation to drm master
2018-07-02 10:24 ` Ville Syrjälä
@ 2018-07-04 9:35 ` Daniel Vetter
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2018-07-04 9:35 UTC (permalink / raw)
To: Ville Syrjälä
Cc: Daniel Stone, Daniel Vetter, Michel Dänzer, DRI Development,
Daniel Vetter, Intel Graphics Development
On Mon, Jul 02, 2018 at 01:24:40PM +0300, Ville Syrjälä wrote:
> On Mon, Jul 02, 2018 at 10:12:21AM +0200, Daniel Vetter wrote:
> > This interface allows pretty much unlimited kernel memory allocations,
> > which isn't all that great. But we allow that anyway for any drm
> > master client (through pinning display buffers and stuff, at least for
> > UMA gpus),
>
> At least on i915 memory used by pinned display buffers has some kind
> of upper bound based on the number of planes+max fb size and/or ggtt
> size.
>
> Anyways, patch makes sense so
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
CI is unhappy about it because it breaks the testcase. And on second
thought with stuff like drm leases we allow rather unpriviledge things to
be drm master, so this isn't helping all that much really. Also, cgroups
should be able to limit these kernel allocations - we only ever do this in
process context.
Decided to drop this on the floor instead.
-Daniel
>
> > so just limiting it to the active master seems like a
> > reasonable stopgap measure.
> >
> > Fixes: e2f5d2ea479b ("drm/mode: Add user blob-creation ioctl")
> > Cc: Daniel Stone <daniels@collabora.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Michel Dänzer <michel@daenzer.net>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> > drivers/gpu/drm/drm_ioctl.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> > index c148eb3be8c2..dc740c381f9e 100644
> > --- a/drivers/gpu/drm/drm_ioctl.c
> > +++ b/drivers/gpu/drm/drm_ioctl.c
> > @@ -656,8 +656,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
> > DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_SETPROPERTY, drm_mode_obj_set_property_ioctl, DRM_MASTER|DRM_UNLOCKED),
> > DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR2, drm_mode_cursor2_ioctl, DRM_MASTER|DRM_UNLOCKED),
> > DRM_IOCTL_DEF(DRM_IOCTL_MODE_ATOMIC, drm_mode_atomic_ioctl, DRM_MASTER|DRM_UNLOCKED),
> > - DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATEPROPBLOB, drm_mode_createblob_ioctl, DRM_UNLOCKED),
> > - DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROYPROPBLOB, drm_mode_destroyblob_ioctl, DRM_UNLOCKED),
> > + DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATEPROPBLOB, drm_mode_createblob_ioctl, DRM_MASTER|DRM_UNLOCKED),
> > + DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROYPROPBLOB, drm_mode_destroyblob_ioctl, DRM_MASTER|DRM_UNLOCKED),
> >
> > DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_CREATE, drm_syncobj_create_ioctl,
> > DRM_UNLOCKED|DRM_RENDER_ALLOW),
> > --
> > 2.18.0
>
> --
> Ville Syrjälä
> Intel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-04 9:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-02 8:12 [PATCH] drm: Limite blob creation to drm master Daniel Vetter
2018-07-02 10:24 ` Ville Syrjälä
2018-07-04 9:35 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox