Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Riana Tauro" <riana.tauro@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 2/6] drm/xe/xe_ras: Add support to query page offline queue and list
Date: Mon, 07 Sep 2026 10:00:36 +0000	[thread overview]
Message-ID: <20260907100036.7FBD91F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907094706.1407436-10-riana.tauro@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Spurious failure if firmware page offline queue or list grows during readout.
--

commit ecb51c4744892bd663ca44008b7aac2eca7280e9
Author: Riana Tauro <riana.tauro@intel.com>
Subject: drm/xe/xe_ras: Add support to query page offline queue and list

This commit adds support to query the page offline list and queue from the
firmware during module load. The command retrieves pages that are already
offlined or pending to be offlined by the firmware.

> 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
[ ... ]
> +static void get_queued_pages(struct xe_device *xe)
> +{
[ ... ]
> +	do {
> +		memset(&response, 0, sizeof(response));
> +
> +		ret = xe_sysctrl_send_command(&xe->sc, &command, &rlen);
[ ... ]
> +		count += response.pages_returned;
> +		if (!response.pages_returned)
> +			break;
> +
> +		if (!total_pages)
> +			total_pages = response.total_pages;
> +
> +		if (count > total_pages) {
> +			xe_log_err(xe, SYSCTRL, -EINVAL,

[Severity: Medium]
If a memory RAS error occurs during the window when xe_ras_init() is querying
the offline queue, causing the firmware to append to the queue while the
driver is iterating, can this cause a spurious failure?

Since total_pages is latched on the first response and strictly enforced
against the growing count over multiple responses, it looks like an actively
growing queue could cause count to exceed total_pages, aborting the
initialization of offlined pages and leaving the RAS offline state incomplete.

> +				   "Pages returned from queue exceed total pages %u, returned %u\n",
> +				   total_pages, count);
> +			return;
> +		}
> +	} while (response.additional_data);
> +}
> +
> +static void get_offlined_list(struct xe_device *xe)
> +{
[ ... ]
> +	do {
> +		memset(&response, 0, sizeof(response));
> +		request.index = count;
> +
> +		ret = xe_sysctrl_send_command(&xe->sc, &command, &rlen);
[ ... ]
> +		count += response.pages_returned;
> +		if (!response.pages_returned)
> +			break;
> +
> +		if (!total_pages)
> +			total_pages = response.total_pages;
> +
> +		if (count > total_pages) {
> +			xe_log_err(xe, SYSCTRL, -EINVAL,

[Severity: Medium]
Does the same vulnerability apply here in get_offlined_list() if new pages are
offlined concurrently by the firmware?

If the list grows while reading, enforcing the originally latched total_pages
against the total returned count could similarly result in a spurious error
and abort the list iteration.

> +				   "Pages returned from list exceed total pages %u, returned %u\n",
> +				   total_pages, count);
> +			return;
> +		}
> +	} while (response.additional_data);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907094706.1407436-8-riana.tauro@intel.com?part=2

  reply	other threads:[~2026-09-07 10:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  9:47 [PATCH v2 0/6] Add support to handle memory double-bit ecc errors Riana Tauro
2026-09-07  9:47 ` [PATCH v2 1/6] drm/xe/xe_ras: Handle page offline requests for device memory " Riana Tauro
2026-09-07 10:14   ` sashiko-bot
2026-09-07 17:35   ` Ghimiray, Himal Prasad
2026-09-11  6:45     ` Tauro, Riana
2026-09-07  9:47 ` [PATCH v2 2/6] drm/xe/xe_ras: Add support to query page offline queue and list Riana Tauro
2026-09-07 10:00   ` sashiko-bot [this message]
2026-09-07 18:25   ` Ghimiray, Himal Prasad
2026-09-11  6:11     ` Tauro, Riana
2026-09-11  6:39       ` Ghimiray, Himal Prasad
2026-09-07  9:47 ` [PATCH v2 3/6] drm/xe: Separate drm-ras netlink data from device and firmware RAS state Riana Tauro
2026-09-07 19:04   ` Ghimiray, Himal Prasad
2026-09-07 19:21     ` Ghimiray, Himal Prasad
2026-09-09  5:43       ` Tauro, Riana
2026-09-07  9:47 ` [PATCH v2 4/6] drm/xe/xe_ras: Add function to get maximum pages firmware can store Riana Tauro
2026-09-07 19:21   ` Ghimiray, Himal Prasad
2026-09-07 19:24     ` Ghimiray, Himal Prasad
2026-09-09  5:23       ` Tauro, Riana
2026-09-07  9:47 ` [PATCH v2 5/6] drm/xe/xe_ttm_vram: Report max_pages reported by firmware in debugfs Riana Tauro
2026-09-07 19:26   ` Ghimiray, Himal Prasad
2026-09-07  9:47 ` [PATCH v2 6/6] drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates Riana Tauro
2026-09-07 10:02   ` sashiko-bot
2026-09-07 11:01 ` ✓ CI.KUnit: success for Add support to handle memory double-bit ecc errors (rev2) Patchwork
2026-09-07 11:45 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-07 13:41 ` ✓ Xe.CI.FULL: " 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=20260907100036.7FBD91F00A3A@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