Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Satyanarayana K V P" <satyanarayana.k.v.p@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [RFC 09/11] drm/xe/guc: Register VF-accessible registers for error capture
Date: Fri, 04 Dec 2026 17:52:28 +0000	[thread overview]
Message-ID: <sashiko-outbox-250352@kernel.org> (raw)
In-Reply-To: <20261204144712.3520695-22-satyanarayana.k.v.p@intel.com>

Thank you for your contribution! Sashiko AI review found 5 potential
issues to consider:
- [Medium] drm/xe/guc: VF capture lists missing from xe_hpg_lists and
  xe_lp_lists
- [Medium] drm/xe/guc: PF-owned RING_HWS_PGA left in VF capture register
  lists
- [Medium] drm/xe/guc: GT-global SFC_DONE registers exposed in VF
  capture list
- [Medium] drm/xe/guc: RING_EXECLIST_SQ_CONTENTS exposed in VF capture
  lists
- [Low] drm/xe/guc: commit message omits PF-only rationale and Xe3p-only
  scope
--

commit 228223cb9db744854f25f4fc783254a025baa753
Author: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>

> drm/xe/guc: Register VF-accessible registers for error capture
>
> Separate the capture register set into common and PF only register sets
> and register common register sets for both PF and VF.
>
> Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

[Severity: Low]
Could the commit message explain why RING_HWSTAM, GFX_MODE, and
RING_PSMI_CTL are moved to PF-only sets while the remaining registers stay
VF-accessible?  It also says common register sets are registered for both
PF and VF without noting that VF lists are only wired into xe3p_lists,
leaving xe_hpg_lists and xe_lp_lists PF-only.

> diff --git a/drivers/gpu/drm/xe/xe_guc_capture.c b/drivers/gpu/drm/xe/xe_guc_capture.c
> index e528b3e9d158c..49a15f86eca8e 100644
> --- a/drivers/gpu/drm/xe/xe_guc_capture.c
> +++ b/drivers/gpu/drm/xe/xe_guc_capture.c
> @@ -106,13 +106,11 @@ struct __guc_capture_parsed_output {
>  	{ FORCEWAKE_GT,			REG_32BIT,	0,	0,	0,	"FORCEWAKE_GT"}
>  
>  #define COMMON_BASE_ENGINE_INSTANCE \
> -	{ RING_HWSTAM(0),		REG_32BIT,	0,	0,	0,	"HWSTAM"}, \
>  	{ RING_HWS_PGA(0),		REG_32BIT,	0,	0,	0,	"RING_HWS_PGA"}, \

[Severity: Medium]
Should RING_HWS_PGA(0) also move into COMMON_BASE_ENGINE_INSTANCE_PF_ONLY
alongside RING_HWSTAM(0)?

xe_hw_engine_enable_ring() writes the PF's Global HWSP GGTT address to
RING_HWS_PGA on PF only.  Leaving it in all VF capture lists in xe3p_lists[]
could leak that PF GGTT address into a VF's capture buffer on an engine hang
or cause GuC to reject the capture.

[ ... ]

> @@ -138,6 +136,10 @@ struct __guc_capture_parsed_output {
>  	{ RING_BUFFER_HEAD_PREEMPT_REG(0),		REG_32BIT, 0,	0,	0,	"RING_BUFFER_HEAD_PREEMPT_REG"}, \
>  	{ RING_BB_ADDR_DIFF(0),		REG_32BIT, 0,	0,	0,	"RING_BB_ADDR_DIFF"} \
>  
> +#define COMMON_BASE_ENGINE_INSTANCE_PF_ONLY \
> +	{ RING_HWSTAM(0),               REG_32BIT,      0,      0,      0,      "HWSTAM"}, \
> +	{ GFX_MODE(0),                  REG_32BIT,      0,      0,      0,      "GFX_MODE"}

[Severity: Medium]
Does COMMON_BASE_ENGINE_INSTANCE still expose
RING_EXECLIST_SQ_CONTENTS_LO/HI to VFs across all six VF engine-instance
capture lists?

Those registers hold the 64-bit LRC descriptor written to Execlist Submit
Queue slot 0 and are not cleared by hardware.  If a VF hang collides with
GuC submitting a preempting PF or co-resident VF descriptor, capturing them
could leak another tenant's GGTT LRCA and context ID unless GuC scrubs them.

Moving RING_EXECLIST_SQ_CONTENTS_LO/HI into
COMMON_BASE_ENGINE_INSTANCE_PF_ONLY (or documenting a GuC scrubbing
guarantee) would avoid this cross-tenant leak.

[ ... ]

> @@ -193,6 +197,7 @@ static const struct __guc_mmio_reg_descr xe_lp_global_regs[] = {
>  /* Render / Compute Per-Engine-Instance */
>  static const struct __guc_mmio_reg_descr xe_rc_inst_regs[] = {
>  	COMMON_BASE_ENGINE_INSTANCE,
> +	COMMON_BASE_ENGINE_INSTANCE_PF_ONLY
>  };

[Severity: Medium]
Should VF capture lists also be added to xe_hpg_lists and xe_lp_lists,
including a VF counterpart for xe_rc_inst_regs?

pf_check_vf_debug_support() enables VF debug state capture on every SR-IOV
platform running GuC >= 70.84.0 without restricting to Xe3p, and
guc_capture_get_device_reglist() selects xe_hpg_lists or xe_lp_lists for all
SR-IOV platforms with GRAPHICS_VER < 35 (such as BMG, PTL, ATS-M, and ADL).

Because only xe3p_lists has VF entries, guc_capture_prep_lists() gets
-ENODATA for every VF list on pre-Xe3p platforms and points every VF capture
slot in ADS to null_ggtt, silently producing empty VF error captures.

[ ... ]

> @@ -307,16 +347,28 @@ static const struct __guc_mmio_reg_descr_group xe3p_lists[] = {
[ ... ]
>  	MAKE_REGLIST(xe_vec_class_regs, PF, ENGINE_CLASS, GUC_CAPTURE_LIST_CLASS_VIDEOENHANCE),
> +	MAKE_REGLIST(xe_vec_class_regs, VF, ENGINE_CLASS, GUC_CAPTURE_LIST_CLASS_VIDEOENHANCE),

[Severity: Medium]
Should VF VIDEOENHANCE ENGINE_CLASS use empty_regs_list instead of
xe_vec_class_regs?

xe_vec_class_regs captures all four GT-global SFC_DONE(0..3) registers,
while every other VF GLOBAL and ENGINE_CLASS entry uses empty_regs_list or
is omitted.  On a VECS hang, this could expose PF or co-resident VF SFC
pipeline state across media slices unless GuC filters them for VF captures.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204144712.3520695-13-satyanarayana.k.v.p@intel.com?part=9

  reply	other threads:[~2026-12-04 17:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 14:47 [RFC 00/11] Enable GuC log and debug error state capture for VF Satyanarayana K V P
2026-12-04 14:47 ` [RFC 01/11] drm/xe/pf: Allow VF access to GuC timestamp registers Satyanarayana K V P
2026-12-04 15:09   ` sashiko-bot
2026-12-04 14:47 ` [RFC 02/11] drm/xe/vf: Enable VF debug logging only on supported GUC versions Satyanarayana K V P
2026-12-04 15:22   ` sashiko-bot
2026-12-04 14:47 ` [RFC 03/11] drm/xe/guc: Add KLV definitions for GuC log and debug state capture Satyanarayana K V P
2026-12-04 15:34   ` sashiko-bot
2026-12-04 14:47 ` [RFC 04/11] drm/xe/pf: Enable VF debug logging only on supported GUC versions Satyanarayana K V P
2026-12-04 15:50   ` sashiko-bot
2026-12-04 14:47 ` [RFC 05/11] drm/xe/pf: Enable VF Guc log and debug state capture Satyanarayana K V P
2026-12-04 16:04   ` sashiko-bot
2026-12-04 14:47 ` [RFC 06/11] drm/xe/vf: Query and allocate VF GuC log and debug capture buffers Satyanarayana K V P
2026-12-04 16:31   ` sashiko-bot
2026-12-04 14:47 ` [RFC 07/11] drm/xe/vf: Register VF GuC log and debug state " Satyanarayana K V P
2026-12-04 17:04   ` sashiko-bot
2026-12-04 14:47 ` [RFC 08/11] drm/xe/vf: Initialize GuC logging buffers during GuC setup Satyanarayana K V P
2026-12-04 17:30   ` sashiko-bot
2026-12-04 14:47 ` [RFC 09/11] drm/xe/guc: Register VF-accessible registers for error capture Satyanarayana K V P
2026-12-04 17:52   ` sashiko-bot [this message]
2026-12-04 14:47 ` [RFC 10/11] drm/xe/guc: Handle GuC debug state capture notifications for VF Satyanarayana K V P
2026-12-04 18:13   ` sashiko-bot
2026-12-04 14:47 ` [RFC 11/11] drm/xe/guc: Process VF GuC error state captures Satyanarayana K V P
2026-12-04 18:41   ` sashiko-bot
2026-12-04 14:56 ` ✗ CI.checkpatch: warning for Enable GuC log and debug error state capture for VF Patchwork
2026-12-04 14:58 ` ✓ CI.KUnit: success " Patchwork
2026-12-04 15:34 ` ✗ Xe.CI.BAT: failure " Patchwork

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-250352@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=satyanarayana.k.v.p@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