Bug 1055416

Summary: can not see seabios GUI when boot with 255 virtio-blk-pci disks via PCIe-switch
Product: Red Hat Enterprise Linux 7 Reporter: Jun Li <juli>
Component: qemu-kvmAssignee: Marcel Apfelbaum <marcel>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: ailan, hhuang, huding, jinzhao, juzhang, knoel, kraxel, michen, mst, rbalakri, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-24 18:25:51 UTC Type: Bug
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:    
Bug Blocks: 1227278    

Description Jun Li 2014-01-20 08:34:59 UTC
Description of problem:
can not see seabios GUI when boot with 255 virtio-blk-pci disks via PCIe-switch.
Also test with 240 virtio-blk-pci disks, hit this issue too.
Test with less than 232 virtio-blk-pci-disks, no this issue.

BTW, this issue is different with bug 987322. This bug boot guest with system disk not under pcie-switch downstream. 

Version-Release number of selected component (if applicable):
3.10.0-67.el7.x86_64
qemu-kvm-rhev-1.5.3-37.el7.x86_64
seabios-bin-1.7.2.2-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest as the following via multi-pcie.sh shell script.
# ./multi-pcie.sh 255
# cat script/multi-pcie.sh 
#!/bin/sh

MACHINE=q35
SMP=4,cores=2,threads=2,sockets=1
MEM=2G
GUEST_IMG=/home/juli/rhel7_64.raw
IMG_FORMAT=raw

CLI="/usr/libexec/qemu-kvm -enable-kvm -M $MACHINE -smp $SMP -m $MEM -name vm1 -drive file=$GUEST_IMG,if=none,id=guest-img,format=$IMG_FORMAT,werror=stop,rerror=stop -device ide-hd,drive=guest-img,bus=ide.0,unit=0,id=os-disk,bootindex=1 -spice port=5931,disable-ticketing -vga qxl -monitor stdio -qmp tcp:0:6666,server,nowait -boot menu=on,reboot-timeout=8,strict=on -chardev stdio,id=log -device isa-debugcon,iobase=0x402,chardev=log"

echo before  juli
while [ ${i:=0} -lt ${1:-0} ]
do
    dstreamId=$((i))
    ustreamId=$((dstreamId/32))
    chassisId=$((dstreamId+1))
    blkDiskId=$((dstreamId))

    if [ $((dstreamId%32)) -eq 0 ]
    then
        CLI="$CLI -device ioh3420,bus=pcie.0,id=root.$ustreamId,slot=$ustreamId"
        CLI="$CLI -device x3130-upstream,bus=root.$ustreamId,id=upstream$ustreamId"
    fi

#    qemu-img create -f qcow2 /home/disk/disk$blkDiskId  100M
    echo "juli$i"
    CLI="$CLI -device xio3130-downstream,bus=upstream$ustreamId,id=downstream$dstreamId,chassis=$chassisId"
    CLI="$CLI -drive file=/home/disk/disk$blkDiskId,if=none,id=disk$blkDiskId,format=qcow2 "
    CLI="$CLI -device virtio-blk-pci,scsi=off,drive=disk$blkDiskId,id=virtio-blk$blkDiskId,bus=downstream$dstreamId"
    i=$((i+1))
done

$CLI

---

Actual results:
Can not see seabios GUI via remoteview spice://$IP:$port
Using isa-debugcon debug, got the following messages:
QEMU 1.5.3 monitor - type 'help' for more information^M
(qemu) Start bios (version seabios-1.7.2.2-6.el7)
Ram Size=0x80000000 (0x0000000000000000 high)
Relocating low data from 0x000e4140 to 0x000ef780 (size 2161)
Relocating init from 0x000e49b1 to 0x7ffe2e30 (size 53415)
CPU Mhz=2406
=== PCI bus & bridge init ===
PCI: pci_bios_init_bus_rec bus = 0x0
PCI: pci_bios_init_bus_rec bdf = 0x18
PCI: primary bus = 0x0
PCI: secondary bus = 0xff -> 0x1
PCI: pci_bios_init_bus_rec bus = 0x1
PCI: pci_bios_init_bus_rec bdf = 0x100
PCI: primary bus = 0x0 -> 0x1
PCI: secondary bus = 0xff -> 0x2
PCI: pci_bios_init_bus_rec bus = 0x2
PCI: pci_bios_init_bus_rec bdf = 0x200
PCI: primary bus = 0x0 -> 0x2
PCI: secondary bus = 0xff -> 0x3
PCI: pci_bios_init_bus_rec bus = 0x3
PCI: subordinate bus = 0x0 -> 0x3
PCI: pci_bios_init_bus_rec bdf = 0x208
PCI: primary bus = 0x0 -> 0x2
PCI: secondary bus = 0xff -> 0x4
PCI: pci_bios_init_bus_rec bus = 0x4
PCI: subordinate bus = 0x0 -> 0x4
PCI: pci_bios_init_bus_rec bdf = 0x210
PCI: primary bus = 0x0 -> 0x2
PCI: secondary bus = 0xff -> 0x5
PCI: pci_bios_init_bus_rec bus = 0x5
PCI: subordinate bus = 0x0 -> 0x5
PCI: pci_bios_init_bus_rec bdf = 0x218
PCI: primary bus = 0x0 -> 0x2
PCI: secondary bus = 0xff -> 0x6
PCI: pci_bios_init_bus_rec bus = 0x6
...

Expected results:
can see the seabio GUI and boot guest correctly.

Additional info:

Comment 2 Gerd Hoffmann 2014-01-29 10:53:56 UTC
Please attach full seabios log.

Comment 5 Gerd Hoffmann 2014-02-17 09:50:05 UTC
Oh, I see we max out the number of pci busses, which in turn confuses seabios.

qemu-kvm should not allow to create a configuration with more than 255 pci bridges.

Comment 9 Amnon Ilan 2016-02-24 18:25:51 UTC

*** This bug has been marked as a duplicate of bug 1260913 ***