dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Robert Bragg <robert@sixbynine.org>
To: Matthew Auld <matthew.william.auld@gmail.com>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Sourab Gupta <sourab.gupta@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH v8 02/12] drm/i915: Add i915 perf infrastructure
Date: Mon, 31 Oct 2016 16:27:49 +0000	[thread overview]
Message-ID: <CAMou1-1d1p_UuWFN=mCVhmgbEL_-MFuA9TDN5758VY2s3n_fhQ@mail.gmail.com> (raw)
In-Reply-To: <CAM0jSHN0OYZ50VSD2_UerP8gFiGHRSe45VUg6jo20fQo_J8LgQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1373 bytes --]

On Fri, Oct 28, 2016 at 3:27 PM, Matthew Auld <
matthew.william.auld@gmail.com> wrote:

> > +/* Note we copy the properties from userspace outside of the i915 perf
> > + * mutex to avoid an awkward lockdep with mmap_sem.
> > + *
> > + * Note this function only validates properties in isolation it doesn't
> > + * validate that the combination of properties makes sense or that all
> > + * properties necessary for a particular kind of stream have been set.
> > + */
> > +static int read_properties_unlocked(struct drm_i915_private *dev_priv,
> > +                                   u64 __user *uprops,
> > +                                   u32 n_props,
> > +                                   struct perf_open_properties *props)
> > +{
> > +       u64 __user *uprop = uprops;
> > +       int i;
> > +
> > +       memset(props, 0, sizeof(struct perf_open_properties));
> > +
> > +       if (!n_props) {
> > +               DRM_ERROR("No i915 perf properties given");
> > +               return -EINVAL;
> > +       }
> > +
> > +       if (n_props > DRM_I915_PERF_PROP_MAX) {
> Ah but DRM_I915_PERF_PROP_MAX is not a property itself.
>

I'm not sure I follow what your implied concern is?

This is just a sanity check for the number properties given by userspace,
based on the assumption that there's currently no reason for multiple
values with a particular property id.

[-- Attachment #1.2: Type: text/html, Size: 2011 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-10-31 16:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28  2:14 [PATCH v8 00/12] Enable i915 perf stream for Haswell OA unit Robert Bragg
2016-10-28  2:14 ` [PATCH v8 01/12] ctx-pin placeholder from chris Robert Bragg
2016-10-28  2:14 ` [PATCH v8 02/12] drm/i915: Add i915 perf infrastructure Robert Bragg
2016-10-28 14:27   ` Matthew Auld
2016-10-31 16:27     ` Robert Bragg [this message]
2016-10-31 17:13       ` Matthew Auld
2016-10-31 18:54         ` Robert Bragg
2016-11-04  8:59   ` sourab gupta
2016-11-04 13:19     ` Robert Bragg
2016-11-07  8:40       ` sourab gupta
2016-10-28  2:14 ` [PATCH v8 03/12] drm/i915: rename OACONTROL GEN7_OACONTROL Robert Bragg
2016-11-02  6:35   ` sourab gupta
2016-10-28  2:14 ` [PATCH v8 04/12] drm/i915: return EACCES for check_cmd() failures Robert Bragg
2016-11-04  5:18   ` sourab gupta
2016-10-28  2:14 ` [PATCH v8 05/12] drm/i915: don't whitelist oacontrol in cmd parser Robert Bragg
2016-11-04  9:17   ` sourab gupta
2016-10-28  2:14 ` [PATCH v8 06/12] drm/i915: Add 'render basic' Haswell OA unit config Robert Bragg
2016-10-28  2:14 ` [PATCH v8 07/12] drm/i915: Enable i915 perf stream for Haswell OA unit Robert Bragg
2016-10-31 21:44   ` Matthew Auld
2016-10-28  2:14 ` [PATCH v8 08/12] drm/i915: advertise available metrics via sysfs Robert Bragg
2016-11-04  9:01   ` sourab gupta
2016-10-28  2:14 ` [PATCH v8 09/12] drm/i915: Add dev.i915.perf_stream_paranoid sysctl option Robert Bragg
2016-11-04  9:06   ` sourab gupta
2016-10-28  2:14 ` [PATCH v8 10/12] drm/i915: add oa_event_min_timer_exponent sysctl Robert Bragg
2016-11-02  6:29   ` sourab gupta
2016-11-04  0:58     ` Robert Bragg
2016-10-28  2:14 ` [PATCH v8 11/12] drm/i915: Add more Haswell OA metric sets Robert Bragg
2016-11-01 14:57   ` Chris Wilson
2016-11-01 16:53     ` Robert Bragg
2016-10-28  2:14 ` [PATCH v8 12/12] 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='CAMou1-1d1p_UuWFN=mCVhmgbEL_-MFuA9TDN5758VY2s3n_fhQ@mail.gmail.com' \
    --to=robert@sixbynine.org \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.william.auld@gmail.com \
    --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).