From: Matthew Auld <matthew.william.auld@gmail.com>
To: Robert Bragg <robert@sixbynine.org>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
Sourab Gupta <sourab.gupta@intel.com>,
Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH v7 03/11] drm/i915: return EACCES for check_cmd() failures
Date: Tue, 25 Oct 2016 22:53:58 +0100 [thread overview]
Message-ID: <CAM0jSHMvJWyKkd4j+ANBwuRZJe8FqW8bwosJCx-ovJPLGvWvMQ@mail.gmail.com> (raw)
In-Reply-To: <20161024231934.2243-4-robert@sixbynine.org>
On 25 October 2016 at 00:19, Robert Bragg <robert@sixbynine.org> wrote:
> check_cmd() is checking whether a command adheres to certain
> restrictions that ensure it's safe to execute within a privileged batch
> buffer. Returning false implies a privilege problem, not that the
> command is invalid.
>
> The distinction makes the difference between allowing the buffer to be
> executed as an unprivileged batch buffer or returning an EINVAL error to
> userspace without executing anything.
>
> In a case where userspace may want to test whether it can successfully
> write to a register that needs privileges the distinction may be
> important and an EINVAL error may be considered fatal.
>
> In particular this is currently true for Mesa, which includes a test for
> whether OACONTROL can be written too, but Mesa treats any error when
> flushing a batch buffer as fatal, calling exit(1).
>
> As it is currently Mesa can gracefully handle a failure to write to
> OACONTROL if the command parser is disabled, but if we were to remove
> OACONTROL from the parser's whitelist then the returned EINVAL would
> break Mesa applications as they attempt an OACONTROL write.
>
> This bumps the command parser version from 7 to 8, as the change is
> visible to userspace.
>
> Signed-off-by: Robert Bragg <robert@sixbynine.org>
Seems reasonable.
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-10-25 21:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 23:19 [PATCH v7 00/11] Enable i915 perf stream for Haswell OA unit Robert Bragg
2016-10-24 23:19 ` [PATCH v7 01/11] drm/i915: Add i915 perf infrastructure Robert Bragg
2016-10-25 15:58 ` Matthew Auld
2016-10-24 23:19 ` [PATCH v7 02/11] drm/i915: rename OACONTROL GEN7_OACONTROL Robert Bragg
2016-10-24 23:19 ` [PATCH v7 03/11] drm/i915: return EACCES for check_cmd() failures Robert Bragg
2016-10-25 21:53 ` Matthew Auld [this message]
2016-10-24 23:19 ` [PATCH v7 04/11] drm/i915: don't whitelist oacontrol in cmd parser Robert Bragg
2016-10-25 22:02 ` Matthew Auld
2016-10-24 23:19 ` [PATCH v7 05/11] drm/i915: Add 'render basic' Haswell OA unit config Robert Bragg
2016-10-24 23:19 ` [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit Robert Bragg
2016-10-25 21:35 ` Matthew Auld
2016-10-25 23:51 ` Robert Bragg
2016-10-26 8:54 ` Chris Wilson
2016-10-26 15:17 ` Robert Bragg
2016-10-26 15:37 ` [Intel-gfx] " Ville Syrjälä
2016-10-26 16:42 ` Robert Bragg
2016-10-26 16:52 ` Daniel Vetter
2016-10-26 16:54 ` [Intel-gfx] " Ville Syrjälä
[not found] ` <CAMou1-2j1FTGSCGh=0nq3BokVNe2U308M4STK-G6iz5-n5Gtfg@mail.gmail.com>
2016-10-26 18:53 ` Robert Bragg
2016-10-26 10:08 ` Matthew Auld
2016-10-26 15:03 ` Robert Bragg
2016-10-26 21:53 ` Robert Bragg
2016-10-25 23:05 ` Chris Wilson
2016-10-25 23:12 ` Chris Wilson
2016-10-24 23:19 ` [PATCH v7 07/11] drm/i915: advertise available metrics via sysfs Robert Bragg
2016-10-24 23:19 ` [PATCH v7 08/11] drm/i915: Add dev.i915.perf_stream_paranoid sysctl option Robert Bragg
2016-10-24 23:19 ` [PATCH v7 09/11] drm/i915: add oa_event_min_timer_exponent sysctl Robert Bragg
2016-10-24 23:19 ` [PATCH v7 10/11] drm/i915: Add more Haswell OA metric sets Robert Bragg
2016-10-24 23:19 ` [PATCH v7 11/11] drm/i915: Add a kerneldoc summary for i915_perf.c Robert Bragg
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=CAM0jSHMvJWyKkd4j+ANBwuRZJe8FqW8bwosJCx-ovJPLGvWvMQ@mail.gmail.com \
--to=matthew.william.auld@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=robert@sixbynine.org \
--cc=sourab.gupta@intel.com \
/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).