From: Matthew Brost <matthew.brost@intel.com>
To: Tejas Upadhyay <tejas.upadhyay@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <himal.prasad.ghimiray@intel.com>
Subject: Re: [PATCH] drm/xe: Skip clearing purged page-table BOs
Date: Fri, 4 Sep 2026 10:33:11 -0700 [thread overview]
Message-ID: <apsA10Y3sCF8zQqL@gsse-cloud1.jf.intel.com> (raw)
In-Reply-To: <20260904122121.806122-2-tejas.upadhyay@intel.com>
On Fri, Sep 04, 2026 at 05:51:22PM +0530, Tejas Upadhyay wrote:
> VRAM page offlining can clear a page-table BO's vmap before VM teardown
> calls xe_pt_clear(). Check for a purged BO under its dma-resv lock before
> writing to the mapping.
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> ---
> drivers/gpu/drm/xe/xe_pt.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> index 5d990c1c3740..23bc74ba02cb 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -236,9 +236,12 @@ void xe_pt_destroy(struct xe_pt *pt, u32 flags, struct llist_head *deferred)
> */
> void xe_pt_clear(struct xe_device *xe, struct xe_pt *pt)
> {
> - struct iosys_map *map = &pt->bo->vmap;
> + struct xe_bo *bo = pt->bo;
>
> - xe_map_memset(xe, map, 0, 0, SZ_4K);
> + xe_bo_lock(bo, false);
> + if (!xe_bo_is_purged(bo))
> + xe_map_memset(xe, &bo->vmap, 0, 0, SZ_4K);
> + xe_bo_unlock(bo);
You have inverted the notifier lock and dma-resv [1].
The PT's dma-resv is the VM's dma-resv, so in xe_vm_close take this
before the notifier lock and drop the lock here.
For full clarity - assert dma-resv is held here via xe_bo_assert_held.
Matt
[1] https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-173375v1/bat-nvls-1/igt@xe_compute@compute-square.html
> }
>
> /**
> --
> 2.52.0
>
next prev parent reply other threads:[~2026-09-04 17:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 12:21 [PATCH] drm/xe: Skip clearing purged page-table BOs Tejas Upadhyay
2026-09-04 12:29 ` ✓ CI.KUnit: success for " Patchwork
2026-09-04 12:40 ` [PATCH] " sashiko-bot
2026-09-04 22:54 ` Matthew Brost
2026-09-04 13:03 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-09-04 17:33 ` Matthew Brost [this message]
2026-09-04 22:10 ` ✓ Xe.CI.FULL: success " 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=apsA10Y3sCF8zQqL@gsse-cloud1.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--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 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.