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

qemu crash after hot-unplug disk from the multifunction enabled bus,crash point PCIDevice *vf = dev->exp.sriov_pf.vf[i]

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

    • Yes
    • Moderate
    • 1
    • rhel-virt-storage
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • Planning backlog
    • Unspecified Release Note Type - Unknown
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

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

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

      #0 0x000055c5d0951f97 in unparent_vfs (dev=0x55c5f31cbbc0, total_vfs=<optimized out>)
      at ../hw/pci/pcie_sriov.c:27
      #1 pcie_sriov_pf_exit (dev=0x55c5f31cbbc0) at ../hw/pci/pcie_sriov.c:214
      #2 0x000055c5d09b8aaf in virtio_pci_exit (pci_dev=0x55c5f31cbbc0) at ../hw/virtio/virtio-pci.c:2293
      #3 0x000055c5d094da52 in pci_qdev_unrealize (dev=0x55c5f31cbbc0) at ../hw/pci/pci.c:1445
      #4 0x000055c5d0ca57f7 in device_set_realized
      (obj=0x55c5f31cbbc0, value=false, errp=0x55c5d2091278 <error_abort>) at ../hw/core/qdev.c:583
      #5 0x000055c5d0cae985 in property_set_bool
      (obj=0x55c5f31cbbc0, v=<optimized out>, name=<optimized out>, opaque=0x55c5f2ba30f0, errp=0x55c5d2091278 <error_abort>) at ../qom/object.c:2375
      #6 0x000055c5d0caba42 in object_property_set
      (obj=0x55c5f31cbbc0, name=0x55c5d0fe749f <str.5.llvm> "realized", v=0x7fb4a0087310, errp=0x55c5d2091278 <error_abort>) at ../qom/object.c:1450
      #7 0x000055c5d0cb2898 in object_property_set_qobject
      (obj=0x55c5f31cbbc0, name=0x55c5d0fe749f <str.5.llvm> "realized", value=0x7fb4a0315560, errp=0x55c5d2091278 <error_abort>) at ../qom/qom-qobject.c:28
      #8 0x000055c5d0cac147 in object_property_set_bool
      (obj=0x55c5f31cbbc0, name=0x55c5d0fe749f <str.5.llvm> "realized", value=false, errp=0x55c5d2091278 <error_abort>) at ../qom/object.c:1520

      What is the impact of this issue to you?

      QEMU error exit.

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

      Red Hat Enterprise Linux release 10.1 Beta (Coughlan)
      6.12.0-124.el10.x86_64
      device-mapper-1.02.206-3.el10.x86_64
      device-mapper-multipath-0.9.9-11.el10.x86_64
      qemu-kvm-10.1.0-2.el10.x86_64

      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"}
        
        
        
        
      2. 3. Log in to the guest, check the disks exist
      3. 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

      Same operation does not hit issue on
      qemu-kvm-10.0.0-13.el10_1.x86_64

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

                Created:
                Updated: