Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Gustavo Sousa" <gustavo.sousa@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/xe3p: Bump offset for PPHWSP software scratch area
Date: Fri, 06 Nov 2026 19:43:33 +0000	[thread overview]
Message-ID: <sashiko-outbox-202165@kernel.org> (raw)
In-Reply-To: <20261106-xe3p-bump-pphwsp-scratch-v1-1-d1b3e64a4e0a@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/xe: LRC_PPHWSP_FLUSH_INVAL_SCRATCH_ADDR collides with job
  timestamp offset
--

commit 7647f6d3f27709eeef4ffa64a14662ab16a3295d
Author: Gustavo Sousa <gustavo.sousa@intel.com>

drm/xe/xe3p: Bump offset for PPHWSP software scratch area

This commit defines a base offset of dword 128 for the driver's PPHWSP
software scratch area and expresses the flush and PXP invalidation
scratch addresses relative to it.

> diff --git a/drivers/gpu/drm/xe/xe_lrc.h b/drivers/gpu/drm/xe/xe_lrc.h
> index f2e829e621684..77949593562c7 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.h
> +++ b/drivers/gpu/drm/xe/xe_lrc.h
> @@ -51,8 +51,23 @@ struct xe_lrc_snapshot {
>  	u32 ctx_job_timestamp;
>  };
>  
> -#define LRC_PPHWSP_FLUSH_INVAL_SCRATCH_ADDR (0x34 * 4)
> -#define LRC_PPHWSP_PXP_INVAL_SCRATCH_ADDR (0x40 * 4)
> +/*
> + * The PPHWSP software scratch area starts at different locations
> + * depending on the IP:
> + *
> + *  - Before graphics version 35.10 B0-step: dword #34.
> + *  - Starting with graphics version 35.10 B0: dword #36.
> + *
> + * For our driver usage, we use a custom base that fits all supported
> + * IPs and adds some extra buffer in case future hardware updates end
> + * up reserving extra dwords and further pushing the base of the
> + * scratch area.
> + */
> +#define LRC_PPHWSP_SCRATCH_BASE			(128 * 4)
> +#define LRC_PPHWSP_SCRATCH_DW(idx)		(LRC_PPHWSP_SCRATCH_BASE + (idx) * 4)
> +
> +#define LRC_PPHWSP_FLUSH_INVAL_SCRATCH_ADDR	LRC_PPHWSP_SCRATCH_DW(0)
> +#define LRC_PPHWSP_PXP_INVAL_SCRATCH_ADDR	LRC_PPHWSP_SCRATCH_DW(12)

[Severity: High]
Does setting LRC_PPHWSP_SCRATCH_BASE to (128 * 4) make
LRC_PPHWSP_FLUSH_INVAL_SCRATCH_ADDR collide with
LRC_CTX_JOB_TIMESTAMP_OFFSET in drivers/gpu/drm/xe/xe_lrc.c?

drivers/gpu/drm/xe/xe_lrc.c:
#define LRC_CTX_JOB_TIMESTAMP_OFFSET 512
...
static u32 __xe_lrc_ctx_job_timestamp_offset(struct xe_lrc *lrc)
{
	/* This is stored in the driver-defined portion of PPHWSP */
	return xe_lrc_pphwsp_offset(lrc) + LRC_CTX_JOB_TIMESTAMP_OFFSET;
}

In __emit_job_gen12_render_compute(), emit_copy_timestamp() stores the
job start timestamp at PPHWSP + 512, and emit_pipe_invalidate()
immediately follows with a PIPE_CONTROL_STORE_DATA_INDEX write of 0 to
PPHWSP + LRC_PPHWSP_FLUSH_INVAL_SCRATCH_ADDR (now also 512).  That
zeroes ctx_job_timestamp before the batch runs, causing check_timeout()
in drivers/gpu/drm/xe/xe_guc_submit.c to treat the total cumulative
context runtime as the current job's runtime and trigger false-positive
job timeouts and engine resets.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261106-xe3p-bump-pphwsp-scratch-v1-1-d1b3e64a4e0a@intel.com?part=1

  reply	other threads:[~2026-11-06 19:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 19:32 [PATCH] drm/xe/xe3p: Bump offset for PPHWSP software scratch area Gustavo Sousa
2026-11-06 19:43 ` sashiko-bot [this message]
2026-11-06 19:45 ` ✓ CI.KUnit: success for " Patchwork
2026-11-06 20:16 ` [PATCH] " Umesh Nerlige Ramappa
2026-11-06 20:22 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-11-08  0:34 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-09 22:28 ` [PATCH] " Matt Roper

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=sashiko-outbox-202165@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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