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 9435A606A322 for ; Fri, 4 Dec 2026 18:13:56 +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=DIBDIM0R Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 58C57113110; Fri, 4 Dec 2026 18:13:51 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 293551130F1 for ; Fri, 4 Dec 2026 18:13:45 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id D1B93413BC; Fri, 4 Dec 2026 18:13:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5731F1F00936; Fri, 4 Dec 2026 18:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796408024; bh=bKBwobcpX6M5Ddf+qp9Sab+t9mG13prb7dZmKDExgV4=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=DIBDIM0Rf/gMLNXa/9k3wM4EOdQ+4BcRGDROS51cjHp/yfdSBqmdGLBBUpu65rq9s ezsDfSuENqTpTS4V2n6YMIjW4MTAjvMxhCveZvD9A5I74BAAkV9Up6XmeBwNTlPXdZ qBWvKZkxZI+ZjSRP11BKCFqWawcg6mntWTTMIbK3VOX1DyVOFMA+YEtwb+RT1LAv/d FFecd0/P7gwzTkk/jEtN1qT9U4Umc2gtC09X2nqeVXVilUDh8MjxFFbo9auwRFyz9p c0+xRvrDieD9Ub04tEMcbmrlPea9deHwXhQM9fkdkKtlPdSu/Lterca2wPkSY5RKKW l7RqXeS5PNksg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC 10/11] drm/xe/guc: Handle GuC debug state capture notifications for VF To: "Satyanarayana K V P" , intel-xe@lists.freedesktop.org In-Reply-To: <20261204144712.3520695-23-satyanarayana.k.v.p@intel.com> References: <20261204144712.3520695-13-satyanarayana.k.v.p@intel.com> <20261204144712.3520695-23-satyanarayana.k.v.p@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 18:13:44 +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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 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 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_pt= r), u32, > write_offset); > =20 > + 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) > =20 > return 0; > } > + > +/** > + * xe_guc_capture_vf_handler - Handle G2H notification for debug error s= tate > + * 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204144712.3520= 695-13-satyanarayana.k.v.p@intel.com?part=3D10