From: David Weinehall <david.weinehall@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Daniel Vetter <daniel@ffwll.ch>,
intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 01/03] drm/i915: add a context parameter to {en, dis}able zero address mapping
Date: Fri, 29 May 2015 11:18:40 +0300 [thread overview]
Message-ID: <20150529081840.GC4009@boom> (raw)
In-Reply-To: <20150528165625.GI19710@nuc-i3427.alporthouse.com>
On Thu, May 28, 2015 at 05:56:25PM +0100, Chris Wilson wrote:
> On Thu, May 28, 2015 at 05:52:21PM +0200, Daniel Vetter wrote:
> > On Thu, May 28, 2015 at 03:39:26PM +0100, Chris Wilson wrote:
> > > On Wed, May 20, 2015 at 05:00:13PM +0300, David Weinehall wrote:
> > > > Export a new context parameter that can be set/queried through the
> > > > context_{get,set}param ioctls. This parameter is passed as a context
> > > > flag and decides whether or not a GPU address mapping is allowed to
> > > > be made at address zero. The default is to allow such mappings.
> > >
> > > Please revert this piece of unreviewed API.
> > >
> > > The most obvious objection is what value of bias the kernel should be
> > > using.
> > >
> > > Then given that what value does this hold over and above userspace
> > > specifying the layout they want?
> >
> > Yeah it would be redundant with softpinning. But that's only for ocl2, and
> > this is apparently needed for for ocl1.x already. Hence imo it's ok to
> > pull this ahead a bit, even if redundant.
>
> Look at the interface:
>
> CONTEXT_NO_ZEROMAP:
> - it has nothing to do with mapping, it only concerns execbuf object
> location
If you want the option renamed I'd be happy to do so, just suggest a
better name.
> - what is a sensible bias? I certainly do not wish for the hack we have
> right now to become permanent (as this patch makes it).
> - it can still easily fail given a kernel that operates on pinned
> objects when not in full-ppgtt
>
I find it weird that you complain that this solution only works with
full ppgtt, then suggest an alternative solution that would only be
available for full ppgtt...
As far as solving the non-ppgtt case, I cannot see any obvious solution
except the original suggestion that was shot down quite quickly
(offsetting all allocations so none of them ever ends up at 0).
> For a context parameter, something like
> CONTEXT_MM_START, CONTEXT_MM_END
> that limited the drm_mm range manager for the context (downside is that
> such would only be available for full-ppgtt, but really full-ppgtt is
> mandatory for this in the first place otherwise it *is* exploitable -
> for it not requires a compiler that wouldn't need the NULL pointer to be
> all 0). The advantage of that parameter is that it is useful in igt
> testing, and even allows for limited rollout of 48bit full-ppgtt, vital
> given the workarounds that userspace must buy into before enabling.
>
I still don't see what attack vector you see that does not already
exist in the current code.
Also, what would be the use cases for a generic range limiting
interface, and wouldn't that force userspace to know unnecessarily much
about mm internals?
> And then there is "int flags;". Are we really expecting to use the sign
> bit on this bitmask?
No, that was simply a brainfart on my behalf; thanks for pointing it
out.
Kind regards, David
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-05-29 8:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 13:54 [PATCH 00/03] Preventing zero GPU virtual address allocation David Weinehall
2015-05-20 14:00 ` [PATCH 01/03] drm/i915: add a context parameter to {en, dis}able zero address mapping David Weinehall
2015-05-28 14:39 ` Chris Wilson
2015-05-28 15:52 ` Daniel Vetter
2015-05-28 16:56 ` Chris Wilson
2015-05-29 8:18 ` David Weinehall [this message]
2015-05-20 14:01 ` [PATCH 02/03] libdrm: export context_{get, set}param and I915_CONTEXT_PARAM_NO_ZEROMAP David Weinehall
2015-05-20 14:02 ` [PATCH 03/03] beignet: set I915_CONTEXT_PARAM_NO_ZEROMAP when initializing context David Weinehall
2015-05-20 14:09 ` [PATCH 00/03] Preventing zero GPU virtual address allocation Chris Wilson
2015-05-20 14:14 ` Chris Wilson
2015-05-20 16:00 ` Daniel Vetter
2015-05-20 16:10 ` Chris Wilson
2015-05-21 8:08 ` David Weinehall
2015-05-21 8:43 ` Chris Wilson
2015-05-21 9:38 ` David Weinehall
2015-05-21 9:59 ` Chris Wilson
2015-05-21 9:44 ` Daniel Vetter
2015-05-21 9:50 ` Chris Wilson
2015-05-27 9:17 ` David Weinehall
2015-06-05 14:13 ` Dave Gordon
2015-05-21 7:59 ` David Weinehall
2015-05-27 7:54 ` Zou, Nanhai
2015-05-27 11:29 ` Daniel Vetter
2015-05-21 9:44 ` [PATCH i-g-t 4/3] tests/gem_ctx_param_basic: Expand ctx_param tests David Weinehall
2015-05-27 11:32 ` Daniel Vetter
2015-05-28 12:20 ` David Weinehall
2015-05-28 14:53 ` David Weinehall
2015-05-29 7:52 ` Daniel Vetter
2015-08-06 21:30 ` Daniel Vetter
2015-08-06 21:30 ` Daniel Vetter
2015-08-06 21:33 ` Jesse Barnes
2015-08-10 14:15 ` David Weinehall
2015-08-13 23:12 ` Jesse Barnes
2015-08-10 14:17 ` David Weinehall
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=20150529081840.GC4009@boom \
--to=david.weinehall@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@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