From: sashiko-bot@kernel.org
To: "Riana Tauro" <riana.tauro@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v4 2/6] drm/xe/xe_ras: Handle page offline requests for device memory ecc errors
Date: Mon, 05 Oct 2026 09:16:05 +0000 [thread overview]
Message-ID: <20261005091605.9126E1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20261005090156.1233748-10-riana.tauro@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/xe: handle_page_offline() masks address fault errors, preventing GPU reset
- [Medium] drm/xe: missing __le64/__le32 in xe_ras_page_offline_request corrupts data on BE
--
commit dfae5aa8d25c44eda9036e3a3cde9ebb95f9803e
Author: Riana Tauro <riana.tauro@intel.com>
Subject: drm/xe/xe_ras: Handle page offline requests for device memory ecc errors
This commit adds support for sending page offline/remove requests to the
system controller and uses it for device memory ECC error handling. Pages
are soft-offlined depending on whether they belong to critical buffer
objects or standard user space.
> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
[ ... ]
> @@ -201,6 +204,127 @@ static inline const char *comp_to_str(u8 component)
[ ... ]
> +static int handle_page_offline(struct xe_device *xe, u64 page_address, bool notify_fw)
> +{
[ ... ]
> + switch (ret) {
> + case 0:
[ ... ]
> + case -ENOMEM:
> + xe_log_err(xe, DEVICE_MEMORY, ret,
> + "Poison detected at physical address 0x%llx, failed to soft-offline\n",
> + page_address);
> + return ret;
> + default:
> + xe_log_err(xe, DEVICE_MEMORY, ret, "Failed to handle address fault at physical address 0x%llx\n",
> + page_address);
> + return 0;
[Severity: High]
Does returning 0 here unintentionally mask unexpected errors from
xe_ttm_vram_handle_addr_fault?
If soft-offlining a page fails with an unexpected error such as -EINVAL
or -ENOENT, returning 0 causes the caller in handle_device_memory_errors
to assume the recovery was successful. This skips the required Secondary
Bus Reset, which leaves the system running with an active corrupted memory
page. Should this propagate the error to ensure a reset is triggered?
> + }
[ ... ]
> @@ -368,11 +492,12 @@ static u8 handle_soc_internal_errors(struct xe_device *xe, struct xe_ras_error_a
[ ... ]
> case XE_RAS_MEMORY_DB_ECC:
> - xe_info(xe, "[RAS]: Double-bit ECC error detected at sw address 0x%llx\n",
> - info->sw_address);
> - /* TODO: Add page offlining for Double-bit ECC error */
> - fallthrough;
> + ret = handle_page_offline(xe, info->sw_address, true);
> + if (ret)
> + return XE_RAS_RECOVERY_ACTION_RESET;
> + break;
[ ... ]
> diff --git a/drivers/gpu/drm/xe/xe_ras_types.h b/drivers/gpu/drm/xe/xe_ras_types.h
> --- a/drivers/gpu/drm/xe/xe_ras_types.h
> +++ b/drivers/gpu/drm/xe/xe_ras_types.h
[ ... ]
> @@ -295,6 +308,28 @@ struct xe_ras_memory_error {
[ ... ]
> +struct xe_ras_page_offline_request {
> + /** @page_address: Page address (4KB aligned) */
> + u64 page_address;
> + /** @action: Action to be performed, see &enum xe_ras_page_action */
> + u32 action;
[Severity: Medium]
Could this struct layout cause data corruption on big-endian architectures?
The struct uses native host types for the 64-bit page_address and 32-bit
action instead of explicitly specifying __le64 and __le32. When the sysctrl
mailbox transmits this data via MMIO writel in 32-bit chunks, a big-endian
system will word-swap the 64-bit value, sending the most-significant 32 bits
where the firmware expects the least-significant 32 bits.
Since send_page_offline_cmd assigns these fields directly without any
cpu_to_le64 conversion, should this struct definition use little-endian types
to safely maintain the hardware ABI contract?
> + /** @reserved: Reserved for future use */
> + u32 reserved;
> +} __packed;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261005090156.1233748-8-riana.tauro@intel.com?part=2
next prev parent reply other threads:[~2026-10-05 9:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 9:01 [PATCH v4 0/6] Add support to handle memory double-bit ecc errors Riana Tauro
2026-10-05 9:01 ` [PATCH v4 1/6] drm/xe: Separate drm-ras netlink data from device and firmware RAS state Riana Tauro
2026-10-05 11:02 ` Upadhyay, Tejas
2026-10-05 9:01 ` [PATCH v4 2/6] drm/xe/xe_ras: Handle page offline requests for device memory ecc errors Riana Tauro
2026-10-05 9:16 ` sashiko-bot [this message]
2026-10-05 13:28 ` Upadhyay, Tejas
2026-10-05 9:01 ` [PATCH v4 3/6] drm/xe/xe_ras: Add support to query page offline queue and list Riana Tauro
2026-10-05 11:29 ` Upadhyay, Tejas
2026-10-06 3:55 ` Upadhyay, Tejas
2026-10-07 5:06 ` Tauro, Riana
2026-10-05 9:02 ` [PATCH v4 4/6] drm/xe/xe_ras: Add function to get maximum pages firmware can store Riana Tauro
2026-10-05 11:32 ` Upadhyay, Tejas
2026-10-05 9:02 ` [PATCH v4 5/6] drm/xe/xe_ttm_vram: Report max_pages reported by firmware to userspace Riana Tauro
2026-10-05 9:02 ` [PATCH v4 6/6] drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates Riana Tauro
2026-10-05 11:38 ` Upadhyay, Tejas
2026-10-05 10:03 ` ✓ CI.KUnit: success for Add support to handle memory double-bit ecc errors (rev4) Patchwork
2026-10-05 10:56 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-05 15:29 ` ✗ Xe.CI.FULL: 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=20261005091605.9126E1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=riana.tauro@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