Regarding the pre-existing issue flagged by the Sashiko review below:
the report is correct.  logical_sort() scans all MAX_ENGINE_INSTANCE + 1
slots while its only caller initializes just num_engines entries, so the
inner loop can in principle dereference an uninitialized stack pointer.
In practice the logical instances within a class are numbered
contiguously, so every BIT(i) matches within the initialized entries and
the stale slots are never reached.

While confirming this, a second problem in the same function turned up:
the final memcpy() passes *engines and *sorted instead of the arrays
themselves, so it copies engine structure data rather than the pointer
arrays.

Since both are unrelated to this cleanup, I have sent a separate patch
replacing the helper with a plain sort() keyed by the logical mask,
which addresses both and drops the assumption that logical instances
are numbered contiguously: "drm/i915/guc: Sort multi-lrc engines by
logical instance".

This patch itself is unaffected.

Reply via email to