Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Tejas Upadhyay <tejas.upadhyay@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: <matthew.brost@intel.com>
Subject: Re: [PATCH 4/4] drm/xe: Keep VRAM fault injection within the usable range
Date: Thu, 1 Oct 2026 15:57:37 +0530	[thread overview]
Message-ID: <b85c6c08-7915-48a9-86b9-afcbd67e0f31@intel.com> (raw)
In-Reply-To: <20261001094518.1493651-10-tejas.upadhyay@intel.com>



On 01-10-2026 15:15, Tejas Upadhyay wrote:
> xe_ttm_vram_inject_fault() picked its starting address from
> vr->actual_physical_size, which includes the CCS/GSM/DSM infrastructure
> zone beyond vr->usable_size. The buddy allocator (vram_mgr->mm) only
> manages usable_size, so the first probed address can land in that
> infra zone; xe_ttm_vram_addr_to_region() then returns NULL for it and
> xe_ttm_vram_handle_addr_fault() requests an SBR instead of exercising
> page offlining.
> 
> Start the probe at usable_size - PAGE_SIZE and stay within
> usable_size so the injected fault always lands on real, buddy-managed
> VRAM.
> 
> Fixes: 6ef3eb10aea4 ("drm/xe: Add fault-inject based VRAM page offline injection")
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> index 7211ab5f66e9..ec15eab1a2ed 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> @@ -988,11 +988,12 @@ int xe_ttm_vram_inject_fault(struct xe_device *xe)
>   	struct gpu_buddy *mm = &vram_mgr->mm;
>   	u64 addr;
>   
> -	if (vr->actual_physical_size < PAGE_SIZE)
> +	/* Stay within the buddy-managed range; CCS/GSM/DSM sit beyond usable_size */
> +	if (vr->usable_size < PAGE_SIZE)
>   		return -ENOSPC;
>   
> -	addr = vr->actual_physical_size - PAGE_SIZE;
> -	while (addr < vr->actual_physical_size) {
> +	addr = vr->usable_size - PAGE_SIZE;

Nit: align addr to PAGE_SIZE

With Nit addressed
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

> +	while (addr < vr->usable_size) {
>   		struct gpu_buddy_block *block;
>   		bool found = false;
>   


  parent reply	other threads:[~2026-10-01 10:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01  9:45 [PATCH 0/4] Followup fixes for memory page offline Tejas Upadhyay
2026-10-01  9:45 ` [PATCH 1/4] drm/xe: Clean up kernel-doc typos in VRAM manager Tejas Upadhyay
2026-10-01 10:25   ` Ghimiray, Himal Prasad
2026-10-01  9:45 ` [PATCH 2/4] drm/xe: Re-validate external pin under resv lock before VRAM purge Tejas Upadhyay
2026-10-05  6:58   ` Ghimiray, Himal Prasad
2026-10-01  9:45 ` [PATCH 3/4] drm/xe: Drop RCU list handling for VRAM bad-page tracking, use mgr->lock Tejas Upadhyay
2026-10-01 10:26   ` Ghimiray, Himal Prasad
2026-10-01  9:45 ` [PATCH 4/4] drm/xe: Keep VRAM fault injection within the usable range Tejas Upadhyay
2026-10-01 10:01   ` sashiko-bot
2026-10-05  6:13     ` Upadhyay, Tejas
2026-10-01 10:27   ` Ghimiray, Himal Prasad [this message]
2026-10-01  9:53 ` ✓ CI.KUnit: success for Followup fixes for memory page offline Patchwork
2026-10-01 13:19 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-01 17:19 ` ✗ 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=b85c6c08-7915-48a9-86b9-afcbd67e0f31@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=tejas.upadhyay@intel.com \
    /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