From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: linux-kernel@vger.kernel.org,
Randy Dunlap <rdunlap@infradead.org>,
Peter Zijlstra <peterz@infradead.org>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Minimize uaccess exposure in i915_gem_execbuffer2_ioctl()
Date: Fri, 28 Feb 2020 10:10:41 -0600 [thread overview]
Message-ID: <20200228161041.ov7d5ox7myrnr4gi@treble> (raw)
In-Reply-To: <158284236096.19174.6917853940060252533@skylake-alporthouse-com>
On Thu, Feb 27, 2020 at 10:26:00PM +0000, Chris Wilson wrote:
> > --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> > +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> > @@ -2947,6 +2947,13 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data,
> > u64_to_user_ptr(args->buffers_ptr);
> > unsigned int i;
> >
> > + /*
> > + * Do the call to gen8_canonical_addr() outside the
> > + * uaccess-enabled region to minimize uaccess exposure.
> > + */
> > + for (i = 0; i < args->buffer_count; i++)
> > + exec2_list[i].offset = gen8_canonical_addr(exec2_list[i].offset);
>
>
> Another loop over all the objects, where we intentionally try and skip
> unmodified entries? To save 2 instructions from inside the second loop?
>
> Colour me skeptical.
So are you're saying these arrays can be large and that you have
performance concerns?
--
Josh
next prev parent reply other threads:[~2020-02-28 16:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 22:08 [PATCH] drm/i915: Minimize uaccess exposure in i915_gem_execbuffer2_ioctl() Josh Poimboeuf
2020-02-27 22:26 ` Chris Wilson
2020-02-28 16:10 ` Josh Poimboeuf [this message]
2020-02-27 22:35 ` Al Viro
2020-02-28 1:03 ` Josh Poimboeuf
2020-02-28 2:42 ` Randy Dunlap
2020-02-28 18:04 ` Peter Zijlstra
2020-02-28 19:56 ` Al Viro
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=20200228161041.ov7d5ox7myrnr4gi@treble \
--to=jpoimboe@redhat.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.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).