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 42DCC606A330 for ; Thu, 3 Dec 2026 19:07:12 +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=ZU5YeJCJ Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B2B910EB46; Thu, 3 Dec 2026 19:07:07 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 321B810EB1A for ; Thu, 3 Dec 2026 19:07:00 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id E2150432AF; Thu, 3 Dec 2026 19:06:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B60BF1F000C2; Thu, 3 Dec 2026 19:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796324819; bh=Jwdnb2rJyjCt/PZDFSLb6Nztp8Z1xIXuVt/rtphx5FI=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=ZU5YeJCJY8wKTlHVgaYhk6bKVPtCa9HQkl4gWSOm8jqRb1a715kN9sVmw8pAApUUx o75lF0ItvjcDj6+OSwE9djNuF3J2RwGEcW0+ZNh0oitrpX1TmFjLjoF5NAkev2tohI rRzHpYju/8ST+Gy/FowFFPGHgS6Nlqv59NrXM8RQTcSAS/yzN3ER92sop5DHLqgdi5 yTBEsfESTSYV9TsMVRTYhlam4FV4MFd4WHO6PJNdvnqhwv8wyNCt+kLdS1z9OqelIL YpoYwV4nZb9QjrOo/gd1fIq4R2SpXIlcIy0Wgjn+ZrSPKVvng4VWJAV1/Kleqnnpbw SBkwOHc8tomDg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/2] drm/xe/ras: Use RAS config command for USP AER downgrade in passthrough To: "Soham Purkait" , intel-xe@lists.freedesktop.org In-Reply-To: <20261203174452.1398280-6-soham.purkait@intel.com> References: <20261203174452.1398280-4-soham.purkait@intel.com> <20261203174452.1398280-6-soham.purkait@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 19:06:59 +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=-10.8 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 3 potential issues to consider: - [High] drm/xe/ras: undefined xe_debug() call in ras_config() breaks compilation - [Medium] drm/xe/ras: CONFIG_PCIEAER guard skips sysctrl mailbox USP AER downgrade - [Medium] drm/xe/ras: xe_run_as_guest() misses non-x86 and hidden x86 guests -- commit b3d3f6b24b0c7ca07f4fe595f8fab5a93f21a954 Author: Soham Purkait drm/xe/ras: Use RAS config command for USP AER downgrade in passthrough This commit detects guest execution in ras_usp_aer_init() and routes the Upstream Switch Port (USP) AER Uncorrectable Internal Error downgrade through the system controller mailbox instead of programming USP AER registers directly. > diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c > index d2141a2fc8262..cc6ff7bd002ba 100644 > --- a/drivers/gpu/drm/xe/xe_ras.c > +++ b/drivers/gpu/drm/xe/xe_ras.c [ ... ] > @@ -533,35 +537,55 @@ static int ras_config(struct xe_device *xe, enum xe= _ras_config config, > } > =20 > if (response.size) > - xe_dbg(xe, "[RAS]: %s config %u, data (%u bytes): %*ph\n", > - action_to_str(response.action), response.config, response.size, > - (int)min(response.size, sizeof(response.data)), response.data); > + xe_debug(xe, "[RAS]: %s config %u, data (%u bytes): %*ph\n", > + action_to_str(response.action), response.config, response.size, > + (int)min(response.size, sizeof(response.data)), response.data); > =20 > return 0; > } [Severity: High] Does xe_debug() exist? drivers/gpu/drm/xe/xe_printk.h only defines xe_dbg() and xe_dbg_ratelimited(), so this breaks compilation whenever CONFIG_DRM_XE is enabled. > =20 > +static bool xe_run_as_guest(void) > +{ > +#if IS_ENABLED(CONFIG_X86) > + return !hypervisor_is_type(X86_HYPER_NATIVE); > +#else > + return false; > +#endif > +} [Severity: Medium] Can xe_run_as_guest() miss passthrough guests on non-x86 architectures or on x86 when CONFIG_HYPERVISOR_GUEST is disabled or hypervisor CPUID is hidden? When it returns false in passthrough, xe_pci_get_usp_dev() returns NULL behind a virtual root bus or single root port, leaving the physical USP error fatal and able to trigger a Secondary Bus Reset. Behind two virtual bridges, AER writes hit an emulated bridge instead. Conversely, on x86 Xen Dom0, !hypervisor_is_type(X86_HYPER_NATIVE) evaluates to true and misclassifies the host as a guest. [ ... ] > static void ras_usp_aer_init(struct xe_device *xe) > { > struct pci_dev *pdev =3D to_pci_dev(xe->drm.dev); > - enum xe_ras_config config; > struct pci_dev *usp; > u16 aer_cap; > u32 status; > - int ret; > + > + if (xe_run_as_guest()) { > + xe_info(xe, "[RAS]: running as guest, using sysctrl mailbox\n"); > + ras_usp_aer_config_mailbox(xe); > + return; > + } [Severity: Medium] Will xe_ras_init() skip this sysctrl mailbox path when CONFIG_PCIEAER is disabled? xe_ras_init() only calls ras_usp_aer_init() when IS_ENABLED(CONFIG_PCIEAER) is true, even though CONFIG_DRM_XE does not select CONFIG_PCIEAER and guest kernels often omit it. When disabled, the downgrade is never sent and the physical USP error stays fatal. Since include/linux/aer.h stubs pcie_aer_is_native() to return 0 when CONFIG_PCIEAER is disabled, dropping the IS_ENABLED(CONFIG_PCIEAER) guard in xe_ras_init() lets both passthrough guests and non-native hosts use the sysctrl mailbox. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203174452.1398= 280-4-soham.purkait@intel.com?part=3D2