From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"kernel test robot" <lkp@intel.com>
Subject: [PATCH] drm/xe: Work around a loongarch clang error report
Date: Wed, 10 Sep 2025 18:11:22 +0200 [thread overview]
Message-ID: <20250910161122.103584-1-thomas.hellstrom@linux.intel.com> (raw)
There seems to be a problem with the clang loongarch compiler in
that it confuses instruction pointer reads if there are more than
one per function. So break one out to a separate function
(The one in xe_validation_guard()).
Fixes: 59eabff2a352 ("drm/xe: Convert xe_bo_create_pin_map() for exhaustive eviction")
Cc: Matthew Brost <matthew.brost@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509101853.nDmyxTEM-lkp@intel.com/
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
Sending out this patch in case we need a quick fix. But if this is
indeed a compiler error we shouln't hide it by merging this.
---
drivers/gpu/drm/xe/xe_migrate.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 6fad5d469629..1d667fa36cf3 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -394,6 +394,24 @@ struct xe_migrate *xe_migrate_alloc(struct xe_tile *tile)
return m;
}
+static int xe_migrate_lock_prepare_vm(struct xe_tile *tile, struct xe_migrate *m, struct xe_vm *vm)
+{
+ struct xe_device *xe = tile_to_xe(tile);
+ struct xe_validation_ctx ctx;
+ struct drm_exec exec;
+ int err = 0;
+
+ xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
+ err = xe_vm_drm_exec_lock(vm, &exec);
+ drm_exec_retry_on_contention(&exec);
+ err = xe_migrate_prepare_vm(tile, m, vm, &exec);
+ drm_exec_retry_on_contention(&exec);
+ xe_validation_retry_on_oom(&ctx, &err);
+ }
+
+ return err;
+}
+
/**
* xe_migrate_init() - Initialize a migrate context
* @m: The migration context
@@ -405,8 +423,6 @@ int xe_migrate_init(struct xe_migrate *m)
struct xe_tile *tile = m->tile;
struct xe_gt *primary_gt = tile->primary_gt;
struct xe_device *xe = tile_to_xe(tile);
- struct xe_validation_ctx ctx;
- struct drm_exec exec;
struct xe_vm *vm;
int err;
@@ -416,14 +432,7 @@ int xe_migrate_init(struct xe_migrate *m)
if (IS_ERR(vm))
return PTR_ERR(vm);
- err = 0;
- xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
- err = xe_vm_drm_exec_lock(vm, &exec);
- drm_exec_retry_on_contention(&exec);
- err = xe_migrate_prepare_vm(tile, m, vm, &exec);
- drm_exec_retry_on_contention(&exec);
- xe_validation_retry_on_oom(&ctx, &err);
- }
+ err = xe_migrate_lock_prepare_vm(tile, m, vm);
if (err)
return err;
--
2.51.0
next reply other threads:[~2025-09-10 16:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 16:11 Thomas Hellström [this message]
2025-09-10 17:08 ` ✓ CI.KUnit: success for drm/xe: Work around a loongarch clang error report Patchwork
2025-09-10 17:41 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-11 0:29 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-11 14:35 ` [PATCH] " Lucas De Marchi
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=20250910161122.103584-1-thomas.hellstrom@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lkp@intel.com \
--cc=matthew.brost@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.