From: Tomasz Lis <tomasz.lis@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Michał Winiarski" <michal.winiarski@intel.com>,
"Michał Wajdeczko" <michal.wajdeczko@intel.com>,
"Piotr Piórkowski" <piotr.piorkowski@intel.com>,
"Matthew Brost" <matthew.brost@intel.com>
Subject: [PATCH v3 3/4] drm/xe/vf: Wait for all fixups before using default LRCs
Date: Thu, 26 Feb 2026 00:54:46 +0100 [thread overview]
Message-ID: <20260225235447.2772383-4-tomasz.lis@intel.com> (raw)
In-Reply-To: <20260225235447.2772383-1-tomasz.lis@intel.com>
When a context is being created during save/restore, the LRC creation
needs to wait for GGTT address space to be shifted. But it also needs
to have fixed default LRCs. This is mandatory to avoid the situation
where LRC will be created based on data from before the fixups, but
reference within exec queue will be set too late for fixups.
This fixes an issue where contexts created during save/restore have
a large chance of having one unfixed LRC, due to the xe_lrc_create()
being synced for equal start to race with default LRC fixups.
v2: Move the fixups confirmation further, behind all fixups.
Revert some renames.
Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
---
drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 16 +++++++++-------
drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h | 2 +-
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
index 527ded3c9c22..7f83c0d3b099 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
@@ -536,12 +536,6 @@ static int vf_get_ggtt_info(struct xe_gt *gt)
*/
xe_ggtt_shift_nodes(tile->mem.ggtt, start);
- if (xe_sriov_vf_migration_supported(gt_to_xe(gt))) {
- WRITE_ONCE(gt->sriov.vf.migration.ggtt_need_fixes, false);
- smp_wmb(); /* Ensure above write visible before wake */
- wake_up_all(>->sriov.vf.migration.wq);
- }
-
return 0;
}
@@ -846,6 +840,13 @@ static void xe_gt_sriov_vf_default_lrcs_hwsp_rebase(struct xe_gt *gt)
xe_default_lrc_update_memirq_regs_with_address(hwe);
}
+static void vf_post_migration_mark_fixups_done(struct xe_gt *gt)
+{
+ WRITE_ONCE(gt->sriov.vf.migration.ggtt_need_fixes, false);
+ smp_wmb(); /* Ensure above write visible before wake */
+ wake_up_all(>->sriov.vf.migration.wq);
+}
+
static void vf_start_migration_recovery(struct xe_gt *gt)
{
bool started;
@@ -1380,6 +1381,7 @@ static void vf_post_migration_recovery(struct xe_gt *gt)
if (err)
goto fail;
+ vf_post_migration_mark_fixups_done(gt);
vf_post_migration_rearm(gt);
err = vf_post_migration_resfix_done(gt, marker);
@@ -1514,7 +1516,7 @@ static bool vf_valid_ggtt(struct xe_gt *gt)
}
/**
- * xe_gt_sriov_vf_wait_valid_ggtt() - VF wait for valid GGTT addresses
+ * xe_gt_sriov_vf_wait_valid_ggtt() - wait for valid GGTT nodes and address refs
* @gt: the &xe_gt
*/
void xe_gt_sriov_vf_wait_valid_ggtt(struct xe_gt *gt)
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h b/drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h
index 4ef881b9b662..fca18be589db 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h
@@ -73,7 +73,7 @@ struct xe_gt_sriov_vf_migration {
bool recovery_queued;
/** @recovery_inprogress: VF post migration recovery in progress */
bool recovery_inprogress;
- /** @ggtt_need_fixes: VF GGTT needs fixes */
+ /** @ggtt_need_fixes: VF GGTT and references to it need fixes */
bool ggtt_need_fixes;
};
--
2.25.1
next prev parent reply other threads:[~2026-02-25 23:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 23:54 [PATCH v3 0/4] drm/xe/vf: Fix exec queue creation during post-migration recovery Tomasz Lis
2026-02-25 23:54 ` [PATCH v3 1/4] drm/xe/queue: Call fini on exec queue creation fail Tomasz Lis
2026-02-25 23:54 ` [PATCH v3 2/4] drm/xe/queue: Wrappers for setting and getting LRC references Tomasz Lis
2026-02-26 1:42 ` Matthew Brost
2026-02-26 1:57 ` Matthew Brost
2026-02-26 17:26 ` Lis, Tomasz
2026-02-26 17:30 ` Matthew Brost
2026-02-25 23:54 ` Tomasz Lis [this message]
2026-02-25 23:54 ` [PATCH v3 4/4] drm/xe/vf: Redo LRC creation while in VF fixups Tomasz Lis
2026-02-26 1:49 ` Matthew Brost
2026-02-26 1:24 ` ✓ CI.KUnit: success for drm/xe/vf: Fix exec queue creation during post-migration recovery (rev3) Patchwork
2026-02-26 2:02 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-26 6:08 ` ✗ 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=20260225235447.2772383-4-tomasz.lis@intel.com \
--to=tomasz.lis@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=michal.winiarski@intel.com \
--cc=piotr.piorkowski@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