PCI passthrough freezes qemu [solved]

Previously I had run qemu with no problems.

I was trying to set up audio , ( i just did
export QEMU_AUDIO_DRV=pa
and added -soundhw hda to the QEMU command).
But when I launched, shut down, and launched the vm again, it just froze, and QEMU completely refused to die. I left it for about 10 minutes and, out of nowhere, the process finally stopped.
I rebooted my host, when I launched the vm, it worked fine, but when I shut it down and launched it again, the same thing happened. It’s always the same, it works the first time and then stops working.
If I try to shut down the host, the monitors go blank but then nothing happens, it keeps running, and I have to use the reboot button to get any reaction.
I undid the changes I had previously made to my QEMU command, and the problem persists.
If I don’t pass through the GPU, it works just fine.

I had been using another bios for the GPU though the romfile option, to get rid of code 43, but now even when I don’t use that bios, it still works, so I’m thinking maybe the GPU bios got corrupted. However, rom-parser outputs the same as it did before I had this problem:

Valid ROM signature found @0h, PCIR offset 234h
	PCIR: type 0 (x86 PC-AT), vendor: 1002, device: 6939, class: 030000
	PCIR: revision 0, vendor revision: f30
Error, ran off the end

My setup:
Arch linux, I get the same problem on 4.14.14 and 4.14.11
Ryzen 1700
B350 board
GT 610 host GPU on the secondary slot
RX 380 guest GPU on the primary slot

My QEMU command:

-cpu host,kvm=off -smp 1,sockets=1,cores=6,threads=1,maxcpus=6 -m 6G
-enable-kvm -machine q35,accel=kvm
-drive file=/dev/sda,format=raw
-device ivshmem-plain,memdev=ivshmem
-object memory-backend-file,id=ivshmem,share=on,mem-path=/dev/shm/looking-glass,size=64M
-device vfio-pci,host=25:00.0,x-vga=on,romfile=/home/e2298/vm/rom_gpu.rom
-spice port=5900,addr=,disable-ticketing
-vga none

I forgot to mention: If I launch looking glass while QEMU is stuck, it will get stuck too, untill QEMU stops being unresponsive.

So apparently, my GPU doesn’t support resetting. Should’ve been the first thing I checked, really.
Weird thing is it used to work before, it probably wasn’t initialized because of the lack of a proper vBIOS, and I somehow only noticed the problem until I started messing with the sound.

I think, R9 380 probably has own HDMI Audio device (25:00.1?). It must be handled by vfio-pci module too and all devices in same IOMMU group must be passthrough to Guest OS together.

Command lspci -knn shows list of devices and active kernel modules.

Maybe try blacklisting the gpu driver with grub.