drm/i915/gt: Always force restore freshly pinned contexts
diff mbox series

Message ID 20200107172842.3315449-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • drm/i915/gt: Always force restore freshly pinned contexts
Related show

Commit Message

Chris Wilson Jan. 7, 2020, 5:28 p.m. UTC
It is highly unlikely, but still conceivable, that we submit a context
with the same GGTT address as last active on the HW. In this case, with
a matching LRCA, the HW would not restore the new context image causing
a potential violation of our context isolation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mika Kuoppala Jan. 8, 2020, 9:28 a.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> It is highly unlikely, but still conceivable, that we submit a context
> with the same GGTT address as last active on the HW. In this case, with
> a matching LRCA, the HW would not restore the new context image causing
> a potential violation of our context isolation.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index f6174e597dd3..5ccc8a3538ba 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -2583,7 +2583,7 @@ __execlists_context_pin(struct intel_context *ce,
>  		goto unpin_active;
>  	}
>  
> -	ce->lrc_desc = lrc_descriptor(ce, engine);
> +	ce->lrc_desc = lrc_descriptor(ce, engine) | CTX_DESC_FORCE_RESTORE;
>  	ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
>  	__execlists_update_reg_state(ce, engine);
>  
> -- 
> 2.25.0.rc1

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index f6174e597dd3..5ccc8a3538ba 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -2583,7 +2583,7 @@  __execlists_context_pin(struct intel_context *ce,
 		goto unpin_active;
 	}
 
-	ce->lrc_desc = lrc_descriptor(ce, engine);
+	ce->lrc_desc = lrc_descriptor(ce, engine) | CTX_DESC_FORCE_RESTORE;
 	ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
 	__execlists_update_reg_state(ce, engine);