From: sashiko-bot@kernel.org
To: "Satyanarayana K V P" <satyanarayana.k.v.p@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [RFC 05/11] drm/xe/pf: Enable VF Guc log and debug state capture
Date: Fri, 04 Dec 2026 16:04:12 +0000 [thread overview]
Message-ID: <sashiko-outbox-250155@kernel.org> (raw)
In-Reply-To: <20261204144712.3520695-18-satyanarayana.k.v.p@intel.com>
Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [High] drm/xe/pf: VF GuC log and debug capture flags lost on reset and
refresh
- [Medium] drm/xe: VF GuC log and debug capture skipped in custom
provisioning mode
- [Medium] drm/xe: pf_config_guc_debug_logs() ignores errors causing
O(num_vfs) stalls
- [Low] drm/xe/pf: missing KLV strings in xe_guc_klv_key_to_string()
- [Low] drm/xe/pf: commit message omits driver changes and provisioning
rationale
- [Low] drm/xe/pf: inconsistent VF debug log config APIs and duplicated
KLV helper
--
commit 0b090a19c988011c03030db7e15b2913e2827252
Author: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> drm/xe/pf: Enable VF Guc log and debug state capture
>
> Starting with GuC 70.84.0, the PF can enable a VF's access to its GuC log
> and debug state capture independently.
>
> 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]
The commit message only mentions the GuC 70.84.0 capability and does not
describe what the patch implements or why both features are enabled
unconditionally together only during auto-provisioning rather than exposed
independently or handled in custom provisioning mode.
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> index 926f1e83bd79d..ff8cee414a0f4 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -192,6 +192,36 @@ static int pf_push_vf_cfg_dbs(struct xe_gt *gt, unsigned int vfid, u32 begin, u3
> return pf_push_vf_cfg_klvs(gt, vfid, 2, klvs, ARRAY_SIZE(klvs));
> }
>
> +static int pf_push_vf_cfg_guc_log(struct xe_gt *gt, unsigned int vfid, u32 enable)
> +{
> + u32 klvs[] = {
> + PREP_GUC_KLV_TAG(SELF_CFG_GUC_LOG_ENABLE),
> + enable,
> + };
> +
> + return pf_push_vf_cfg_klvs(gt, vfid, 1, klvs, ARRAY_SIZE(klvs));
> +}
> +
> +static int pf_push_vf_cfg_debug_state_capture(struct xe_gt *gt, unsigned int vfid, u32 enable)
> +{
> + u32 klvs[] = {
> + PREP_GUC_KLV_TAG(SELF_CFG_DEBUG_STATE_CAPTURE_ENABLE),
> + enable,
> + };
> +
> + return pf_push_vf_cfg_klvs(gt, vfid, 1, klvs, ARRAY_SIZE(klvs));
> +}
[Severity: Low]
Should GUC_KLV_SELF_CFG_GUC_LOG_ENABLE_KEY and
GUC_KLV_SELF_CFG_DEBUG_STATE_CAPTURE_ENABLE_KEY also be added to
xe_guc_klv_key_to_string()? Without entries there, pf_push_vf_buf_klvs()
prints both keys as "(unknown)" on push errors and under
CONFIG_DRM_XE_DEBUG_SRIOV.
> +
> +int xe_gt_sriov_pf_cfg_vf_guc_log(struct xe_gt *gt, unsigned int vfid, bool enable)
> +{
> + return pf_push_vf_cfg_guc_log(gt, vfid, enable);
> +}
> +
> +int xe_gt_sriov_pf_cfg_vf_debug_state_capture(struct xe_gt *gt, unsigned int vfid, bool enable)
> +{
> + return pf_push_vf_cfg_debug_state_capture(gt, vfid, enable);
> +}
[Severity: High]
Are these two settings lost across GT resets, PF suspend/resume, and VF
config refreshes?
Both functions push the KLVs straight to GuC without recording them in
struct xe_gt_sriov_config or serializing them in encode_config(). After a
GT reset or PF resume, GuC reloads with both KLVs reset to their default
disabled state, and xe_gt_sriov_pf_config_restart() ->
pf_push_full_vf_config() only re-pushes what encode_config() emits,
silently disabling VF GuC log and debug state capture for all VFs.
Any VF config refresh via pf_refresh_vf_cfg() (which calls
pf_send_vf_cfg_reset() before pf_push_full_vf_config()) and
xe_gt_sriov_pf_config_save() / xe_gt_sriov_pf_config_restore() drop both
settings the same way.
[ ... ]
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> index 0d45dc9672e7b..97a84aab3c880 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> @@ -118,4 +118,8 @@ int xe_gt_sriov_pf_config_print_lmem(struct xe_gt *gt, struct drm_printer *p);
>
> int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_printer *p);
>
> +int xe_gt_sriov_pf_cfg_vf_guc_log(struct xe_gt *gt, unsigned int vfid, bool enable);
> +int xe_gt_sriov_pf_cfg_vf_debug_state_capture(struct xe_gt *gt, unsigned int vfid,
> + bool enable);
> +
> #endif
[Severity: Low]
This isn't a bug, but these declarations diverge from the conventions in
xe_gt_sriov_pf_config.h: every other public function uses the
xe_gt_sriov_pf_config_* prefix, has a kernel-doc comment, and either
acquires xe_gt_sriov_pf_master_mutex(gt) internally or carries a _locked
suffix with lockdep_assert_held() and PF/vfid assertions.
Also, pf_push_vf_cfg_guc_log() and pf_push_vf_cfg_debug_state_capture()
duplicate the existing pf_push_vf_cfg_u32() helper in
xe_gt_sriov_pf_config.c instead of reusing it.
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> index 598fd77c230f6..04f30cd00a6fb 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
[ ... ]
> @@ -33,6 +34,25 @@ static bool pf_auto_provisioning_mode(struct xe_device *xe)
> return xe->sriov.pf.provision.mode == XE_SRIOV_PROVISIONING_MODE_AUTO;
> }
>
> +static int pf_config_guc_debug_logs(struct xe_gt *gt, unsigned int num_vfs, bool enable)
> +{
> + unsigned int n;
> + int result = 0;
> + int err;
> +
> + if (!xe_gt_sriov_pf_debug_log_supported(gt))
> + return 0;
> +
> + for (n = 1; n <= num_vfs; n++) {
> + err = xe_gt_sriov_pf_cfg_vf_guc_log(gt, n, enable);
> + result = result ?: err;
> + err = xe_gt_sriov_pf_cfg_vf_debug_state_capture(gt, n, enable);
> + result = result ?: err;
> + }
> +
> + return result;
> +}
[Severity: Medium]
Should this loop break on the first error?
xe_sriov_pf_provision_vfs() holds xe_sriov_pf_master_mutex(xe) across all
GTs, and each KLV push calls guc_ct_send_recv(), which waits up to HZ and
returns -ETIME without disabling the CT channel. If GuC is unresponsive,
continuing the loop causes 2 * num_vfs consecutive 1-second stalls per GT
(over 120 seconds with 63 VFs), blocking other PF SR-IOV operations and
risking hung-task warnings. Sibling bulk loops such as
xe_gt_sriov_pf_config_bulk_set_ggtt_locked() break immediately on error.
> @@ -43,6 +63,8 @@ static int pf_provision_vfs(struct xe_device *xe, unsigned int num_vfs)
> lockdep_assert_held(xe_sriov_pf_master_mutex(xe));
>
> for_each_gt(gt, xe, id) {
> + err = pf_config_guc_debug_logs(gt, num_vfs, true);
> + result = result ?: err;
> err = xe_gt_sriov_pf_config_set_fair_sched_locked(gt, num_vfs);
> result = result ?: err;
> err = xe_gt_sriov_pf_config_set_fair_locked(gt, VFID(1), num_vfs);
[Severity: Medium]
Can VFs provisioned in custom mode ever get GuC log or debug state capture
enabled?
pf_config_guc_debug_logs() is only called from pf_provision_vfs(), which
xe_sriov_pf_provision_vfs() skips whenever the PF is in
XE_SRIOV_PROVISIONING_MODE_CUSTOM (entered as soon as any PF policy or VF
quota is written via debugfs). There is also no PF interface to enable or
toggle the two features independently despite the commit message stating
independent control.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204144712.3520695-13-satyanarayana.k.v.p@intel.com?part=5
next prev parent reply other threads:[~2026-12-04 16:04 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 [this message]
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
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-250155@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