Skip to content

Commit fd25fa9

Browse files
tejasuplucasdemarchi
authored andcommitted
drm/xe: Dont skip TLB invalidations on VF
Skipping TLB invalidations on VF causing unrecoverable faults. Probable reason for skipping TLB invalidations on SRIOV could be lack of support for instruction MI_FLUSH_DW_STORE_INDEX. Add back TLB flush with some additional handling. Helps in resolving, [ 704.913454] xe 0000:00:02.1: [drm:pf_queue_work_func [xe]] ASID: 0 VFID: 0 PDATA: 0x0d92 Faulted Address: 0x0000000002fa0000 FaultType: 0 AccessType: 1 FaultLevel: 0 EngineClass: 3 bcs EngineInstance: 8 [ 704.913551] xe 0000:00:02.1: [drm:pf_queue_work_func [xe]] Fault response: Unsuccessful -22 V2: - Use Xmas tree (MichalW) Suggested-by: Matthew Brost <[email protected]> Fixes: 97515d0 ("drm/xe/vf: Don't emit access to Global HWSP if VF") Reviewed-by: Matthew Brost <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Tejas Upadhyay <[email protected]> (cherry picked from commit b528e89) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 347e9f5 commit fd25fa9

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

drivers/gpu/drm/xe/xe_ring_ops.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@ static int emit_bb_start(u64 batch_addr, u32 ppgtt_flag, u32 *dw, int i)
110110
return i;
111111
}
112112

113-
static int emit_flush_invalidate(u32 *dw, int i)
113+
static int emit_flush_invalidate(u32 addr, u32 val, u32 *dw, int i)
114114
{
115115
dw[i++] = MI_FLUSH_DW | MI_INVALIDATE_TLB | MI_FLUSH_DW_OP_STOREDW |
116-
MI_FLUSH_IMM_DW | MI_FLUSH_DW_STORE_INDEX;
117-
dw[i++] = LRC_PPHWSP_FLUSH_INVAL_SCRATCH_ADDR;
118-
dw[i++] = 0;
116+
MI_FLUSH_IMM_DW;
117+
118+
dw[i++] = addr | MI_FLUSH_DW_USE_GTT;
119119
dw[i++] = 0;
120+
dw[i++] = val;
120121

121122
return i;
122123
}
@@ -397,23 +398,20 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job,
397398
static void emit_migration_job_gen12(struct xe_sched_job *job,
398399
struct xe_lrc *lrc, u32 seqno)
399400
{
401+
u32 saddr = xe_lrc_start_seqno_ggtt_addr(lrc);
400402
u32 dw[MAX_JOB_SIZE_DW], i = 0;
401403

402404
i = emit_copy_timestamp(lrc, dw, i);
403405

404-
i = emit_store_imm_ggtt(xe_lrc_start_seqno_ggtt_addr(lrc),
405-
seqno, dw, i);
406+
i = emit_store_imm_ggtt(saddr, seqno, dw, i);
406407

407408
dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE; /* Enabled again below */
408409

409410
i = emit_bb_start(job->ptrs[0].batch_addr, BIT(8), dw, i);
410411

411-
if (!IS_SRIOV_VF(gt_to_xe(job->q->gt))) {
412-
/* XXX: Do we need this? Leaving for now. */
413-
dw[i++] = preparser_disable(true);
414-
i = emit_flush_invalidate(dw, i);
415-
dw[i++] = preparser_disable(false);
416-
}
412+
dw[i++] = preparser_disable(true);
413+
i = emit_flush_invalidate(saddr, seqno, dw, i);
414+
dw[i++] = preparser_disable(false);
417415

418416
i = emit_bb_start(job->ptrs[1].batch_addr, BIT(8), dw, i);
419417

0 commit comments

Comments
 (0)