mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
freedreno/ir3: Fix use after free
If the tex/sfu ssa src is from a different block than the one currently being scheduled, we do not have a valid sched-node. So fallback to previous behavior rather than dereference an invalid ptr. Fixes:7821e5a3f8("ir3/sched: Don't penalize uses of already-waited tex/SFU") Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10306> (cherry picked from commit09f64f74db)
This commit is contained in:
parent
3c7b57988f
commit
23cb39dc66
2 changed files with 13 additions and 1 deletions
|
|
@ -787,7 +787,7 @@
|
||||||
"description": "freedreno/ir3: Fix use after free",
|
"description": "freedreno/ir3: Fix use after free",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "7821e5a3f8d593e1e9738924f5f4dc5996583518"
|
"because_sha": "7821e5a3f8d593e1e9738924f5f4dc5996583518"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,12 @@ is_outstanding_tex_or_prefetch(struct ir3_instruction *instr, struct ir3_sched_c
|
||||||
if (!is_tex_or_prefetch(instr))
|
if (!is_tex_or_prefetch(instr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* The sched node is only valid within the same block, we cannot
|
||||||
|
* really say anything about src's from other blocks
|
||||||
|
*/
|
||||||
|
if (instr->block != ctx->block)
|
||||||
|
return true;
|
||||||
|
|
||||||
struct ir3_sched_node *n = instr->data;
|
struct ir3_sched_node *n = instr->data;
|
||||||
return n->tex_index >= ctx->first_outstanding_tex_index;
|
return n->tex_index >= ctx->first_outstanding_tex_index;
|
||||||
}
|
}
|
||||||
|
|
@ -204,6 +210,12 @@ is_outstanding_sfu(struct ir3_instruction *instr, struct ir3_sched_ctx *ctx)
|
||||||
if (!is_sfu(instr))
|
if (!is_sfu(instr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* The sched node is only valid within the same block, we cannot
|
||||||
|
* really say anything about src's from other blocks
|
||||||
|
*/
|
||||||
|
if (instr->block != ctx->block)
|
||||||
|
return true;
|
||||||
|
|
||||||
struct ir3_sched_node *n = instr->data;
|
struct ir3_sched_node *n = instr->data;
|
||||||
return n->sfu_index >= ctx->first_outstanding_sfu_index;
|
return n->sfu_index >= ctx->first_outstanding_sfu_index;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue