FreeBSD/sys/x86/iommu/intel_utils.c
/*
 * Globally invalidate the IOTLB, busily waiting for the completion.
 */
Globally invalidate the IOTLB, busily waiting for the completion.
Globally invalidate the IOTLB busily waiting for the completion .
int
dmar_inv_iotlb_glob(struct dmar_unit *unit)
{
	int reg;
	DMAR_ASSERT_LOCKED(unit);
	KASSERT(!unit->qi_enabled, ("QI enabled"));
	reg = 16 * DMAR_ECAP_IRO(unit->hw_ecap);
	dmar_write8(unit, reg + DMAR_IOTLB_REG_OFF, DMAR_IOTLB_IVT |
	    DMAR_IOTLB_IIRG_GLB | DMAR_IOTLB_DR | DMAR_IOTLB_DW);
	while ((dmar_read4(unit, reg + DMAR_IOTLB_REG_OFF + 4) &
	    DMAR_IOTLB_IVT32) != 0)
		cpu_spinwait();
	return (0);
}
int dmar_inv_iotlb_glob ( struct dmar_unit * unit ) { int reg ; DMAR_ASSERT_LOCKED ( unit ) ; KASSERT ( ! unit -> qi_enabled , ( " " ) ) ; reg = 16 * DMAR_ECAP_IRO ( unit -> hw_ecap ) ; dmar_write8 ( unit , reg + DMAR_IOTLB_REG_OFF , DMAR_IOTLB_IVT | DMAR_IOTLB_IIRG_GLB | DMAR_IOTLB_DR | DMAR_IOTLB_DW ) ; while ( ( dmar_read4 ( unit , reg + DMAR_IOTLB_REG_OFF + 4 ) & DMAR_IOTLB_IVT32 ) != 0 ) cpu_spinwait ( ) ; return ( 0 ) ; }
Globally invalidate the IOTLB, busily waiting for the completion.
Globally invalidate the IOTLB busily waiting for the completion .
/* See a comment about DMAR_CCMD_ICC in dmar_inv_ctx_glob. */ /* XXXKIB should have a timeout */