From: sashiko-bot@kernel.org
To: "Riana Tauro" <riana.tauro@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 6/6] drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates
Date: Mon, 07 Sep 2026 10:02:12 +0000 [thread overview]
Message-ID: <20260907100212.CB81E1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260907094706.1407436-14-riana.tauro@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect bit shift used to calculate XArray index for device physical addresses.
--
commit cb65d57e28d4e4a8f1d6464c1a918d7392d5e460
Author: Riana Tauro <riana.tauro@intel.com>
drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates
This commit introduces tracking for pages successfully offlined by the
firmware using an XArray. This prevents the memory scrubber from issuing
redundant page offline requests for the same address.
> 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
[ ... ]
> @@ -244,11 +248,16 @@ static int send_page_offline_cmd(struct xe_device *xe, u64 page_address,
> return ret;
> }
>
> + if (action == XE_RAS_PAGE_ACTION_OFFLINE)
> + xa_store(&state->offlined_pages, page_address >> PAGE_SHIFT,
> + XE_RAS_PAGE_OFFLINED, GFP_KERNEL);
[Severity: High]
Does this code use the correct page shift for device physical addresses?
PAGE_SHIFT is the host's page shift, which could be 64K depending on the
kernel build, whereas the device page size is likely 4K. If the host uses 64K
pages, shifting by PAGE_SHIFT would truncate the lower bits of the device
address, causing multiple distinct 4K device pages to hash to the exact same
XArray index.
> +
> return ret;
> }
>
> static int handle_page_offline(struct xe_device *xe, u64 page_address, bool send_cmd)
> {
> + struct xe_ras_state *state = &xe->ras.state;
> enum xe_ras_page_action action;
> int ret = 0;
>
[ ... ]
> @@ -288,7 +297,11 @@ static int handle_page_offline(struct xe_device *xe, u64 page_address, bool send
> "Physical page address belongs to critical BO: 0x%llx\n", page_address);
> return ret;
> case -EEXIST:
> - action = XE_RAS_PAGE_ACTION_OFFLINE;
> + if (xa_load(&state->offlined_pages, page_address >> PAGE_SHIFT))
[Severity: High]
Will this check cause false positives on non-4K kernel page builds?
If a hardware memory error occurs on a different 4K device page that falls
within the same 64K host page as a previously offlined page, this lookup
will find the existing entry. The driver might then mistakenly conclude this
specific device page is already offlined and skip sending the command to the
firmware.
> + action = XE_RAS_PAGE_ACTION_DECLINE;
> + else
> + action = XE_RAS_PAGE_ACTION_OFFLINE;
> +
> xe_log_err(xe, DEVICE_MEMORY, ret,
> "Double-bit ECC error detected at physical address 0x%llx, page already software offlined\n",
> page_address);
[ ... ]
> @@ -410,8 +423,11 @@ static void get_offlined_list(struct xe_device *xe)
> return;
> }
>
> - for (i = 0; i < response.pages_returned && i < XE_RAS_NUM_PAGES; i++)
> + for (i = 0; i < response.pages_returned && i < XE_RAS_NUM_PAGES; i++) {
> handle_page_offline(xe, response.page_addresses[i], false);
> + xa_store(&state->offlined_pages, response.page_addresses[i] >> PAGE_SHIFT,
> + XE_RAS_PAGE_OFFLINED, GFP_KERNEL);
[Severity: High]
Could this initialization also suffer from the same device vs. host page shift
mismatch?
Using PAGE_SHIFT here would populate the cache with indices that may group
multiple device pages into a single host page index.
> + }
>
> if (!state->max_pages)
> state->max_pages = response.max_entries;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907094706.1407436-8-riana.tauro@intel.com?part=6
next prev parent reply other threads:[~2026-09-07 10:02 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
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 [this message]
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=20260907100212.CB81E1F00A3D@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;
as well as URLs for NNTP newsgroup(s).