Implement Drop for vfio_sys Device, unmapping msix for interrupts.#79
Implement Drop for vfio_sys Device, unmapping msix for interrupts.#79erfrimod wants to merge 2 commits into
Conversation
|
It looks to me like Linux should already do this when the device is closed. Are we leaking the device fd somehow? |
I don't believe the fd gets leaked. But without this Drop implementation, there is no code to tell the VFIO device 'unmap_interrupt' / VFIO_IRQ_SET_DATA_NONE. |
|
When the fd gets closed, the kernel does VFIO_IRQ_SET_DATA_NONE internally. |
|
The failure occurs in the retry case. There is logic to perform an FLR and try again to create a hardware channel if the first try was not successful (for example if initial commands time out). Are we not closing the fd before the retry case and thus necessitating this interrupt unmapping? |
|
@erfrimod - what's the status of this change? |
|
We still observed a problem with the retry even with these changes. Back to the drawing bord. |
GDMA Driver allocates the HWC device interrupt in the new() method. However, there are multiple potential error paths that can result in retries. Any failure in new() causes the interrupt to leak, resulting in the HWC interrupt not getting unmapped. GDMA::New() can then fail on retry due to missing first response as a result of the leaked interrupt.
Log messages from a lab machine where I force a panic, causing calls to drop() -> map_msix()
In FHR scenarios, the GDMA::new() can fail due to missing the first response as a result of a leaked interrupt.
Log messages from a lab machine where I perform UH servicing (FHR)