Bug 2154640

Summary: [aarch64] qemu fails to load "efi-virtio.rom" romfile when creating virtio-net-pci
Product: Red Hat Enterprise Linux 9 Reporter: Yihuang Yu <yihyu>
Component: qemu-kvmAssignee: Cornelia Huck <cohuck>
qemu-kvm sub component: Devices QA Contact: Yihuang Yu <yihyu>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: alexander.lougovski, alougovs, cohuck, coli, eric.auger, gshan, jinzhao, juzhang, lijin, mrezanin, virt-maint, zhenyzha
Version: 9.2Keywords: Regression, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: aarch64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-7.2.0-2.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:20:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yihuang Yu 2022-12-18 07:03:34 UTC
Description of problem:
In downstream qemu-kvm, ipxe-roms-qemu is not a dependent pkg on aarch64, the qemu process can be started with an empty romfile in the past, but failed with qemu-kvm-7.2.0-1.el9

Version-Release number of selected component (if applicable):
QEMU version: qemu-kvm-7.2.0-1.el9.aarch64
# rpm -qa | grep qemu
qemu-kvm-common-7.2.0-1.el9.aarch64
qemu-kvm-device-display-virtio-gpu-7.2.0-1.el9.aarch64
qemu-kvm-device-display-virtio-gpu-pci-7.2.0-1.el9.aarch64
qemu-kvm-audio-pa-7.2.0-1.el9.aarch64
qemu-kvm-block-rbd-7.2.0-1.el9.aarch64
qemu-kvm-device-usb-host-7.2.0-1.el9.aarch64
qemu-pr-helper-7.2.0-1.el9.aarch64
qemu-kvm-tools-7.2.0-1.el9.aarch64
qemu-kvm-docs-7.2.0-1.el9.aarch64
qemu-img-7.2.0-1.el9.aarch64
qemu-kvm-core-7.2.0-1.el9.aarch64
qemu-kvm-7.2.0-1.el9.aarch64

How reproducible:
always

Steps to Reproduce:
1. Reproducer 1:
# /usr/libexec/qemu-kvm -M virt -cpu host
qemu-kvm: failed to find romfile "efi-virtio.rom"

2. Reproducer 2:
# /usr/libexec/qemu-kvm -M virt -cpu host -nodefaults -device pcie-root-port,id=pcie-port.1,bus=pcie.0,addr=0x2 -monitor stdio
QEMU 7.2.0 monitor - type 'help' for more information
(qemu) VNC server running on ::1:5900
(qemu) netdev_add tap,id=net1
(qemu) device_add virtio-net-pci,id=nic1,netdev=net1,bus=pcie-port.1,addr=0x0

Actual results:
Error: failed to find romfile "efi-virtio.rom"

Expected results:
Can create virtio-net-pci device without efi-virtio.rom

Additional info:
On qemu-kvm-7.1.0-6.el9
# /usr/libexec/qemu-kvm -M virt -cpu host -monitor stdio
QEMU 7.1.0 monitor - type 'help' for more information
(qemu) VNC server running on ::1:5900

(qemu) info version
7.1.0qemu-kvm-7.1.0-6.el9
(qemu) info qtree
...
...
    bus: pcie.0
      type PCIE
      dev: virtio-net-pci, id ""
        disable-legacy = "off"
        disable-modern = false
        ioeventfd = true
        vectors = 4 (0x4)
        virtio-pci-bus-master-bug-migration = false
        migrate-extra = true
        modern-pio-notify = false
        x-disable-pcie = false
        page-per-vq = false
        x-ignore-backend-features = false
        ats = false
        x-ats-page-aligned = true
        x-pcie-deverr-init = true
        x-pcie-lnkctl-init = true
        x-pcie-pm-init = true
        x-pcie-flr-init = true
        aer = false
        addr = 01.0
        romfile = ""    <---------------- romfile is empty
        romsize = 4294967295 (0xffffffff)
        rombar = 1 (0x1)
...

Comment 2 Zhenyu Zhang 2022-12-19 03:35:52 UTC
[root@hpe-apollo80-02-n00 avocado]# /usr/libexec/qemu-kvm -cpu host -machine virt-rhel9.2.0 -m 4G,maxmem=1023G -monitor stdio
QEMU 7.2.0 monitor - type 'help' for more information
(qemu) qemu-kvm: failed to find romfile "efi-virtio.rom"
[root@hpe-apollo80-02-n00 avocado]# /usr/libexec/qemu-kvm -cpu host -machine virt-rhel9.0.0 -m 4G,maxmem=1023G -monitor stdio
QEMU 7.2.0 monitor - type 'help' for more information
(qemu) VNC server running on ::1:5901

This blocks all tests of virt-rhel9.2.0, so add TestBlocker.

Comment 4 lijin 2022-12-19 05:52:24 UTC
Hi Alexander,

This issue blocks all testings for qemu7.2, could you assign this bz and see if we can have a quick fix?

Thanks.

Comment 5 Yihuang Yu 2022-12-19 05:57:07 UTC
Actually, I don't think this is a real test blocker, we can install ipxe-roms-qemu to provide efi-virtio.rom, or set "rombar=0" property in the virtio-net-pci device, then qemu process can be started, although it will still prompt that the "efi-virtio.rom" file cannot be found(the file will not be used). So I can see all the tests of my auto job pass.

# /usr/libexec/qemu-kvm -M virt -cpu host -nodefaults -netdev tap,id=net1 -device virtio-net-pci,netdev=net1,id=nic1,rombar=0 -no-shutdown -monitor stdio
QEMU 7.2.0 monitor - type 'help' for more information
(qemu) Could not open option rom 'efi-virtio.rom': No such file or directory
VNC server running on ::1:5900
(qemu) info qtree
...
...
    bus: pcie.0
      type PCIE
      dev: virtio-net-pci, id "nic1"
        disable-legacy = "off"
        disable-modern = false
        ioeventfd = true
        vectors = 4 (0x4)
        virtio-pci-bus-master-bug-migration = false
        migrate-extra = true
        modern-pio-notify = false
        x-disable-pcie = false
        page-per-vq = false
        x-ignore-backend-features = false
        ats = false
        x-ats-page-aligned = true
        x-pcie-deverr-init = true
        x-pcie-lnkctl-init = true
        x-pcie-pm-init = true
        x-pcie-flr-init = true
        aer = false
        addr = 01.0
        romfile = "efi-virtio.rom"
        romsize = 4294967295 (0xffffffff)
        rombar = 0 (0x0)

Comment 6 lijin 2022-12-19 06:40:06 UTC
(In reply to lijin from comment #4)
> Hi Alexander,
> 
> This issue blocks all testings for qemu7.2, could you assign this bz and see
> if we can have a quick fix?


Remove testblocker keyword and adjust priority based on comment#5.

And since this is not a test blocker any more.  
It's not so urgent, take your time, Alexander.

Best Regards
Li Jin

Comment 8 Yihuang Yu 2022-12-21 01:29:41 UTC
Verify with qemu-kvm-7.2.0-2.el9.aarch64

# rpm -qa | grep qemu
libvirt-daemon-driver-qemu-8.10.0-2.el9.aarch64
qemu-kvm-common-7.2.0-2.el9.aarch64
qemu-kvm-device-display-virtio-gpu-7.2.0-2.el9.aarch64
qemu-kvm-device-display-virtio-gpu-pci-7.2.0-2.el9.aarch64
qemu-kvm-audio-pa-7.2.0-2.el9.aarch64
qemu-kvm-block-rbd-7.2.0-2.el9.aarch64
qemu-kvm-device-usb-host-7.2.0-2.el9.aarch64
qemu-pr-helper-7.2.0-2.el9.aarch64
qemu-kvm-tools-7.2.0-2.el9.aarch64
qemu-kvm-docs-7.2.0-2.el9.aarch64
qemu-img-7.2.0-2.el9.aarch64
qemu-kvm-core-7.2.0-2.el9.aarch64
qemu-kvm-7.2.0-2.el9.aarch64

# /usr/libexec/qemu-kvm -M virt -cpu host -monitor stdio
QEMU 7.2.0 monitor - type 'help' for more information
(qemu) VNC server running on ::1:5900
(qemu) info qtree
...
...
    bus: pcie.0
      type PCIE
      dev: virtio-net-pci, id ""
        disable-legacy = "off"
        disable-modern = false
        ioeventfd = true
        vectors = 4 (0x4)
        virtio-pci-bus-master-bug-migration = false
        migrate-extra = true
        modern-pio-notify = false
        x-disable-pcie = false
        page-per-vq = false
        x-ignore-backend-features = false
        ats = false
        x-ats-page-aligned = true
        x-pcie-deverr-init = true
        x-pcie-lnkctl-init = true
        x-pcie-pm-init = true
        x-pcie-flr-init = true
        aer = false
        addr = 01.0
        romfile = ""
        romsize = 4294967295 (0xffffffff)
        rombar = 1 (0x1)
...
...

Comment 12 Yihuang Yu 2022-12-24 04:31:54 UTC
Move to "VERIFIED" based on comment 8

Comment 14 errata-xmlrpc 2023-05-09 07:20:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: qemu-kvm security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2162