Bug 2005548

Summary: [rhel8.6]fail to hotplug NIC with edk2 firmware
Product: Red Hat Enterprise Linux 8 Reporter: Lei Yang <leiyang>
Component: edk2Assignee: Gerd Hoffmann <kraxel>
Status: CLOSED CURRENTRELEASE QA Contact: Lei Yang <leiyang>
Severity: high Docs Contact: Daniel Vozenilek <davozeni>
Priority: high    
Version: 8.6CC: berrange, davozeni, gfialova, jherrman, jusual, juzhang, kkiwi, kraxel, leiyang, pbonzini, virt-maint, xfu, yalzhang, yfu
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2001719 Environment:
Last Closed: 2022-05-25 06:37:48 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:
Bug Depends On: 2001719    
Bug Blocks:    

Comment 3 Gerd Hoffmann 2022-02-03 09:23:19 UTC
Please retest with qemu 6.2 build.

Comment 4 Lei Yang 2022-02-07 01:55:48 UTC
(In reply to Gerd Hoffmann from comment #3)
> Please retest with qemu 6.2 build.

Will update test results after testing

Comment 5 Lei Yang 2022-02-07 13:36:17 UTC
==> Reproduced this problem on qemu-kvm-6.1.0-5.module+el8.6.0+13430+8fdd5f85.x86_64

Test Version:
qemu-kvm-6.1.0-5.module+el8.6.0+13430+8fdd5f85.x86_64
kernel-4.18.0-365.el8.x86_64
edk2-ovmf-20210527gite1999b264f1f-3.el8.noarch

Test Steps:
1. Boot a guest
/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-blockdev node-name=file_ovmf_code,driver=file,filename=/usr/share/OVMF/OVMF_CODE.secboot.fd,auto-read-only=on,discard=unmap \
-blockdev node-name=drive_ovmf_code,driver=raw,read-only=on,file=file_ovmf_code \
-blockdev node-name=file_ovmf_vars,driver=file,filename=/home/kvm_autotest_root/images/avocado-vt-vm1_rhel860-64-virtio-scsi_avocado-vt-vm1.qcow2_VARS.fd,auto-read-only=on,discard=unmap \
-blockdev node-name=drive_ovmf_vars,driver=raw,read-only=off,file=file_ovmf_vars \
-machine q35,memory-backend=mem-machine_mem,pflash0=drive_ovmf_code,pflash1=drive_ovmf_vars \
-device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
-device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
-nodefaults \
-device VGA,bus=pcie.0,addr=0x2 \
-m 47104 \
-object memory-backend-ram,size=47104M,id=mem-machine_mem  \
-smp 16,maxcpus=16,cores=8,threads=1,dies=1,sockets=2  \
-cpu 'EPYC-IBPB',x2apic=on,tsc-deadline=on,hypervisor=on,tsc-adjust=on,arch-capabilities=on,xsaves=on,cmp-legacy=on,perfctr-core=on,clzero=on,xsaveerptr=on,virt-ssbd=on,npt=on,nrip-save=on,svme-addr-chk=on,rdctl-no=on,skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,monitor=off,kvm_pv_unhalt=on \
-device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
-device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
-device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
-device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-2,addr=0x0 \
-blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/rhel860-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,write-cache=on  \
-vnc :0  \
-rtc base=utc,clock=host,driftfix=slew  \
-boot menu=off,order=cdn,once=c,strict=off \
-net none \
-enable-kvm \
-device pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,addr=0x3,chassis=4 \
-device pcie-root-port,id=pcie_extra_root_port_1,addr=0x3.0x1,bus=pcie.0,chassis=5 \
-device pcie-root-port,id=pcie_extra_root_port_2,addr=0x3.0x2,bus=pcie.0,chassis=6 \
-device pcie-root-port,id=pcie_extra_root_port_3,addr=0x3.0x3,bus=pcie.0,chassis=7 \
-monitor stdio \
-qmp tcp:0:5555,server,nowait \

2. hotplug e1000e nic
{'execute': 'qmp_capabilities'}
{"return": {}}
{"execute": "netdev_add", "arguments": {"type": "tap", "id": "netdev0"}}
{"return": {}}
{"execute": "device_add", "arguments": {"id": "nic0", "driver": "e1000e", "netdev": "netdev0", "mac": "9a:45:bb:a8:b1:90", "bus": "pcie_extra_root_port_0", "addr": "0x0"}}
{"return": {}}

3. Can not get NIC hotplugged via ifconfig/ip link show command inside guest.
4. guest dmesg:
[  154.156696] pci 0000:05:00.0: [8086:10d3] type 00 class 0x020000
[  154.157280] pci 0000:05:00.0: reg 0x10: [mem 0x00000000-0x0001ffff]
[  154.157773] pci 0000:05:00.0: reg 0x14: [mem 0x00000000-0x0001ffff]
[  154.158309] pci 0000:05:00.0: reg 0x18: [io  0x0000-0x001f]
[  154.158864] pci 0000:05:00.0: reg 0x1c: [mem 0x00000000-0x00003fff]
[  154.159506] pci 0000:05:00.0: reg 0x30: [mem 0x00000000-0x0003ffff pref]
[  154.161445] pci 0000:05:00.0: BAR 6: no space for [mem size 0x00040000 pref]
[  154.161969] pci 0000:05:00.0: BAR 6: failed to assign [mem size 0x00040000 pref]
[  154.162550] pci 0000:05:00.0: BAR 0: no space for [mem size 0x00020000]
[  154.163157] pci 0000:05:00.0: BAR 0: failed to assign [mem size 0x00020000]
[  154.163756] pci 0000:05:00.0: BAR 1: no space for [mem size 0x00020000]
[  154.164279] pci 0000:05:00.0: BAR 1: failed to assign [mem size 0x00020000]
[  154.165763] pci 0000:05:00.0: BAR 3: no space for [mem size 0x00004000]
[  154.166318] pci 0000:05:00.0: BAR 3: failed to assign [mem size 0x00004000]
[  154.166858] pci 0000:05:00.0: BAR 2: no space for [io  size 0x0020]
[  154.167352] pci 0000:05:00.0: BAR 2: failed to assign [io  size 0x0020]
[  154.186917] e1000e: Intel(R) PRO/1000 Network Driver
[  154.187368] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[  154.190026] e1000e: probe of 0000:05:00.0 failed with error -5


==> Test pass on qemu-kvm-6.2.0-5.module+el8.6.0+14025+ca131e0a.x86_64
1. Boot guest
2. Hotplug e1000e nic
3. ifconfig/ip link showe coomand can get NIC. Guest dmesg without error info.


Based on above test result. This bug has fixed well on qemu-kvm-6.2.0-5.module+el8.6.0+14025+ca131e0a.x86_64.