Skip to content

Commit 6a91af2

Browse files
matt-auldlucasdemarchi
authored andcommitted
drm/xe/migrate: don't misalign current bytes
If current bytes exceeds the max copy size, ensure the clamped size still accounts for the XE_CACHELINE_BYTES alignment, otherwise we trigger the assert in xe_migrate_vram with the size now being out of alignment. Fixes: 8c2d61e ("drm/xe/migrate: don't overflow max copy size") Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6212 Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Stuart Summers <stuart.summers@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://lore.kernel.org/r/20251010162020.190962-2-matthew.auld@intel.com (cherry picked from commit 641bcf8731d21b56760e3646a39a65f471e9efd1) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 6d36f65 commit 6a91af2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2113,7 +2113,9 @@ int xe_migrate_access_memory(struct xe_migrate *m, struct xe_bo *bo,
21132113
if (current_bytes & ~PAGE_MASK) {
21142114
int pitch = 4;
21152115

2116-
current_bytes = min_t(int, current_bytes, S16_MAX * pitch);
2116+
current_bytes = min_t(int, current_bytes,
2117+
round_down(S16_MAX * pitch,
2118+
XE_CACHELINE_BYTES));
21172119
}
21182120

21192121
__fence = xe_migrate_vram(m, current_bytes,

0 commit comments

Comments
 (0)