Re: [PATCH 1/2] drm/i915: Implement I915_PERF_ADD/REMOVE_CONFIG interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Lionel Landwerlin (2017-07-07 18:08:37)
> +static bool gen8_is_valid_flex_addr(struct drm_i915_private *dev_priv, u32 addr)
> +{
> +       static const i915_reg_t flex_eu_regs[] = {
> +               EU_PERF_CNTL0,
> +               EU_PERF_CNTL1,
> +               EU_PERF_CNTL2,
> +               EU_PERF_CNTL3,
> +               EU_PERF_CNTL4,
> +               EU_PERF_CNTL5,
> +               EU_PERF_CNTL6,
> +       };
> +       int i;
> +
> +       for (i = 0; i < ARRAY_SIZE(flex_eu_regs); i++) {
> +               if (flex_eu_regs[i].reg == addr)
> +                       return true;
> +       }
> +       return false;
> +}
> +
> +static bool gen7_is_valid_b_counter_addr(struct drm_i915_private *dev_priv, u32 addr)
> +{
> +       return (addr >= 0x2380 && addr <= 0x27ac);
> +}
> +
> +static bool gen7_is_valid_mux_addr(struct drm_i915_private *dev_priv, u32 addr)
> +{
> +       return addr == NOA_WRITE.reg ||
> +               (addr >= 0xd0c && addr <= 0xd3c) ||
> +               (addr >= 0x25100 && addr <= 0x2FB9C);
> +}
> +
> +static bool hsw_is_valid_mux_addr(struct drm_i915_private *dev_priv, u32 addr)
> +{
> +       return (addr >= 0x25100 && addr <= 0x2FF90) ||
> +               gen7_is_valid_mux_addr(dev_priv, addr);
> +}
> +
> +static bool chv_is_valid_mux_addr(struct drm_i915_private *dev_priv, u32 addr)
> +{
> +       return (addr >= 0x182300 && addr <= 0x1823A4) ||
> +               gen7_is_valid_mux_addr(dev_priv, addr);
> +}

Looks like you've already thought of what I was about to say: we need
whitelisting of what userspace can read/tweak. It's a nuisance, but we
could let the privileged (oa_paranoid?) client load an arbitrary config
(though again that may have to be within reason).
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux