From: sashiko-bot@kernel.org
To: "Satyanarayana K V P" <satyanarayana.k.v.p@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [RFC 10/11] drm/xe/guc: Handle GuC debug state capture notifications for VF
Date: Fri, 04 Dec 2026 18:13:44 +0000 [thread overview]
Message-ID: <sashiko-outbox-250391@kernel.org> (raw)
In-Reply-To: <20261204144712.3520695-23-satyanarayana.k.v.p@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/xe: xe_guc_capture_vf_handler() accesses guc->log.bo
instead of ads.bo
- [Low] drm/xe/guc: dead IS_SRIOV_VF() return in
__guc_capture_process_output()
--
commit d6a2fcb7b67e7c0a4ddd0116f5daace11e2e2b61
Author: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
drm/xe/guc: Handle GuC debug state capture notifications for VF
This commit adds xe_guc_capture_vf_handler() to process
XE_GUC_ACTION_GUC2VF_NOTIFY_DEBUG_STATE_CAPTURE notifications on a VF and
returns early from __guc_capture_process_output() when running on a VF.
> diff --git a/drivers/gpu/drm/xe/xe_guc_capture.c b/drivers/gpu/drm/xe/xe_guc_capture.c
> index 49a15f86eca8e..7e3b1bb234331 100644
> --- a/drivers/gpu/drm/xe/xe_guc_capture.c
> +++ b/drivers/gpu/drm/xe/xe_guc_capture.c
> @@ -1566,6 +1566,9 @@ static void __guc_capture_process_output(struct xe_guc *guc)
> log_buf_state_offset + offsetof(struct guc_log_buffer_state, read_ptr), u32,
> write_offset);
>
> + if (IS_SRIOV_VF(guc_to_xe(guc)))
> + return;
> +
[Severity: Low]
Is this IS_SRIOV_VF() early return needed once the series is complete?
It is not mentioned in a comment or the commit message, and commit
"drm/xe/guc: Process VF GuC error state captures" later restricts
xe_guc_capture_process() to call static __guc_capture_process_output()
only on non-VFs, leaving this check as unreachable dead code.
[ ... ]
> @@ -2174,3 +2177,20 @@ int xe_guc_capture_init(struct xe_guc *guc)
>
> return 0;
> }
> +
> +/**
> + * xe_guc_capture_vf_handler - Handle G2H notification for debug error state
> + * capture for VF.
> + * @guc: The GuC object
> + * @msg: The message from GuC
> + * @len: The length of the message
> + *
> + * Process debug error state capture messages from GuC for a VF.
> + *
> + * Returns: 0 on success.
> + */
> +int xe_guc_capture_vf_handler(struct xe_guc *guc, u32 *msg, u32 len)
> +{
> + xe_guc_capture_process(guc);
> + return 0;
> +}
[Severity: Medium]
Can this dereference a NULL guc->log.bo or access the wrong buffer at
this commit?
xe_guc_capture_vf_handler() is wired into process_g2h_msg() here and
calls xe_guc_capture_process() -> __guc_capture_process_output(), which
reads and updates guc->log.bo->vmap using PF log layout constants instead
of the guc->ads.bo buffer registered by xe_guc_ads_capture_init_vf().
When the PF enables debug state capture without GuC logging,
xe_guc_log_init() leaves guc->log.bo NULL, causing a NULL pointer
dereference on a VF capture notification. When both are enabled, it
writes read_ptr to guc->log.bo without holding log->vf_log_capture_lock.
Commit "drm/xe/guc: Process VF GuC error state captures" fixes this later
in the series, but this commit breaks git bisect. Introducing VF capture
output processing before (or squashed with) wiring up
XE_GUC_ACTION_GUC2VF_NOTIFY_DEBUG_STATE_CAPTURE would keep it bisectable.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204144712.3520695-13-satyanarayana.k.v.p@intel.com?part=10
next prev parent reply other threads:[~2026-12-04 18:13 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
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 [this message]
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-250391@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