KMDF DMA remapping: supported isolation and common-buffer lifetime after device failure
I am developing an experimental KMDF PCI device driver for Windows 11 x64. Device DMA publication remains disabled while I establish a supported failure-cleanup design.
The intended design uses WdfDmaEnablerCreate and WdfCommonBufferCreate. The unresolved case is fatal failure or surprise removal where device registers may be inaccessible and the driver cannot confirm that the hardware has stopped DMA.
Could someone clarify the documented Windows contract for:
- Whether a KMDF driver may use the DMA_OPERATIONS domain APIs through the adapter returned by WdfDmaEnablerWdmGetDmaAdapter while using WDF common buffers, and which component owns the domain and mappings.
- Whether any supported operation/completion guarantees both that further device DMA is blocked and that previously issued transactions can no longer reach the backing memory before it is reclaimed. Is this guaranteed by common-buffer deletion under DMA remapping, or must the driver first establish hardware quiescence?
- Whether retaining WDF object references can preserve the actual common-buffer backing and DMA mappings across device cleanup/removal, rather than only delaying object destruction.
I am not assuming that unmapping or an IOMMU TLB flush drains outstanding transactions. I am also not proposing direct writes to OS-owned PCI configuration registers.
A reference to the applicable contract, or confirmation that this failure model requires device/platform-specific containment, would help determine whether the design is viable.