From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AD43606A681 for ; Fri, 4 Dec 2026 16:04:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cmJIhhIL Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5456A1130AA; Fri, 4 Dec 2026 16:04:20 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id B4DB11130AA for ; Fri, 4 Dec 2026 16:04:13 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 241EE61241; Fri, 4 Dec 2026 16:04:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4A6F1F00936; Fri, 4 Dec 2026 16:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796400252; bh=V74v316x289YICcrmxBANKiX18zbZqVEV6h4btgjVpY=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=cmJIhhILYHRZer9taLwcRlxX+DD6ifaMlNFsGOPxNTAPE2AeSkt+cfzRvKKhYtLEv AT16VloxhLQ2GW69xM5CE1F5SKdMxGzBFd5mppeGWbgR2o9NHPuqE1rHpkTF84O9AD e1RHDOW8u4qhJSAhIuuoilnuOksRjvKaYW6l42hOE1kiGBkhcfkbD41Jaa1oAOzxpc /XtWuQ0QC4a69I9H4Cn34PbwIOpyyhl+Me7mRrG9mLQNhXdaGnLliglRVne1UL45nf dRB7FMBnTD5+TN24tX2UpRDfC47muIoOrWthECP2tLCsFv/R4VlYHNp193k8hTF6Az Td7n6IUzI3/XA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC 05/11] drm/xe/pf: Enable VF Guc log and debug state capture To: "Satyanarayana K V P" , intel-xe@lists.freedesktop.org In-Reply-To: <20261204144712.3520695-18-satyanarayana.k.v.p@intel.com> References: <20261204144712.3520695-13-satyanarayana.k.v.p@intel.com> <20261204144712.3520695-18-satyanarayana.k.v.p@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 16:04:12 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: 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 > 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 > Cc: Piotr Pi=C3=B3rkowski > Cc: Micha=C5=82 Winiarski > Cc: Daniele Ceraolo Spurio [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, unsi= gned int vfid, u32 begin, u3 > return pf_push_vf_cfg_klvs(gt, vfid, 2, klvs, ARRAY_SIZE(klvs)); > } > =20 > +static int pf_push_vf_cfg_guc_log(struct xe_gt *gt, unsigned int vfid, u= 32 enable) > +{ > + u32 klvs[] =3D { > + 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[] =3D { > + 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, b= ool 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); > =20 > int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct = drm_printer *p); > =20 > +int xe_gt_sriov_pf_cfg_vf_guc_log(struct xe_gt *gt, unsigned int vfid, b= ool 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 =3D=3D XE_SRIOV_PROVISIONING_MODE_AU= TO; > } > =20 > +static int pf_config_guc_debug_logs(struct xe_gt *gt, unsigned int num_v= fs, bool enable) > +{ > + unsigned int n; > + int result =3D 0; > + int err; > + > + if (!xe_gt_sriov_pf_debug_log_supported(gt)) > + return 0; > + > + for (n =3D 1; n <=3D num_vfs; n++) { > + err =3D xe_gt_sriov_pf_cfg_vf_guc_log(gt, n, enable); > + result =3D result ?: err; > + err =3D xe_gt_sriov_pf_cfg_vf_debug_state_capture(gt, n, enable); > + result =3D 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, unsig= ned int num_vfs) > lockdep_assert_held(xe_sriov_pf_master_mutex(xe)); > =20 > for_each_gt(gt, xe, id) { > + err =3D pf_config_guc_debug_logs(gt, num_vfs, true); > + result =3D result ?: err; > err =3D xe_gt_sriov_pf_config_set_fair_sched_locked(gt, num_vfs); > result =3D result ?: err; > err =3D 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204144712.3520= 695-13-satyanarayana.k.v.p@intel.com?part=3D5