Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'drm-xe-fixes-2026-03-26' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes

- Fix UAF in SRIOV migration restore (Winiarski)
- Updates to HW W/a (Roper)
- VMBind remap fix (Auld)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/acUgq2q2DrCUzFql@intel.com

+33 -11
+1
drivers/gpu/drm/xe/regs/xe_gt_regs.h
··· 553 553 #define ENABLE_SMP_LD_RENDER_SURFACE_CONTROL REG_BIT(44 - 32) 554 554 #define FORCE_SLM_FENCE_SCOPE_TO_TILE REG_BIT(42 - 32) 555 555 #define FORCE_UGM_FENCE_SCOPE_TO_TILE REG_BIT(41 - 32) 556 + #define L3_128B_256B_WRT_DIS REG_BIT(40 - 32) 556 557 #define MAXREQS_PER_BANK REG_GENMASK(39 - 32, 37 - 32) 557 558 #define DISABLE_128B_EVICTION_COMMAND_UDW REG_BIT(36 - 32) 558 559
+6 -6
drivers/gpu/drm/xe/xe_pt.c
··· 1442 1442 err = vma_check_userptr(vm, op->map.vma, pt_update); 1443 1443 break; 1444 1444 case DRM_GPUVA_OP_REMAP: 1445 - if (op->remap.prev) 1445 + if (op->remap.prev && !op->remap.skip_prev) 1446 1446 err = vma_check_userptr(vm, op->remap.prev, pt_update); 1447 - if (!err && op->remap.next) 1447 + if (!err && op->remap.next && !op->remap.skip_next) 1448 1448 err = vma_check_userptr(vm, op->remap.next, pt_update); 1449 1449 break; 1450 1450 case DRM_GPUVA_OP_UNMAP: ··· 2198 2198 2199 2199 err = unbind_op_prepare(tile, pt_update_ops, old); 2200 2200 2201 - if (!err && op->remap.prev) { 2201 + if (!err && op->remap.prev && !op->remap.skip_prev) { 2202 2202 err = bind_op_prepare(vm, tile, pt_update_ops, 2203 2203 op->remap.prev, false); 2204 2204 pt_update_ops->wait_vm_bookkeep = true; 2205 2205 } 2206 - if (!err && op->remap.next) { 2206 + if (!err && op->remap.next && !op->remap.skip_next) { 2207 2207 err = bind_op_prepare(vm, tile, pt_update_ops, 2208 2208 op->remap.next, false); 2209 2209 pt_update_ops->wait_vm_bookkeep = true; ··· 2428 2428 2429 2429 unbind_op_commit(vm, tile, pt_update_ops, old, fence, fence2); 2430 2430 2431 - if (op->remap.prev) 2431 + if (op->remap.prev && !op->remap.skip_prev) 2432 2432 bind_op_commit(vm, tile, pt_update_ops, op->remap.prev, 2433 2433 fence, fence2, false); 2434 - if (op->remap.next) 2434 + if (op->remap.next && !op->remap.skip_next) 2435 2435 bind_op_commit(vm, tile, pt_update_ops, op->remap.next, 2436 2436 fence, fence2, false); 2437 2437 break;
+2
drivers/gpu/drm/xe/xe_sriov_packet.c
··· 341 341 ret = xe_sriov_pf_migration_restore_produce(xe, vfid, *data); 342 342 if (ret) { 343 343 xe_sriov_packet_free(*data); 344 + *data = NULL; 345 + 344 346 return ret; 345 347 } 346 348
+18 -4
drivers/gpu/drm/xe/xe_vm.c
··· 2554 2554 if (!err && op->remap.skip_prev) { 2555 2555 op->remap.prev->tile_present = 2556 2556 tile_present; 2557 - op->remap.prev = NULL; 2558 2557 } 2559 2558 } 2560 2559 if (op->remap.next) { ··· 2563 2564 if (!err && op->remap.skip_next) { 2564 2565 op->remap.next->tile_present = 2565 2566 tile_present; 2566 - op->remap.next = NULL; 2567 2567 } 2568 2568 } 2569 2569 2570 - /* Adjust for partial unbind after removing VMA from VM */ 2570 + /* 2571 + * Adjust for partial unbind after removing VMA from VM. In case 2572 + * of unwind we might need to undo this later. 2573 + */ 2571 2574 if (!err) { 2572 2575 op->base.remap.unmap->va->va.addr = op->remap.start; 2573 2576 op->base.remap.unmap->va->va.range = op->remap.range; ··· 2688 2687 2689 2688 op->remap.start = xe_vma_start(old); 2690 2689 op->remap.range = xe_vma_size(old); 2690 + op->remap.old_start = op->remap.start; 2691 + op->remap.old_range = op->remap.range; 2691 2692 2692 2693 flags |= op->base.remap.unmap->va->flags & XE_VMA_CREATE_MASK; 2693 2694 if (op->base.remap.prev) { ··· 2838 2835 xe_svm_notifier_lock(vm); 2839 2836 vma->gpuva.flags &= ~XE_VMA_DESTROYED; 2840 2837 xe_svm_notifier_unlock(vm); 2841 - if (post_commit) 2838 + if (post_commit) { 2839 + /* 2840 + * Restore the old va range, in case of the 2841 + * prev/next skip optimisation. Otherwise what 2842 + * we re-insert here could be smaller than the 2843 + * original range. 2844 + */ 2845 + op->base.remap.unmap->va->va.addr = 2846 + op->remap.old_start; 2847 + op->base.remap.unmap->va->va.range = 2848 + op->remap.old_range; 2842 2849 xe_vm_insert_vma(vm, vma); 2850 + } 2843 2851 } 2844 2852 break; 2845 2853 }
+4
drivers/gpu/drm/xe/xe_vm_types.h
··· 373 373 u64 start; 374 374 /** @range: range of the VMA unmap */ 375 375 u64 range; 376 + /** @old_start: Original start of the VMA we unmap */ 377 + u64 old_start; 378 + /** @old_range: Original range of the VMA we unmap */ 379 + u64 old_range; 376 380 /** @skip_prev: skip prev rebind */ 377 381 bool skip_prev; 378 382 /** @skip_next: skip next rebind */
+2 -1
drivers/gpu/drm/xe/xe_wa.c
··· 247 247 LSN_DIM_Z_WGT_MASK, 248 248 LSN_LNI_WGT(1) | LSN_LNE_WGT(1) | 249 249 LSN_DIM_X_WGT(1) | LSN_DIM_Y_WGT(1) | 250 - LSN_DIM_Z_WGT(1))) 250 + LSN_DIM_Z_WGT(1)), 251 + SET(LSC_CHICKEN_BIT_0_UDW, L3_128B_256B_WRT_DIS)) 251 252 }, 252 253 253 254 /* Xe2_HPM */