The AMD IOMMU spec is not 100% clear if a device table entry with V=1
but TV=0 implies that DMA requests from that device are blocked. Play
safe and use the pattern that Linux uses as well: TV=1, Mode=0 and IW as
well as IR cleared.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
return;
/*
- * Clear DTE_TRANSLATION_VALID, but keep the entry valid
- * to block any DMA requests.
+ * Set Mode to 0 (translation disabled) and clear IR and IW to block
+ * DMA requests until the entry is reprogrammed for its new owner.
*/
- dte->raw64[0] = DTE_VALID;
+ dte->raw64[0] = DTE_VALID | DTE_TRANSLATION_VALID;
/* Flush caches, just to be sure. */
arch_paging_flush_cpu_caches(dte, sizeof(*dte));