On Wed, Jan 29, 2014 at 01:55:03PM -0800, bradley.d.vol...@intel.com wrote:
> +/*
> + * Returns a pointer to a descriptor for the command specified by cmd_header.
> + *
> + * The caller must supply space for a default descriptor via the default_desc
> + * parameter. If no descriptor for the specified command exists in the ring's
> + * command parser tables, this function fills in default_desc based on the
> + * ring's default length encoding and returns default_desc.
> + */
> +static const struct drm_i915_cmd_descriptor*
> +find_cmd(struct intel_ring_buffer *ring,
> +      u32 cmd_header,
> +      struct drm_i915_cmd_descriptor *default_desc)
> +{
> +     u32 mask;
> +     int i;
> +
> +     for (i = 0; i < ring->cmd_table_count; i++) {
> +             const struct drm_i915_cmd_descriptor *desc;
> +
> +             desc = find_cmd_in_table(&ring->cmd_tables[i], cmd_header);
> +             if (desc)
> +                     return desc;
> +     }
> +
> +     mask = ring->get_cmd_length_mask(cmd_header);
> +     if (!mask)
> +             return NULL;
> +
> +     BUG_ON(!default_desc);
> +     default_desc->flags = CMD_DESC_SKIP;
> +     default_desc->length.mask = mask;

If we turn off all hw validation (through use of the secure bit) should
we not default to a whitelist of commands? Otherwise it just seems to be
a case of running a fuzzer until we kill the machine.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to