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

The virtio-keyboard device does not work when IOMMU is not enabled(prewhql-265 or later version)

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

    • Yes
    • Important
    • rhel-virt-windows
    • ssg_virtualization
    • 3
    • QE ack
    • False
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • None
    • None
    • Automated
    • Unspecified Release Note Type - Unknown
    • x86_64
    • Windows
    • None

      What were you trying to do that didn't work?
      The virtio-keyboard device not work with prewhql-265 or later version.

      Please provide the package NVR for which bug is seen:
      qemu-kvm-9.1.0-1.el9.x86_64
      kernel-5.14.0-522.el9.x86_64
      edk2-ovmf-20240524-7.el9.noarch
      virtio-win-prewhql-265
      Guest OS: Win11-24H2

      How reproducible:
      100%

      Steps to reproduce
      1.Start a Win11 VM and add a virtio-keyboard device(iommu=off)
      2.Install prewhql-265 or later version driver
      3.Check if the keyboard is work

       

      QEMU command line:

      /usr/libexec/qemu-kvm \
      -name 'avocado-vt-vm1'  \
      -blockdev '{"node-name": "file_ovmf_code", "driver": "file", "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", "auto-read-only": true, "discard": "unmap"}' \
      -blockdev '{"node-name": "drive_ovmf_code", "driver": "raw", "read-only": true, "file": "file_ovmf_code"}' \
      -blockdev '{"node-name": "file_ovmf_vars", "driver": "file", "filename": "/home/OVMF_VARS.fd", "auto-read-only": true, "discard": "unmap"}' \
      -blockdev '{"node-name": "drive_ovmf_vars", "driver": "raw", "read-only": false, "file": "file_ovmf_vars"}' \
      -machine q35,kernel-irqchip=split,pflash0=drive_ovmf_code,pflash1=drive_ovmf_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 '{"intremap": "on", "device-iotlb": true, "eim": "on", "driver": "intel-iommu"}' \
      -device '{"driver": "VGA", "bus": "pcie.0", "addr": "0x2"}' \
      -m 6144 \
      -object '{"size": 6442450944, "id": "mem-machine_mem", "qom-type": "memory-backend-ram"}'  \
      -smp 32,maxcpus=32,cores=16,threads=1,dies=1,sockets=2  \
      -cpu host \
      -device '{"ioport": 1285, "driver": "pvpanic", "id": "idE09O5e"}' \
      -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"}' \
      -device '{"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3}' \
      -device '{"id": "virtio_scsi_pci0", "driver": "virtio-scsi-pci", "bus": "pcie-root-port-2", "addr": "0x0", "iommu_platform": true, "ats": true}' \
      -blockdev '{"node-name": "file_image1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/win11-64-virtio-scsi-ovmf.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-3", "port": 3, "driver": "pcie-root-port", "addr": "0x1.0x3", "bus": "pcie.0", "chassis": 4}' \
      -device '{"driver": "virtio-net-pci", "mac": "9a:97:b6:1f:71:c1", "id": "idirqGf4", "netdev": "idVCB9ds", "bus": "pcie-root-port-3", "addr": "0x0", "iommu_platform": true, "ats": true}' \
      -netdev  '{"id": "idVCB9ds", "type": "tap", "vhost": true}' \
      -vnc :1  \
      -monitor stdio \
      -rtc base=localtime,clock=host,driftfix=slew  \
      -boot menu=off,order=cdn,once=c,strict=off \
      -enable-kvm \
      -device '{"id": "pcie-root-port-4", "port": 4, "driver": "pcie-root-port", "addr": "0x1.0x4", "bus": "pcie.0", "chassis": 5}' \
      -device '{"driver": "virtio-keyboard-pci", "id": "input_input1", "bus": "pcie-root-port-4", "addr": "0x0"}' \

      Expected results
      Keyboard works well

      Actual results
      Keyboard not works

      Additional info:
      The virtio-keyboard device works well with versions pre-whql-264 and lower, regardless of IOMMU status.
      How to enable iommu: Add '"iommu_platform": true, "ats": true' to the qemu command line

              ybendito@redhat.com Yuri Benditovich
              leidwang Leidong Wang
              Meirav Dean Meirav Dean
              Leidong Wang Leidong Wang
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: