Skip to contentSkip to conversation

drm/xe/vf: Start re-emission from first unsignaled job during VF migration

bug report Dan Carpenter 1 participant 1 message Nov 27, 2025

lore
Share & tools
lore
#0 lore raw

Hello Matthew Brost,

Commit 00937fe1921a ("drm/xe/vf: Start re-emission from first unsignaled job during VF migration") from Nov 21, 2025 (linux-next), leads to the following Smatch static checker warning:

drivers/gpu/drm/xe/xe_guc_submit.c:2265 guc_exec_queue_unpause_prepare()
warn: iterator used outside loop: 'job'

drivers/gpu/drm/xe/xe_guc_submit.c

    2247 static void guc_exec_queue_unpause_prepare(struct xe_guc *guc,
    2248                                            struct xe_exec_queue *q)
    2249 {
    2250         struct xe_gpu_scheduler *sched = &q->guc->sched;
    2251         struct xe_sched_job *job = NULL;
    2252         bool restore_replay = false;
    2253 
    2254         list_for_each_entry(job, &sched->base.pending_list, drm.list) {
    2255                 restore_replay |= job->restore_replay;
    2256                 if (restore_replay) {
    2257                         xe_gt_dbg(guc_to_gt(guc), "Replay JOB - guc_id=%d, seqno=%d",
    2258                                   q->guc->id, xe_sched_job_seqno(job));
    2259 
    2260                         q->ring_ops->emit_job(job);
    2261                         job->restore_replay = true;
    2262                 }
    2263         }
    2264 
--> 2265         if (job)
    2266                 job->last_replay = true;

job is never NULL here, it's a pointer to an offset from the list_head. So this corrupts memory.

    2267 }

regards,
dan carpenter