MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dmar_inv_iotlb_glob

Function dmar_inv_iotlb_glob

freebsd/x86/iommu/intel_utils.c:453–468  ·  view source on GitHub ↗

* Globally invalidate the IOTLB, busily waiting for the completion. */

Source from the content-addressed store, hash-verified

451 * Globally invalidate the IOTLB, busily waiting for the completion.
452 */
453int
454dmar_inv_iotlb_glob(struct dmar_unit *unit)
455{
456 int error, reg;
457
458 DMAR_ASSERT_LOCKED(unit);
459 KASSERT(!unit->qi_enabled, ("QI enabled"));
460
461 reg = 16 * DMAR_ECAP_IRO(unit->hw_ecap);
462 /* See a comment about DMAR_CCMD_ICC in dmar_inv_ctx_glob. */
463 dmar_write8(unit, reg + DMAR_IOTLB_REG_OFF, DMAR_IOTLB_IVT |
464 DMAR_IOTLB_IIRG_GLB | DMAR_IOTLB_DR | DMAR_IOTLB_DW);
465 DMAR_WAIT_UNTIL(((dmar_read4(unit, reg + DMAR_IOTLB_REG_OFF + 4) &
466 DMAR_IOTLB_IVT32) == 0));
467 return (error);
468}
469
470/*
471 * Flush the chipset write buffers. See 11.1 "Write Buffer Flushing"

Callers 3

dmar_flush_for_ctx_entryFunction · 0.85
dmar_free_ctx_lockedFunction · 0.85
dmar_attachFunction · 0.85

Calls 2

dmar_write8Function · 0.85
dmar_read4Function · 0.85

Tested by

no test coverage detected