intel/decoders: limit number of decoded batchbuffers

IGT has a test to hang the GPU that works by having a batch buffer
jump back into itself, trigger an infinite loop on the command stream.
As our implementation of the decoding is "perfectly" mimicking the
hardware, our decoder also "hangs". This change limits the number of
batch buffer we'll decode before we bail to 100.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
This commit is contained in:
Lionel Landwerlin
2018-09-04 15:45:32 +01:00
parent acb50d6b1f
commit bf93084f44
4 changed files with 27 additions and 2 deletions

View File

@@ -898,6 +898,14 @@ aub_viewer_render_batch(struct aub_viewer_decode_ctx *ctx,
const uint32_t *p, *batch = (const uint32_t *) _batch, *end = batch + batch_size / sizeof(uint32_t);
int length;
if (ctx->n_batch_buffer_start >= 100) {
ImGui::TextColored(ctx->cfg->error_color,
"0x%08" PRIx64 ": Max batch buffer jumps exceeded", batch_addr);
return;
}
ctx->n_batch_buffer_start++;
for (p = batch; p < end; p += length) {
inst = gen_spec_find_instruction(ctx->spec, ctx->engine, p);
length = gen_group_get_length(inst, p);
@@ -991,4 +999,6 @@ aub_viewer_render_batch(struct aub_viewer_decode_ctx *ctx,
break;
}
}
ctx->n_batch_buffer_start--;
}