All of 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 5/5] drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates
Date: Tue, 25 Aug 2026 06:52:36 +0000	[thread overview]
Message-ID: <20260825065236.B67211F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825063615.3697317-12-riana.tauro@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Using PAGE_SHIFT instead of a GPU-specific page shift causes multiple 4KB GPU pages to map to the same XArray index on systems with larger CPU pages.
--

--- Patch [5]: [PATCH 5/5] drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates ---
commit a03c3279356ffe1e7132d6c4d017e5f44ae3cc0b
Author: Riana Tauro <riana.tauro@intel.com>

drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates

This commit adds an XArray to track pages that have been offlined by the
firmware to prevent issuing redundant page offline requests for the same
memory address.

> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 5303d1a4e485a..f0dac06f050b9 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c

[ ... ]

> @@ -244,6 +248,10 @@ static int send_page_offline_cmd(struct xe_device *xe, u64 page_address,
>  		return ret;
>  	}
>  
> +	if (action == XE_RAS_PAGE_ACTION_OFFLINE)
> +		xa_store(&ras->offlined_pages, page_address >> PAGE_SHIFT,
> +			 XE_RAS_PAGE_OFFLINED, GFP_KERNEL);
> +
>  	return ret;
>  }

[Severity: High]
Does using PAGE_SHIFT here cause aliasing on systems with larger CPU page
sizes?

If the CPU page size is larger than the GPU page size (for example, 64KB on
ARM64 vs 4KB XE_PAGE_SIZE), shifting by PAGE_SHIFT will truncate the lower
bits of the GPU physical address. This would cause multiple distinct 4KB GPU
pages to map to the exact same XArray index. Should this use a GPU-specific
page shift instead?

> @@ -287,7 +295,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(&xe->ras.offlined_pages, page_address >> PAGE_SHIFT))
> +			action = XE_RAS_PAGE_ACTION_DECLINE;
> +		else
> +			action = XE_RAS_PAGE_ACTION_OFFLINE;
> +

[Severity: High]
If aliasing occurs due to PAGE_SHIFT on 64KB CPU page architectures, could
this xa_load() falsely return a match?

If a subsequent ECC error occurs in a different 4KB GPU page but within the
same 64KB CPU page block, it appears this would return a false match. The
driver would then incorrectly decline the firmware's request to offline the
second page, allowing the system to continue using poisoned memory.

[ ... ]

> @@ -409,8 +421,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(&ras->offlined_pages, response.page_addresses[i] >> PAGE_SHIFT,
> +				 XE_RAS_PAGE_OFFLINED, GFP_KERNEL);
> +		}

[Severity: High]
Similarly, syncing the initial list of offlined pages from firmware uses
PAGE_SHIFT here, which might suffer from the same address truncation issue.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260825063615.3697317-7-riana.tauro@intel.com?part=5

  reply	other threads:[~2026-08-25  6:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25  6:36 [PATCH 0/5] Add support to handle memory double-bit ecc errors Riana Tauro
2026-08-25  6:36 ` [PATCH 1/5] drm/xe/xe_drm_ras: Rename ras to drm_ras in xe_device Riana Tauro
2026-08-25  6:46   ` sashiko-bot
2026-08-28 15:13   ` Rodrigo Vivi
2026-09-04 10:31     ` Tauro, Riana
2026-08-25  6:36 ` [RFC PATCH 2/5] drm/xe/xe_ras: Handle page offline requests for device memory ecc errors Riana Tauro
2026-08-25  6:49   ` sashiko-bot
2026-09-02  6:30   ` Mallesh, Koujalagi
2026-09-04 10:40     ` Tauro, Riana
2026-09-04 12:55       ` Mallesh, Koujalagi
2026-09-02 16:11   ` Michal Wajdeczko
     [not found]     ` <SJ2PR11MB7619EA09682C7DE8C0A603128CB22@SJ2PR11MB7619.namprd11.prod.outlook.com>
2026-09-07  6:31       ` FW: " Tauro, Riana
2026-09-07 12:23         ` Michal Wajdeczko
2026-09-07 13:40           ` Tauro, Riana
2026-08-25  6:36 ` [PATCH 3/5] drm/xe/xe_ras: Add support to query page offline queue and list Riana Tauro
2026-08-25  6:50   ` sashiko-bot
2026-09-02  9:56   ` Mallesh, Koujalagi
2026-09-04 10:49     ` Tauro, Riana
2026-08-25  6:36 ` [PATCH 4/5] drm/xe/xe_ras: Add function to get maximum pages firmware can store Riana Tauro
2026-08-25  6:36 ` [PATCH 5/5] drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates Riana Tauro
2026-08-25  6:52   ` sashiko-bot [this message]
2026-08-25  9:19 ` ✓ CI.KUnit: success for Add support to handle memory double-bit ecc errors Patchwork
2026-08-25  9:57 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-08-25 14:29 ` ✗ Xe.CI.FULL: " Patchwork
2026-08-28 15:15 ` [PATCH 0/5] " Rodrigo Vivi

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=20260825065236.B67211F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.