/* * HW architecture suggest typical invalidation time at 40us, * with pessimistic cases up to 100us and a recommendation to * cap at 1ms. We go a bit higher just in case.
*/ #define TLB_INVAL_TIMEOUT_US 100 #define TLB_INVAL_TIMEOUT_MS 4
/* * On Xe_HP the TLB invalidation registers are located at the same MMIO offsets * but are now considered MCR registers. Since they exist within a GAM range, * the primary instance of the register rolls up the status from each unit.
*/ staticint wait_for_invalidate(struct intel_engine_cs *engine)
{ if (engine->tlb_inv.mcr) return intel_gt_mcr_wait_for_reg(engine->gt,
engine->tlb_inv.reg.mcr_reg,
engine->tlb_inv.done,
0,
TLB_INVAL_TIMEOUT_US,
TLB_INVAL_TIMEOUT_MS); else return __intel_wait_for_register_fw(engine->gt->uncore,
engine->tlb_inv.reg.reg,
engine->tlb_inv.done,
0,
TLB_INVAL_TIMEOUT_US,
TLB_INVAL_TIMEOUT_MS,
NULL);
}
for_each_engine_masked(engine, gt, awake, tmp) { if (wait_for_invalidate(engine))
gt_err_ratelimited(gt, "%s TLB invalidation did not complete in %ums!\n",
engine->name, TLB_INVAL_TIMEOUT_MS);
}
/* * Use delayed put since a) we mostly expect a flurry of TLB * invalidations so it is good to avoid paying the forcewake cost and * b) it works around a bug in Icelake which cannot cope with too rapid * transitions.
*/
intel_uncore_forcewake_put_delayed(uncore, FORCEWAKE_ALL);
}
mutex_lock(>->tlb.invalidate_lock); if (tlb_seqno_passed(gt, seqno)) goto unlock;
if (HAS_GUC_TLB_INVALIDATION(gt->i915)) { /* * Only perform GuC TLB invalidation if GuC is ready. * The only time GuC could not be ready is on GT reset, * which would clobber all the TLBs anyways, making * any TLB invalidation path here unnecessary.
*/ if (intel_guc_is_ready(guc))
intel_guc_invalidate_tlb_engines(guc);
} else {
mmio_invalidate_full(gt);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.