Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mallesh Koujalagi" <mallesh.koujalagi@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [RFC PATCH v1 1/6] drm/xe/cper: Software CPER-Do not review
Date: Thu, 26 Nov 2026 14:18:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-235689@kernel.org> (raw)
In-Reply-To: <20261126135732.2169939-9-mallesh.koujalagi@intel.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] drm/xe/tests: test_sw_cper() stubs log_emit_cper() and
  bypasses xe_cper_emit()
- [Medium] drm/xe/cper: cper_init_section_desc() uses unprobed
  device_uid in early probe
- [Low] drm/xe/cper: placeholder DO NOT REVIEW commit title and
  changelog
--

commit ac02bda5c8770616c9a73c943f0782de2dbebf87
Author: Mallesh Koujalagi <mallesh.koujalagi@intel.com>

> drm/xe/cper: Software CPER-Do not review
>
> DO NOT REVIEW. COMPILATION ONLY
> This patch is from https://patchwork.freedesktop.org/series/176576
> Added only for Compilation.
>
> Signed-off-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>

[Severity: Low]
This commit still carries a temporary "DO NOT REVIEW. COMPILATION ONLY"
subject and changelog instead of describing the software CPER emission
support, header changes, and Crescent Island enablement added by the patch.

> diff --git a/drivers/gpu/drm/xe/tests/xe_log_kunit.c b/drivers/gpu/drm/xe/tests/xe_log_kunit.c
> index 56c36c8a08e18..9d8966a3177ff 100644
> --- a/drivers/gpu/drm/xe/tests/xe_log_kunit.c
> +++ b/drivers/gpu/drm/xe/tests/xe_log_kunit.c
[ ... ]
> @@ -130,6 +157,78 @@ static void demo_cper(struct kunit *test)
>  	demo(test->priv);
>  }
>  
> +/*
> + * Software CPER
> + */
> +static struct {
> +	unsigned int count;
> +	int cper_sev;
> +	enum xe_sigid sigid;
> +	u32 component;
> +	u32 location;
> +	const void *data;
> +	size_t len;
> +} sw_cper_capture;
> +
> +static void capture_emit_cper(struct pci_dev *pdev, int cper_sev,
> +			      enum xe_sigid sigid, u32 component, u32 location,
> +			      const void *data, size_t len, struct va_format *vaf)
> +{
> +	sw_cper_capture.count++;
> +	sw_cper_capture.cper_sev = cper_sev;
> +	sw_cper_capture.sigid = sigid;
> +	sw_cper_capture.component = component;
> +	sw_cper_capture.location = location;
> +	sw_cper_capture.data = data;
> +	sw_cper_capture.len = len;
> +}
> +
> +static const struct sw_cper_param {
> +	int cper_sev;
> +	enum xe_sigid sigid;
> +	u32 component;
> +	int err;		/* reported as ERR_PTR when non-zero */
> +	size_t len;		/* bytes of @blob passed as data */
> +	const char *name;
> +} sw_cper_params[] = {
> +	{ CPER_SEV_FATAL, XE_SIGID_PROBE, XE_LOG_COMPONENT_PROBE,
> +	  -ENODEV, 0, "sw-fatal-errno" },
> +	{ CPER_SEV_RECOVERABLE, XE_SIGID_GT_TDR, XE_LOG_COMPONENT_GUCSUBMIT,
> +	  -ETIMEDOUT, 0, "sw-recoverable-errno" },
> +	{ CPER_SEV_CORRECTED, XE_SIGID_MEM_FAULT, XE_LOG_COMPONENT_PAGEFAULT,
> +	  0, 0, "sw-corrected" },
> +	{ CPER_SEV_INFORMATIONAL, XE_SIGID_SURVIVABILITY, XE_LOG_COMPONENT_SURVIVABILITY,
> +	  0, 0, "sw-informational" },
> +	{ CPER_SEV_FATAL, XE_SIGID_SW, XE_LOG_COMPONENT_NONE,
> +	  0, sizeof(struct xe_ras_error_class), "sw-with-error-class" },
> +};
> +
> +KUNIT_ARRAY_PARAM_DESC(sw_cper, sw_cper_params, name);
> +
> +static void test_sw_cper(struct kunit *test)
> +{
> +	const struct sw_cper_param *param = test->param_value;
> +	struct xe_device *xe = test->priv;
> +	struct pci_dev *pdev = xe_any_to_pdev(xe);
> +	const void *data = param->err ? ERR_PTR(param->err) : param->len ? blob : NULL;
> +
> +	memset(&sw_cper_capture, 0, sizeof(sw_cper_capture));
> +	kunit_activate_static_stub(test, log_emit_cper, capture_emit_cper);
> +	kunit_activate_static_stub(test, log_dmesg_vprintk, nop_dmesg_vprintk);
> +
> +	xe_log_emit(pdev, param->cper_sev, param->sigid, param->component,
> +		    XE_LOG_LOCATION_NONE, data, param->len, "testing %s\n", param->name);
> +
> +	KUNIT_ASSERT_EQ(test, sw_cper_capture.count, 1);
> +	KUNIT_EXPECT_EQ(test, sw_cper_capture.cper_sev, param->cper_sev);
> +	KUNIT_EXPECT_EQ(test, (u32)sw_cper_capture.sigid, (u32)param->sigid);
> +	KUNIT_EXPECT_EQ(test, sw_cper_capture.component, param->component);
> +	KUNIT_EXPECT_PTR_EQ(test, sw_cper_capture.data, data);
> +	KUNIT_EXPECT_EQ(test, sw_cper_capture.len, param->len);
> +
> +	KUNIT_EXPECT_TRUE(test, is_sw_cper(sw_cper_capture.sigid));
> +}

[Severity: Medium]
Does test_sw_cper() bypass xe_cper_emit() and cper_emit_sw_err() completely?

Stubbing log_emit_cper() with capture_emit_cper() intercepts __xe_log_emit()
before xe_cper_emit() is called, and the fake XE_PVC device initialized by
xe_log_test_init() has xe->info.has_driver_cper set to false anyway.

In addition, sw_cper_params[] tests CPER_SEV_CORRECTED,
CPER_SEV_INFORMATIONAL, and a binary error-class payload in "sw-with-error-class",
whereas xe_cper_emit() only accepts CPER_SEV_RECOVERABLE and CPER_SEV_FATAL
and cper_emit_sw_err() ignores len and non-ERR_PTR data.

> diff --git a/drivers/gpu/drm/xe/xe_cper.c b/drivers/gpu/drm/xe/xe_cper.c
> index 64bbb149e4e3e..d8fff57a349e4 100644
> --- a/drivers/gpu/drm/xe/xe_cper.c
> +++ b/drivers/gpu/drm/xe/xe_cper.c
[ ... ]
> @@ -519,12 +566,21 @@ void xe_cper_emit(struct xe_device *xe, int cper_sev, enum xe_sigid sigid,
>  		  u32 component, u32 location, const void *data, size_t len,
>  		  struct va_format *vaf)
>  {
> +	/* TODO: Handle using pdev instead of xe. */
> +	if (!xe)
> +		return;
> +
>  	if (is_hw_sigid(sigid) && !IS_ERR_OR_NULL(data)) {
>  		cper_emit_hw_err(xe, cper_sev, sigid, data);
>  		return;
>  	}
>  
> -	/* TODO software CPER */
> +	if (xe->info.has_driver_cper) {
> +		if (is_sw_sigid(sigid) &&
> +		    (cper_sev == CPER_SEV_RECOVERABLE || cper_sev == CPER_SEV_FATAL))
> +			cper_emit_sw_err(xe, cper_sev, sigid, component, location, data, vaf);
> +		return;
> +	}
>  }

[Severity: Medium]
Can a software CPER emitted during early probe mark sdesc->fru_id as valid
before xe->device_uid has been read from hardware?

On Crescent Island, xe_info_init_early() sets both xe->info.has_device_uid
and xe->info.has_driver_cper, but xe->device_uid is not populated until
xe_device_probe() calls xe_uid_probe() (and is never read if the device
enters boot survivability mode).  If an early probe failure or survivability
log triggers xe_cper_emit() -> cper_emit_sw_err() -> cper_record_emit() ->
cper_init_section_desc() before xe_uid_probe(), cper_init_section_desc()
sees xe->info.has_device_uid, copies the unprobed zero xe->device_uid into
sdesc->fru_id, and sets CPER_SEC_VALID_FRU_ID.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126135732.2169939-8-mallesh.koujalagi@intel.com?part=1

  reply	other threads:[~2026-11-26 14:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 13:57 [RFC PATCH v1 0/6] drm/xe: Support xe_log_* helpers in atomic context Mallesh Koujalagi
2026-11-26 13:57 ` [RFC PATCH v1 1/6] drm/xe/cper: Software CPER-Do not review Mallesh Koujalagi
2026-11-26 14:18   ` sashiko-bot [this message]
2026-11-26 13:57 ` [RFC PATCH v1 2/6] drm/xe/log: Add xe_log_* logging helpers for atomic context Mallesh Koujalagi
2026-11-26 13:57 ` [RFC PATCH v1 3/6] drm/xe/cper: Add gfp argument to xe_cper_emit() Mallesh Koujalagi
2026-11-26 14:13   ` sashiko-bot
2026-11-26 13:57 ` [RFC PATCH v1 4/6] drm/xe/tests: Update log tests for atomic logging support Mallesh Koujalagi
2026-11-26 13:57 ` [RFC PATCH v1 5/6] drm/xe/pagefault: Use xe_log_err_atomic() for queue full errors Mallesh Koujalagi
2026-11-26 13:57 ` [RFC PATCH v1 6/6] drm/xe/guc_ct: Use atomic logging under ct->fast_lock Mallesh Koujalagi
2026-11-26 14:10   ` sashiko-bot

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-235689@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mallesh.koujalagi@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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