Bug 1029275

Summary: Guest only find one 82576 VF(function 0) while use multifunction
Product: Red Hat Enterprise Linux 7 Reporter: Xu Han <xuhan>
Component: qemu-kvmAssignee: Alex Williamson <alex.williamson>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, alex.williamson, chayang, hhuang, juzhang, knoel, michen, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-20.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:34:09 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:
Attachments:
Description Flags
host dmesg none

Description Xu Han 2013-11-12 03:23:30 UTC
Description of problem:
Guest only find one 82576 VF(function 0) while use multifunction.
1. Test with 82576 PF, not hit this issue.
2. Test with 82599 VF, hit this issue as well.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-1.5.3-18.el7.x86_64
kernel-3.10.0-48.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. boot guest with 82576 VFs use multifunction.
/usr/libexec/qemu-kvm -nodefaults -M pc -m 4G -cpu Opteron_G3 -smp 4,cores=2,threads=2,sockets=1 -boot menu=on -monitor stdio -rtc base=localtime,clock=host,driftfix=slew -qmp tcp:0:5555,server,nowait -vga qxl -drive file=/home/rhel7base.qcow2,format=qcow2,id=guest-img,if=none,werror=stop,rerror=stop -device virtio-blk-pci,scsi=off,drive=guest-img,id=os-disk -spice disable-ticketing,port=5931 -device virtio-balloon,id=balloon -netdev tap,id=hostnet0,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown -device e1000,netdev=hostnet0,id=net0,mac=00:1a:4a:42:0b:00 \
-device vfio-pci,host=01:10.0,id=vf0,multifunction=on,addr=0x07.0 \
-device vfio-pci,host=01:10.1,id=vf1,multifunction=on,addr=0x07.1 \
-device vfio-pci,host=01:10.2,id=vf2,multifunction=on,addr=0x07.2

2. check VFs via hmp.
(qemu) info pci
(qemu) info qtree

3. check VFs device on guest.
# lspci | grep 07

Actual results:
after step2, could found all VFs.
(qemu) info pci
...
  Bus  0, device   7, function 0:
    Ethernet controller: PCI device 8086:10ca
      BAR0: 64 bit memory at 0xfc050000 [0xfc053fff].
      BAR3: 64 bit memory at 0xfc054000 [0xfc057fff].
      id "vf0"
  Bus  0, device   7, function 1:
    Ethernet controller: PCI device 8086:10ca
      BAR0: 64 bit memory at 0xffffffffffffffff [0x00003ffe].
      BAR3: 64 bit memory at 0xffffffffffffffff [0x00003ffe].
      id "vf1"
  Bus  0, device   7, function 2:
    Ethernet controller: PCI device 8086:10ca
      BAR0: 64 bit memory at 0xffffffffffffffff [0x00003ffe].
      BAR3: 64 bit memory at 0xffffffffffffffff [0x00003ffe].
      id "vf2"
...

(qemu) info qtree
bus: main-system-bus
  type System
  dev: kvm-ioapic, id ""
    gpio-in 24
    gsi_base = 0
    irq 0
    mmio 00000000fec00000/0000000000001000
  dev: i440FX-pcihost, id ""
    irq 0
    bus: pci.0
      type PCI
      dev: vfio-pci, id "vf2"
        host = 0000:01:10.2
        x-intx-mmap-timeout-ms = 1100
        x-vga = off
        bootindex = -1
        addr = 07.2
        romfile = <null>
        rombar = 1
        multifunction = on
        command_serr_enable = on
        class Ethernet controller, addr 00:07.2, pci id 8086:10ca (sub 8086:a03c)
        bar 0: mem at 0xffffffffffffffff [0x3ffe]
        bar 3: mem at 0xffffffffffffffff [0x3ffe]
      dev: vfio-pci, id "vf1"
        host = 0000:01:10.1
        x-intx-mmap-timeout-ms = 1100
        x-vga = off
        bootindex = -1
        addr = 07.1
        romfile = <null>
        rombar = 1
        multifunction = on
        command_serr_enable = on
        class Ethernet controller, addr 00:07.1, pci id 8086:10ca (sub 8086:a03c)
        bar 0: mem at 0xffffffffffffffff [0x3ffe]
        bar 3: mem at 0xffffffffffffffff [0x3ffe]
      dev: vfio-pci, id "vf0"
        host = 0000:01:10.0
        x-intx-mmap-timeout-ms = 1100
        x-vga = off
        bootindex = -1
        addr = 07.0
        romfile = <null>
        rombar = 1
        multifunction = on
        command_serr_enable = on
        class Ethernet controller, addr 00:07.0, pci id 8086:10ca (sub 8086:a03c)
        bar 0: mem at 0xfc050000 [0xfc053fff]
        bar 3: mem at 0xfc054000 [0xfc057fff]
...

after step3, could only found one VF.
# lspci | grep 07
00:07.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)

Expected results:
can find all VFs on guest.

Additional info:

Comment 2 Xu Han 2013-11-12 03:41:26 UTC
Created attachment 822744 [details]
host dmesg

found '[ 2723.891847] AMD-Vi: Event logged [IO_PAGE_FAULT device=01:10.0 domain=0x0019 address=0x000000014f507000 flags=0x0020]' such message in host dmesg.

Comment 3 Miroslav Rezanina 2013-11-28 07:36:38 UTC
Fix included in qemu-kvm-1.5.3-20.el7

Comment 5 Xu Han 2013-12-12 03:26:03 UTC
Verify this bug with component:
qemu-kvm-1.5.3-21.el7.x86_64
------
Steps:
1. boot guest with 82576 VFs use multifunction.
# /usr/libexec/qemu-kvm ... \
-device vfio-pci,host=01:10.0,id=vf0,multifunction=on,addr=0x07.0 \
-device vfio-pci,host=01:10.1,id=vf1,multifunction=on,addr=0x07.1 \
-device vfio-pci,host=01:10.2,id=vf2,multifunction=on,addr=0x07.2

2. check VFs via hmp.
(qemu) info pci
(qemu) info qtree

3. check VFs device on guest.
# lspci | grep 07
------
Results:
After step2, 
(qemu) info pci
...
  Bus  0, device   7, function 0:
    Ethernet controller: PCI device 8086:10ca
      BAR0: 64 bit memory at 0xfc010000 [0xfc013fff].
      BAR3: 64 bit memory at 0xfc014000 [0xfc017fff].
      id "vf0"
  Bus  0, device   7, function 1:
    Ethernet controller: PCI device 8086:10ca
      BAR0: 64 bit memory at 0xfc018000 [0xfc01bfff].
      BAR3: 64 bit memory at 0xfc01c000 [0xfc01ffff].
      id "vf1"
  Bus  0, device   7, function 2:
    Ethernet controller: PCI device 8086:10ca
      BAR0: 64 bit memory at 0xfc020000 [0xfc023fff].
      BAR3: 64 bit memory at 0xfc024000 [0xfc027fff].
      id "vf2"
...

(qemu) info qtree
...
  dev: i440FX-pcihost, id ""
    irq 0
    bus: pci.0
      type PCI
      dev: vfio-pci, id "vf2"
        host = 0000:01:10.2
        x-intx-mmap-timeout-ms = 1100
        x-vga = off
        bootindex = -1
        addr = 07.2
        romfile = <null>
        rombar = 1
        multifunction = on
        command_serr_enable = on
        class Ethernet controller, addr 00:07.2, pci id 8086:10ca (sub 8086:a03c)
        bar 0: mem at 0xfc020000 [0xfc023fff]
        bar 3: mem at 0xfc024000 [0xfc027fff]
      dev: vfio-pci, id "vf1"
        host = 0000:01:10.1
        x-intx-mmap-timeout-ms = 1100
        x-vga = off
        bootindex = -1
        addr = 07.1
        romfile = <null>
        rombar = 1
        multifunction = on
        command_serr_enable = on
        class Ethernet controller, addr 00:07.1, pci id 8086:10ca (sub 8086:a03c)
        bar 0: mem at 0xfc018000 [0xfc01bfff]
        bar 3: mem at 0xfc01c000 [0xfc01ffff]
      dev: vfio-pci, id "vf0"
        host = 0000:01:10.0
        x-intx-mmap-timeout-ms = 1100
        x-vga = off
        bootindex = -1
        addr = 07.0
        romfile = <null>
        rombar = 1
        multifunction = on
        command_serr_enable = on
        class Ethernet controller, addr 00:07.0, pci id 8086:10ca (sub 8086:a03c)
        bar 0: mem at 0xfc010000 [0xfc013fff]
        bar 3: mem at 0xfc014000 [0xfc017fff]
...

After step3, could found all VFs in guest.
# lspci | grep 07
00:07.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
00:07.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
00:07.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
------
Base on these test results above, this bug has been fixed.

Comment 7 Ludek Smid 2014-06-13 11:34:09 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.