Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-131144

qemu crash after hot-unplug disk from the multifunction enabled bus [RHEL.9.8]

Linking RHIVOS CVEs to...Migration: Automation ...RHELPRIO AssignedTeam ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.8
    • None
    • Yes
    • Moderate
    • rhel-virt-storage
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?

      (This issue is the same as RHEL-116443 )

      Hotplug the disk to the multifunction-enabled bus, then hot-unplug it, the qemu
      crashed.

                     #0  0x000055f01e87f8c7 unparent_vfs (qemu-kvm + 0x52b8c7)
                      #1  0x000055f01e8e78ea virtio_pci_exit (qemu-kvm + 0x5938ea)
                      #2  0x000055f01e87b283 pci_qdev_unrealize (qemu-kvm + 0x527283)
                      #3  0x000055f01ebdeace device_set_realized (qemu-kvm + 0x88aace)
                      #4  0x000055f01ebe7f2c property_set_bool (qemu-kvm + 0x893f2c)
                      #5  0x000055f01ebe4ea2 object_property_set (qemu-kvm + 0x890ea2)
                      #6  0x000055f01ebec118 object_property_set_qobject (qemu-kvm + 0x898118)
                      #7  0x000055f01ebe55a7 object_property_set_bool (qemu-kvm + 0x8915a7)
                      #8  0x000055f01e79f2a9 qdev_unrealize (qemu-kvm + 0x44b2a9)
                      #9  0x000055f01e7a4040 hotplug_handler_unplug (qemu-kvm + 0x450040)
                      #10 0x000055f01e7a4360 pci_write (qemu-kvm + 0x450360)
                      #11 0x000055f01e937fcc memory_region_write_accessor (qemu-kvm + 0x5e3fcc)
                      #12 0x000055f01e937e4e access_with_adjusted_size (qemu-kvm + 0x5e3e4e)
                      #13 0x000055f01e937ca5 memory_region_dispatch_write (qemu-kvm + 0x5e3ca5)
                      #14 0x000055f01e950bc5 flatview_write_continue_step (qemu-kvm + 0x5fcbc5)

       

      What is the impact of this issue to you?

      Please provide the package NVR for which the bug is seen:

      Red Hat Enterprise Linux release 9.8 Beta (Plow)
      5.14.0-642.el9.x86_64
      device-mapper-1.02.206-2.el9_7.1.x86_64
      device-mapper-multipath-0.8.7-39.el9.x86_64
      qemu-kvm-10.1.0-4.el9.x86_64
      seabios-bin-1.16.3-4.el9.noarch
      edk2-ovmf-20241117-8.el9.noarch

      How reproducible is this bug?:

      100%

      Steps to reproduce

      1. 1. Boot VM
        /usr/libexec/qemu-kvm \
         -name avocado-vt-vm1 \
         -machine q35,memory-backend=mem-machine_mem \
         -device {"id": "pcie-root-port-0", "driver": "pcie-root-port", "multifunction": true, "bus": "pcie.0", "addr": "0x1", "chassis": 1} \
         -device {"id": "pcie-pci-bridge-0", "driver": "pcie-pci-bridge", "addr": "0x0", "bus": "pcie-root-port-0"} \
         -nodefaults \
         -device {"driver": "VGA", "bus": "pcie.0", "addr": "0x2"} \
         -m 12288 \
         -object {"size": 12884901888, "id": "mem-machine_mem", "qom-type": "memory-backend-ram"} \
         -smp 56,maxcpus=56,cores=28,threads=1,dies=1,sockets=2 \
         -cpu Icelake-Server-v2,+kvm_pv_unhalt \
         -device {"id": "pcie-root-port-1", "port": 1, "driver": "pcie-root-port", "addr": "0x1.0x1", "bus": "pcie.0", "chassis": 2} \
         -device {"driver": "qemu-xhci", "id": "usb1", "bus": "pcie-root-port-1", "addr": "0x0"} \
         -device {"driver": "usb-tablet", "id": "usb-tablet1", "bus": "usb1.0", "port": "1"} \
         -blockdev {"node-name": "file_image1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/rhel102-64-virtio.qcow2", "cache": {"direct": true, "no-flush": false}} \
         -blockdev {"node-name": "drive_image1", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_image1"} \
         -device {"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3} \
         -device {"driver": "virtio-blk-pci", "id": "image1", "drive": "drive_image1", "bootindex": 0, "write-cache": "on", "multifunction": true, "bus": "pcie-root-port-2", "addr": "0x0"} \
         -device {"id": "pcie-root-port-3", "port": 3, "driver": "pcie-root-port", "addr": "0x1.0x3", "bus": "pcie.0", "chassis": 4} \
         -device {"driver": "virtio-net-pci", "mac": "9a:42:8c:c1:59:59", "id": "iddPa7K7", "netdev": "idHFYP77", "bus": "pcie-root-port-3", "addr": "0x0"} \
         -netdev {"id": "idHFYP77", "type": "tap"} \
         -vnc :5 \
         -monitor stdio \
         -qmp tcp:0:5955,server=on,wait=off \
         -rtc base=utc,clock=host,driftfix=slew \
         -boot menu=off,order=cdn,once=c,strict=off \
         -enable-kvm \
         -device {"id": "pcie_extra_root_port_0", "driver": "pcie-root-port", "multifunction": true, "bus": "pcie.0", "addr": "0x3", "chassis": 5}
        
        

        #
        Hotplug 8 disks to the multifunction enabled bus

        {"execute": "blockdev-add", "arguments": {"node-name": "file_stg1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/stg1.qcow2", "cache": {"direct": true, "no-flush": false}}, "id": "JFd1hliE"}
        {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg1", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_stg1"}, "id": "GLioGLNz"}
        {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg1", "drive": "drive_stg1", "write-cache": "on", "addr": "0x0.0x1", "bus": "pcie_extra_root_port_0"}, "id": "wdEpyLKm"}
        
        {"execute": "blockdev-add", "arguments": {"node-name": "file_stg2", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/stg2.qcow2", "cache": {"direct": true, "no-flush": false}}, "id": "JFd1hliE"}
        {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg2", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_stg2"}, "id": "GLioGLNz"}
        {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg2", "drive": "drive_stg2", "write-cache": "on", "addr": "0x0.0x2", "bus": "pcie_extra_root_port_0"}, "id": "wdEpyLKm"}
        
        {"execute": "blockdev-add", "arguments": {"node-name": "file_stg3", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/stg3.qcow2", "cache": {"direct": true, "no-flush": false}}, "id": "JFd1hliE"}
        {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg3", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_stg3"}, "id": "GLioGLNz"}
        
        
        {"execute": "blockdev-add", "arguments": {"node-name": "file_stg4", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/stg4.qcow2", "cache": {"direct": true, "no-flush": false}}, "id": "JFd1hliE"}
        {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg4", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_stg4"}, "id": "GLioGLNz"}
        {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg4", "drive": "drive_stg4", "write-cache": "on", "addr": "0x0.0x4", "bus": "pcie_extra_root_port_0"}, "id": "wdEpyLKm"}
        
        {"execute": "blockdev-add", "arguments": {"node-name": "file_stg5", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/stg5.qcow2", "cache": {"direct": true, "no-flush": false}}, "id": "JFd1hliE"}
        {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg5", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_stg5"}, "id": "GLioGLNz"}
        {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg5", "drive": "drive_stg5", "write-cache": "on", "addr": "0x0.0x5", "bus": "pcie_extra_root_port_0"}, "id": "wdEpyLKm"}
        
        {"execute": "blockdev-add", "arguments": {"node-name": "file_stg6", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/stg6.qcow2", "cache": {"direct": true, "no-flush": false}}, "id": "JFd1hliE"}
        {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg6", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_stg6"}, "id": "GLioGLNz"}
        {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg6", "drive": "drive_stg6", "write-cache": "on", "addr": "0x0.0x6", "bus": "pcie_extra_root_port_0"}, "id": "wdEpyLKm"}
        
        
        {"execute": "blockdev-add", "arguments": {"node-name": "file_stg7", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/stg7.qcow2", "cache": {"direct": true, "no-flush": false}}, "id": "JFd1hliE"}
        {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg7", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_stg7"}, "id": "GLioGLNz"}
        {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg7", "drive": "drive_stg7", "write-cache": "on", "addr": "0x0.0x7", "bus": "pcie_extra_root_port_0"}, "id": "wdEpyLKm"}
        
        {"execute": "blockdev-add", "arguments": {"node-name": "file_stg0", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/stg0.qcow2", "cache": {"direct": true, "no-flush": false}}, "id": "JFd1hliE"}
        {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg0", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_stg0"}, "id": "GLioGLNz"}
        {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg0", "drive": "drive_stg0", "write-cache": "on","multifunction": true, "addr": "0x0.0x0", "bus": "pcie_extra_root_port_0"}, "id": "wdEpyLKm"}
        
        
        
        
      1. 3. Log in to the guest, check the disks exist
      2. 4. Unplug the function 0 disk
        Unknown macro: {"execute"}

      {"execute": "blockdev-del", "arguments":

      {"node-name": "drive_stg0"}

      , "id": "EAiI2LVe"}
      {"execute": "blockdev-del", "arguments":

      {"node-name": "file_stg0"}

      , "id": "IJRbWqTG"}

      Expected results

      Step 4 executed successfully, the disks were deleted without error

      Actual results

      Qemu crash

       

      (Can not hit the issue on qemu-kvm-9.1.0-28.el9)

              shajnocz@redhat.com Stefan Hajnoczi
              qingwangrh qing wang
              virt-maint virt-maint
              qing wang qing wang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: