Hi Alex,
The INTx/MSI part needs further definition for the user. Are we actually completely tearing down interrupts with the expectation that the user will re-enable them or are we just masking them such that the user needs to unmask? Also note that not all devices support DisINTx.
After reset, the "Bus Master Enable" bit of "Command Register" should be cleared, so MSI/MSI- X interrupt Messages is still disabled. After reset, the "Interrupt Disable" bit of "Command Register" should be cleared, so INTx interrupts is enabled. If the device doesn't support INTx, "Interrupt Disable" bit will hardware to 0, it is OK here. After fatal-error occurs, the user should reset the device and reinitialize the device. So I disable the interrupt before host reset the device, and let user to do the reinitialization.
Otherwise it seems like a reasonable approach, but I can't guarantee we won't find new issues along the way. For instance we'll need to test how -EAGAIN returns interact with existing QEMU and maybe decided whether there are cases that are better handled by doing an interruptible wait. Thanks,
I will dig into it. Sincerely Zhou Jie