[Intel-gfx] [PATCH] drm/i915: Prevent loading of uninitialized context garbage

Ben Widawsky ben at bwidawsk.net
Thu Aug 8 19:12:05 CEST 2013


On Thu, Aug 08, 2013 at 02:37:35PM +0100, Chris Wilson wrote:
>The extended state bits are stored in the LCA register and affect all
>updates to the LCA register - i.e. the state on the old context is saved
>when SAVE_EX_STATE_EN  is currently set in the old context address before
>the update, and the new context is restored when RESTORE_EX_STATE_EN is
>set in the new context address. This is irrespective of the
>RESTORE_INHIBIT flag in the MI_SET_CONTEXT.
>
>Hence, upon initial loading the contents of the extended state is read
>from uninitialised data. To workaround this, on first load we do a dummy
>load without the mandatory RESTORE_EX_STATE_EN bit so that the real load
>causes us to initialise the extended state of the context before it is
>then loaded by the LCA update.
>
>References: https://bugs.freedesktop.org/show_bug.cgi?id=64073
>Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
>Cc: Ben Widawsky <ben at bwidawsk.net>

If you split this up in 2, the variable length for mi_set_context, and
the workaround - the variable length thing is:
Reviewed-by: Ben Widawsky <ben at bwidawsk.net>

I'd like to dig a bit more at the workaround portion.

-- 
Ben Widawsky, Intel Open Source Technology Center



More information about the Intel-gfx mailing list