Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lis, Tomasz" <tomasz.lis@intel.com>
To: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v5 8/8] drm/xe/vf: Refresh utilization buffer during migration recovery
Date: Fri, 13 Jun 2025 20:05:17 +0200	[thread overview]
Message-ID: <ca47e8f5-aaf4-44ae-a09e-d938f367848a@intel.com> (raw)
In-Reply-To: <20250612102449.1412058-9-tomasz.lis@intel.com>

This patch is now invalid as it uses setup_wa_bb() which calls kmalloc().

We try to avoid kmalloc() during post-migration recovery, so will have 
to develop a different way of fixing WA BB.

Currently calling that would lead to a deadlock possibility (and even if 
we've solved that somehow, possibility for fixups apply to fail).

-Tomasz

On 12.06.2025 12:24, Tomasz Lis wrote:
> The WA buffer we use to capture context utilization contains GGTT
> references. This means its instructions have to be either fixed or
> re-emitted during VF post-migration recovery.
>
> This patch adds re-emitting content of the utilization WA BB during
> the recovery.
>
> Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Michal Winiarski <michal.winiarski@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_exec_queue.c |  1 +
>   drivers/gpu/drm/xe/xe_lrc.c        | 10 ++++++++--
>   drivers/gpu/drm/xe/xe_lrc.h        |  1 +
>   3 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
> index d5ffb550bde7..dc2bcda1d636 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue.c
> +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
> @@ -1041,6 +1041,7 @@ void xe_exec_queue_contexts_hwsp_rebase(struct xe_exec_queue *q)
>   	for (i = 0; i < q->width; ++i) {
>   		xe_lrc_update_memirq_regs_with_address(q->lrc[i], q->hwe);
>   		xe_lrc_update_hwctx_regs_with_address(q->lrc[i]);
> +		xe_lrc_setup_wa_bb(q->lrc[i], q->hwe);
>   	}
>   }
>   
> diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
> index 8b08c416ccf0..9f3331779dae 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.c
> +++ b/drivers/gpu/drm/xe/xe_lrc.c
> @@ -1011,7 +1011,13 @@ struct wa_bb_setup {
>   			 u32 *batch, size_t max_size);
>   };
>   
> -static int setup_wa_bb(struct xe_lrc *lrc, struct xe_hw_engine *hwe)
> +/**
> + * xe_lrc_setup_wa_bb - Execute all wa bb setup callbacks.
> + * @lrc: the &xe_lrc struct instance
> + * @hwe: the &xe_hw_engine struct instance
> + * Return: 0 on success, negative error code on failure
> + */
> +int xe_lrc_setup_wa_bb(struct xe_lrc *lrc, struct xe_hw_engine *hwe)
>   {
>   	const size_t max_size = lrc->bb_per_ctx_bo->size;
>   	static const struct wa_bb_setup funcs[] = {
> @@ -1218,7 +1224,7 @@ static int xe_lrc_init(struct xe_lrc *lrc, struct xe_hw_engine *hwe,
>   	map = __xe_lrc_start_seqno_map(lrc);
>   	xe_map_write32(lrc_to_xe(lrc), &map, lrc->fence_ctx.next_seqno - 1);
>   
> -	err = setup_wa_bb(lrc, hwe);
> +	err = xe_lrc_setup_wa_bb(lrc, hwe);
>   	if (err)
>   		goto err_lrc_finish;
>   
> diff --git a/drivers/gpu/drm/xe/xe_lrc.h b/drivers/gpu/drm/xe/xe_lrc.h
> index 801a6b943f6e..8f05620fc0f0 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.h
> +++ b/drivers/gpu/drm/xe/xe_lrc.h
> @@ -127,6 +127,7 @@ u32 xe_lrc_ctx_timestamp_udw_ggtt_addr(struct xe_lrc *lrc);
>   u64 xe_lrc_ctx_timestamp(struct xe_lrc *lrc);
>   u32 xe_lrc_ctx_job_timestamp_ggtt_addr(struct xe_lrc *lrc);
>   u32 xe_lrc_ctx_job_timestamp(struct xe_lrc *lrc);
> +int xe_lrc_setup_wa_bb(struct xe_lrc *lrc, struct xe_hw_engine *hwe);
>   
>   /**
>    * xe_lrc_update_timestamp - readout LRC timestamp and update cached value

  reply	other threads:[~2025-06-13 18:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 10:24 [PATCH v5 0/8] drm/xe/vf: Post-migration recovery of queues and jobs Tomasz Lis
2025-06-12 10:24 ` [PATCH v5 1/8] drm/xe/sa: Avoid caching GGTT address within the manager Tomasz Lis
2025-06-12 10:24 ` [PATCH v5 2/8] drm/xe/vf: Skip fixups on migration before getting GGTT info Tomasz Lis
2025-06-12 10:24 ` [PATCH v5 3/8] drm/xe/vf: Pause submissions during RESFIX fixups Tomasz Lis
2025-06-12 10:24 ` [PATCH v5 4/8] drm/xe: Block reset while recovering from VF migration Tomasz Lis
2025-06-12 10:24 ` [PATCH v5 5/8] drm/xe/vf: Rebase HWSP of all contexts after migration Tomasz Lis
2025-06-12 10:24 ` [PATCH v5 6/8] drm/xe/vf: Rebase MEMIRQ structures for " Tomasz Lis
2025-06-12 10:24 ` [PATCH v5 7/8] drm/xe/vf: Post migration, repopulate ring area for pending request Tomasz Lis
2025-06-12 10:24 ` [PATCH v5 8/8] drm/xe/vf: Refresh utilization buffer during migration recovery Tomasz Lis
2025-06-13 18:05   ` Lis, Tomasz [this message]
2025-06-12 11:14 ` ✓ CI.KUnit: success for drm/xe/vf: Post-migration recovery of queues and jobs (rev5) Patchwork
2025-06-12 11:50 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-12 23:22 ` ✓ 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=ca47e8f5-aaf4-44ae-a09e-d938f367848a@intel.com \
    --to=tomasz.lis@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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