Skip to content

Commit f03eee5

Browse files
committed
Merge tag 'drm-xe-next-fixes-2024-05-02' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes: - Fix for a backmerge going slightly wrong. - An UAF fix - Avoid a WA error on LNL. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/ZjOijQA43zhu3SZ4@fedora
2 parents 9f9039c + 3bc8848 commit f03eee5

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

drivers/gpu/drm/xe/xe_vm.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,6 @@ static void xe_vma_destroy_late(struct xe_vma *vma)
863863
vma->ufence = NULL;
864864
}
865865

866-
if (vma->ufence) {
867-
xe_sync_ufence_put(vma->ufence);
868-
vma->ufence = NULL;
869-
}
870-
871866
if (xe_vma_is_userptr(vma)) {
872867
struct xe_userptr_vma *uvma = to_userptr_vma(vma);
873868
struct xe_userptr *userptr = &uvma->userptr;
@@ -1504,6 +1499,9 @@ static void xe_vm_free(struct drm_gpuvm *gpuvm)
15041499
/* xe_vm_close_and_put was not called? */
15051500
xe_assert(xe, !vm->size);
15061501

1502+
if (xe_vm_in_preempt_fence_mode(vm))
1503+
flush_work(&vm->preempt.rebind_work);
1504+
15071505
mutex_destroy(&vm->snap_mutex);
15081506

15091507
if (!(vm->flags & XE_VM_FLAG_MIGRATION))
@@ -2100,6 +2098,10 @@ vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_bo *bo,
21002098
struct xe_vma_op *op = gpuva_op_to_vma_op(__op);
21012099

21022100
if (__op->op == DRM_GPUVA_OP_MAP) {
2101+
op->map.immediate =
2102+
flags & DRM_XE_VM_BIND_FLAG_IMMEDIATE;
2103+
op->map.read_only =
2104+
flags & DRM_XE_VM_BIND_FLAG_READONLY;
21032105
op->map.is_null = flags & DRM_XE_VM_BIND_FLAG_NULL;
21042106
op->map.dumpable = flags & DRM_XE_VM_BIND_FLAG_DUMPABLE;
21052107
op->map.pat_index = pat_index;
@@ -2294,6 +2296,8 @@ static int vm_bind_ioctl_ops_parse(struct xe_vm *vm, struct xe_exec_queue *q,
22942296
switch (op->base.op) {
22952297
case DRM_GPUVA_OP_MAP:
22962298
{
2299+
flags |= op->map.read_only ?
2300+
VMA_CREATE_FLAG_READ_ONLY : 0;
22972301
flags |= op->map.is_null ?
22982302
VMA_CREATE_FLAG_IS_NULL : 0;
22992303
flags |= op->map.dumpable ?
@@ -2438,7 +2442,7 @@ static int op_execute(struct drm_exec *exec, struct xe_vm *vm,
24382442
case DRM_GPUVA_OP_MAP:
24392443
err = xe_vm_bind(vm, vma, op->q, xe_vma_bo(vma),
24402444
op->syncs, op->num_syncs,
2441-
!xe_vm_in_fault_mode(vm),
2445+
op->map.immediate || !xe_vm_in_fault_mode(vm),
24422446
op->flags & XE_VMA_OP_FIRST,
24432447
op->flags & XE_VMA_OP_LAST);
24442448
break;

drivers/gpu/drm/xe/xe_vm_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ struct xe_vm {
269269
struct xe_vma_op_map {
270270
/** @vma: VMA to map */
271271
struct xe_vma *vma;
272+
/** @immediate: Immediate bind */
273+
bool immediate;
274+
/** @read_only: Read only */
275+
bool read_only;
272276
/** @is_null: is NULL binding */
273277
bool is_null;
274278
/** @dumpable: whether BO is dumped on GPU hang */

drivers/gpu/drm/xe/xe_wa.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,7 @@ static const struct xe_rtp_entry_sr engine_was[] = {
449449
XE_RTP_RULES(GRAPHICS_VERSION(2004), FUNC(xe_rtp_match_first_render_or_compute)),
450450
XE_RTP_ACTIONS(SET(ROW_CHICKEN3, XE2_EUPEND_CHK_FLUSH_DIS))
451451
},
452-
{ XE_RTP_NAME("16021540221"),
453-
XE_RTP_RULES(GRAPHICS_VERSION(2004), GRAPHICS_STEP(A0, B0),
454-
FUNC(xe_rtp_match_first_render_or_compute)),
455-
XE_RTP_ACTIONS(SET(ROW_CHICKEN4, DISABLE_TDL_PUSH))
456-
},
457-
{ XE_RTP_NAME("18034896535"),
452+
{ XE_RTP_NAME("18034896535, 16021540221"), /* 16021540221: GRAPHICS_STEP(A0, B0) */
458453
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, 2004),
459454
FUNC(xe_rtp_match_first_render_or_compute)),
460455
XE_RTP_ACTIONS(SET(ROW_CHICKEN4, DISABLE_TDL_PUSH))

0 commit comments

Comments
 (0)