Description of problem: Hot plug 3 PFs, all four PF network cards appear in Win2019 guest at the same time, guest works well. However qemu crash when hot unplug them. Version-Release number of selected component (if applicable): qemu-kvm-3.1.0-18.module+el8+2834+fa8bb6e2.x86_64 virtio-win-1.9.7-3.el8.noarch kernel-4.18.0-74.el8.x86_64 How reproducible: 100% Steps to Reproduce: 1.Boot a Win2019 guest 2.Hot plug/hot unplug one nic to guest,Make sure no memory leak. (qemu) device_add vfio-pci,host=04:00.1,bus=root.4,id=pf-2 (qemu) device_add vfio-pci,host=07:00.0,bus=root.5,id=pf-3 (qemu) device_add vfio-pci,host=07:00.1,bus=root.6,id=pf-4 (qemu) device_del pf-3 (qemu) device_add vfio-pci,host=07:00.0,bus=root.5,id=pf-3 (qemu) device_del pf-2 (qemu) device_add vfio-pci,host=04:00.1,bus=root.4,id=pf-2 (qemu) device_del pf-4 (qemu) qemu_install.sh: line 25: 4839 Segmentation fault (core dumped) Actual results: qemu crash when hot unplugging. Expected results: The guest shuold work well. Additional info: 1. Thread 4 "qemu-kvm" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffeaa0a700 (LWP 10166)] 0x0000555555a2da4b in msix_table_mmio_read () (gdb) bt #0 0x0000555555a2da4b in msix_table_mmio_read () #1 0x00005555558964e1 in memory_region_read_accessor () #2 0x00005555558945d6 in access_with_adjusted_size () #3 0x000055555589824b in memory_region_dispatch_read () #4 0x0000555555846416 in flatview_read_continue () #5 0x00005555558465c6 in flatview_read () #6 0x00005555558466f3 in address_space_read_full () #7 0x00005555558a9fb8 in kvm_cpu_exec () #8 0x0000555555883656 in qemu_kvm_cpu_thread_fn () #9 0x0000555555b8d384 in qemu_thread_start () #10 0x00007ffff33a92de in start_thread () from /lib64/libpthread.so.0 #11 0x00007ffff30d9a63 in clone () from /lib64/libc.so.6 2.#dmesg [14540.722154] qemu-kvm[8148]: segfault at 0 ip 0000563ab86e3a4b sp 00007fdb5eebd4b8 error 4 in qemu-kvm[563ab820a000+9d7000] [14540.734504] Code: 38 16 00 b8 ea ff ff ff e9 68 ff ff ff e8 dd 89 e0 ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 48 8b 87 88 04 00 00 <8b> 04 30 c3 90 f3 0f 1e fa 55 48 89 f5 53 48 89 fb 48 83 ec 08 48
1.full qemu command line /usr/libexec/qemu-kvm -name Win2019 \ -M q35,kernel-irqchip=split -m 1G \ -cpu Haswell-noTSX,hv_stimer,hv_synic,hv_time,hv_relaxed,hv_vpindex,hv_spinlocks=0xfff,hv_vapic,hv_reset,hv_crash \ -device intel-iommu,intremap=true,caching-mode=true \ -smp 2,sockets=1,cores=2,threads=1 \ -device pcie-root-port,id=root.1,chassis=1 \ -device pcie-root-port,id=root.2,chassis=2 \ -device pcie-root-port,id=root.3,chassis=3 \ -device pcie-root-port,id=root.4,chassis=4 \ -device pcie-root-port,id=root.5,chassis=5 \ -device pcie-root-port,id=root.6,chassis=6 \ -blockdev driver=file,cache.direct=off,cache.no-flush=on,filename=/home/win2019.qcow2,node-name=my_file \ -blockdev driver=qcow2,node-name=my,file=my_file \ -device virtio-blk-pci,drive=my,id=virtio-blk0,bus=root.1 \ -drive id=drive_cd1,if=none,snapshot=off,aio=native,cache=none,media=cdrom,file=/home/en_windows_server_2019_x64_dvd_4cb967d8.iso \ -device ide-cd,id=cd1,drive=drive_cd1,bus=ide.0,unit=0 \ -drive id=drive_winutils,if=none,snapshot=off,aio=native,cache=none,media=cdrom,file=/usr/share/virtio-win/virtio-win-1.9.7.iso \ -device ide-cd,id=winutils,drive=drive_winutils,bus=ide.1,unit=0 \ -vnc :0 \ -vga qxl \ -monitor stdio \ -usb -device usb-tablet \ -boot menu=on \ -qmp tcp:0:5555,server,nowait \ -device vfio-pci,host=04:00.0,bus=root.3,id=pf-1 \ 2.rhel guest works well
If boot qemu with "-nodefaults" (other cmd line keep same as above), everything works well. So this should not be VFIO issue.
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks
I suggest testing with the QEMU package mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1685775#c28
(In reply to Yan Vugenfirer from comment #4) > I suggest testing with the QEMU package mentioned in > https://bugzilla.redhat.com/show_bug.cgi?id=1685775#c28 Hi,Yan The status of QENU package link in bug 1685775 has been closed.Could you provide again? Best regards LeiYang
https://bugzilla.redhat.com/show_bug.cgi?id=1685775#c27 - Marc-Andre, can you please provide this package again to test this bug as well? Thanks.
(In reply to Yan Vugenfirer from comment #6) > https://bugzilla.redhat.com/show_bug.cgi?id=1685775#c27 - Marc-Andre, can > you please provide this package again to test this bug as well? > Thanks. that should be it: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=27199544
Hi,Yan Using the qemu package(qemu-kvm-2.12.0-99.el8_1.elmarco202003041527.x86_64) test.Hot plug/unplug 3 PFs guest works well. Test Version: kernel-4.18.0-147.8.1.el8_1.x86_64 qemu-kvm-2.12.0-99.el8_1.elmarco202003111136.x86_64 virtio-win-1.9.8-7.el8.noarch ==steps 1.Boot win2019 guest. /usr/libexec/qemu-kvm -name Win2019 \ -M q35,kernel-irqchip=split -m 4G \ -cpu Haswell-noTSX,hv_stimer,hv_synic,hv_time,hv_relaxed,hv_vpindex,hv_spinlocks=0xfff,hv_vapic,hv_reset,hv_crash \ -smp 2,sockets=1,cores=2,threads=1 \ -device pcie-root-port,id=root.1,chassis=1 \ -device pcie-root-port,id=root.2,chassis=2 \ -device pcie-root-port,id=root.3,chassis=3 \ -device pcie-root-port,id=root.4,chassis=4 \ -device pcie-root-port,id=root.5,chassis=5 \ -device pcie-root-port,id=root.6,chassis=6 \ -blockdev driver=file,cache.direct=off,cache.no-flush=on,filename=/home/win2019.qcow2,node-name=my_file \ -blockdev driver=qcow2,node-name=my,file=my_file \ -device virtio-blk-pci,drive=my,id=virtio-blk0,bus=root.1 \ -drive id=drive_cd1,if=none,snapshot=off,aio=native,cache=none,media=cdrom,file=/home/en_windows_server_2019_updated_march_2019_x64_dvd_2ae967ab.iso \ -device ide-cd,id=cd1,drive=drive_cd1,bus=ide.0,unit=0 \ -drive id=drive_winutils,if=none,snapshot=off,aio=native,cache=none,media=cdrom,file=/usr/share/virtio-win/virtio-win-1.9.8.iso \ -device ide-cd,id=winutils,drive=drive_winutils,bus=ide.1,unit=0 \ -vnc :0 \ -vga qxl \ -monitor stdio \ -usb -device usb-tablet \ -boot menu=on \ -qmp tcp:0:5555,server,nowait \ 2.Hot plug/hot unplug nics to guest (qemu) device_add vfio-pci,host=06:00.0,bus=root.4,id=pf-2 (qemu) device_add vfio-pci,host=06:00.1,bus=root.5,id=pf-3 (qemu) device_add vfio-pci,host=08:00.0,bus=root.6,id=pf-4 (qemu) device_del pf-2 (qemu) device_del pf-3 (qemu) device_del pf-4 (qemu)
Closing based on comment #8 *** This bug has been marked as a duplicate of bug 1685775 ***