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

[rhel-10] qemu reports "virtio: zero sized buffers are not allowed" during guest reboot which protected by smmuv3

    • Yes
    • Low
    • Regression, CustomerScenariosInitiative
    • 1
    • rhel-sst-virtualization
    • ssg_virtualization
    • 5
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • Virt ARM 25-1
    • None
    • None
    • aarch64
    • None

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

      When the guest uses virtio-scsi controller and is protected with smmuv3, after reboot the guest, the qemu process will report a message: "virtio: zero sized buffers are not allowed". Even the guest still works, but seems this does not make sense in the virtquque map. And I found this is a regression from MR https://gitlab.com/redhat/centos-stream/src/qemu-kvm/-/merge_requests/223, which included in qemu-kvm-8.2.0-6.el9.

      Please provide the package NVR for which bug is seen:

      host/guest kernel: 6.12.0-30.el10.aarch64+64k
      qemu: qemu-kvm-9.1.0-5.el10
      edk2:edk2-aarch64-20240524-11.el10.noarch

      How reproducible:

      always

      Steps to reproduce

      1. Launch a SCSI guest with smmuv3 protection and iommu_platform=on into virtio-scsi device
        MALLOC_PERTURB_=1  /usr/libexec/qemu-kvm \
            -name 'avocado-vt-vm1'  \
            -sandbox on \
            -blockdev '{"node-name": "file_aavmf_code", "driver": "file", "filename": "/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.qcow2", "auto-read-only": true, "discard": "unmap"}' \
            -blockdev '{"node-name": "drive_aavmf_code", "driver": "qcow2", "read-only": true, "file": "file_aavmf_code"}' \
            -blockdev '{"node-name": "file_aavmf_vars", "driver": "file", "filename": "/root/avocado/data/avocado-vt/avocado-vt-vm1_rhel940-aarch64-64k-virtio-scsi_qcow2_filesystem_VARS.qcow2", "auto-read-only": true, "discard": "unmap"}' \
            -blockdev '{"node-name": "drive_aavmf_vars", "driver": "qcow2", "read-only": false, "file": "file_aavmf_vars"}' \
            -machine virt,gic-version=host,iommu=smmuv3,pflash0=drive_aavmf_code,pflash1=drive_aavmf_vars,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 '{"id": "pcie-root-port-1", "port": 1, "driver": "pcie-root-port", "addr": "0x1.0x1", "bus": "pcie.0", "chassis": 2}' \
            -device '{"driver": "virtio-gpu-pci", "bus": "pcie-root-port-1", "addr": "0x0"}' \
            -m 232448 \
            -object '{"size": 243739394048, "id": "mem-machine_mem", "qom-type": "memory-backend-ram"}'  \
            -smp 36,maxcpus=36,cores=18,threads=1,clusters=1,sockets=2  \
            -cpu 'host' \
            -serial unix:'/var/tmp/serial-serial0',server=on,wait=off \
            -device '{"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3}' \
            -device '{"driver": "qemu-xhci", "id": "usb1", "bus": "pcie-root-port-2", "addr": "0x0"}' \
            -device '{"driver": "usb-tablet", "id": "usb-tablet1", "bus": "usb1.0", "port": "1"}' \
            -device '{"id": "pcie-root-port-3", "port": 3, "driver": "pcie-root-port", "addr": "0x1.0x3", "bus": "pcie.0", "chassis": 4}' \
            -device '{"id": "virtio_scsi_pci0", "driver": "virtio-scsi-pci", "bus": "pcie-root-port-3", "addr": "0x0", "iommu_platform": true}' \
            -blockdev '{"node-name": "file_image1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/rhel940-aarch64-64k-virtio-scsi.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 '{"driver": "scsi-hd", "id": "image1", "drive": "drive_image1", "write-cache": "on"}' \
            -device '{"id": "pcie-root-port-4", "port": 4, "driver": "pcie-root-port", "addr": "0x1.0x4", "bus": "pcie.0", "chassis": 5}' \
            -device '{"driver": "virtio-net-pci", "mac": "9a:9d:bb:72:db:83", "rombar": 0, "id": "idCWgCEv", "netdev": "idhMen1D", "bus": "pcie-root-port-4", "addr": "0x0", "iommu_platform": true}' \
            -netdev  '{"id": "idhMen1D", "type": "tap", "vhost": true, "vhostfd": "17", "fd": "16"}'  \
            -vnc :0  \
            -rtc base=utc,clock=host \
            -enable-kvm \
            -monitor stdio
        
      1. Reboot the guest via shell command or qmp command
      {"execute": "system_reset"}
      

      Expected results

      Guest rebooted without anything

      Actual results

      qemu reports:

      qemu-kvm: virtio: zero sized buffers are not allowed
      

              ddutile Donald Dutile
              zhenyzha@redhat.com Zhenyu Zhang
              virt-maint virt-maint
              Dan Zheng Dan Zheng
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated: