Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: [bug report] drm/xe/vf: Start re-emission from first unsignaled job during VF migration
Date: Thu, 27 Nov 2025 09:46:12 +0300	[thread overview]
Message-ID: <aSfztMSRCeO91mTA@stanley.mountain> (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

                 reply	other threads:[~2025-11-27  6:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSfztMSRCeO91mTA@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox