@geennaam
Thanks again. A few more ideas that may or may not help:
- Maybe try to remove -device VGA option but then you 'd need a way to get input into the guest so you may either need to pass through an additional PCI USB controller too and connect mouse/keyboard for the guest there or you can try passing thorugh only a USB device plugged in the host with -device usb-host but then you'd need to configure the host to not drive those first which may be difficult. So you could try to use -device bochs-display,romfile="" instead of -device VGA,romfile="". The reason is that bochs-display does not have legacy VGA resources that may clash with the ATI card that also has these but those are not passed through now and may not be needed but I think that's what the x-vga=on option of vfio-pci controls so maybe you can try if that makes a difference. Even though the guest drivers probably don't need legacy VGA the card BIOS may need it and could get confused by having a QEMU VGA device there. Also some BIOSes may init cards that could cause problems so may chack if there are any relevant BIOS settings in the host.
- Instead of unbinding the driver before starting QEMU it may be better to blacklist the driver to prevent it from loading at all to make sure the device is in a state it should be after power up and no driver messed with it before the guest starts. For this you may need to edit /etc/modprobe.d or /etc/udev/rules.d on the host (or wherever your distro keeps these). I don't quite know what to put in there without searching for the answer so you should do the same to find out.
- I was told before that some cards with a reset issue may need some changes in the Linux kernel to handle them, such as in the Linux kernel source "drivers/pci/quirks.c" may need
DECLARE_PCI_FIXUP_HEADER(YOURCARD_PCI_VENDOR_ID, YOURCARD_PCI_DEVICE_ID, quirk_no_bus_reset);
and/or
DECLARE_PCI_FIXUP_HEADER(YOURCARD_PCI_VENDOR_ID, YOURCARD_PCI_DEVICE_ID, quirk_no_pm_reset);
and then rebuild and reload the new kernel but first check what's there for your kernel version and graphics card already.
I don't know if any of the above could help and it could well be we're missing something about handling DMA in QEMU that I don't yet understand but if you want to keep experimenting these are the directions I'd try.