Bug 729104 - qemu-kvm: pci needs multifunction property
Summary: qemu-kvm: pci needs multifunction property
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 694555 731845 (view as bug list)
Depends On:
Blocks: 701790 704634 705085
TreeView+ depends on / blocked
 
Reported: 2011-08-08 17:55 UTC by Gerd Hoffmann
Modified: 2013-11-18 19:27 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.180.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 15:55:33 UTC


Attachments (Terms of Use)
qemu config file, ich9 usb (828 bytes, text/plain)
2011-08-09 05:49 UTC, Gerd Hoffmann
no flags Details
multifunction support for virtio (10.11 KB, text/plain)
2011-11-29 08:14 UTC, IBM Bug Proxy
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1531 normal SHIPPED_LIVE Moderate: qemu-kvm security, bug fix, and enhancement update 2011-12-06 01:23:30 UTC

Description Gerd Hoffmann 2011-08-08 17:55:26 UTC
Description of problem:

Sidestepping the missing multifunction property in RHEL-6 with some magic was vetoed in patch review, so I'm going to backport the patches which implement the multifunction property instead.

Comment 3 juzhang 2011-08-09 02:05:26 UTC
Hi,Gerd

   Would you please provide efficient way for qe reproduce and verify this issue?the more details,the better,thanks

Comment 4 Gerd Hoffmann 2011-08-09 05:49:28 UTC
Created attachment 517347 [details]
qemu config file, ich9 usb

Comment 5 Gerd Hoffmann 2011-08-09 05:54:50 UTC
All pci devices in qemu get a new property named "multifunction".  This can be used to create --for example -- multifunction usb controllers.

qemu $usualoptions -readconfig ich9-ehci-uhci.cfg
                               ^^^^^^^^^^^^^^^^^^ comment #4 attachment

will create such a controller in slot 1d.  Inside the (linux) guest it will look like this:

[root@rhel6 ~]# lspci -s 1d
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)

Comment 9 juzhang 2011-09-01 04:49:25 UTC
Can reproduce this issue with qemu-kvm-0.12.1.2-2.179.el6.

Steps:
1. boot guest with usb-ehci enable multifunction
/qemu-kvm ...............
-device usb-ehci,id=echi,multifunction=on

Results:
qemu-kvm: -device usb-ehci,id=echi,multifunction=on: Property 'usb-ehci.multifunction' not found

Verified this issue with qemu-kvm-0.12.1.2-2.184.el6

I tried two scenarios.

1. 8 usb controller & usb-hub.
1.1#cat test.cfg

[device "ehci"]
  driver = "ich9-usb-ehci1"
  addr = "1d.7"
  multifunction = "on"

[device "uhci-1"]
  driver = "ich9-usb-uhci1"
  addr = "1d.0"
  multifunction = "on"
  masterbus = "ehci.0"
  firstport = "0"

[device "uhci-2"]
  driver = "ich9-usb-uhci2"
  addr = "1d.1"
  multifunction = "on"
  masterbus = "ehci.0"
  firstport = "2"

[device "uhci-3"]
  driver = "ich9-usb-uhci3"
  addr = "1d.2"
  multifunction = "on"
  masterbus = "ehci.0"
  firstport = "4"

[device "uhci-4"]
  driver = "ich9-usb-uhci1"
  addr = "1d.3"
  multifunction = "on"

[device "uhci-5"]
  driver = "ich9-usb-uhci2"
  addr = "1d.4"
  multifunction = "on"

[device "uhci-6"]
  driver = "ich9-usb-uhci3"
  addr = "1d.5"
  multifunction = "on"

[device "uhci-7"]
  driver = "ich9-usb-uhci2"
  addr = "1d.6"
  multifunction = "on"
1.2 boot guest with test.cfg and usb-hub
#

Resutls:
in gust
#lspci -s 1d
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.3 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.4 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.5 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.6 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)

#lsusb 
lsusb 
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0000:0000  
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub



2.more than 8 pci devices(usb controller)

Results:
*** EHCI support is under development ***
qemu-kvm:aa.cfg:59: Property 'ich9-usb-uhci2.addr' doesn't take value '1d.8'


This issue has been fixed

Comment 11 Nandini Chandra 2011-09-19 18:49:33 UTC
I've verified that with qemu-kvm-0.12.1.2-2.180,I can assign multiple functions of a dual-port Broadcom NetXtreme II BCM5709 Gigabit Ethernet (rev 20) to a RHEL 6 guest on RHEL 6.1 host.I was not able to assign multiple functions of the NIC with older versions of qemu-kvm.


lspci output from Host
----------------------
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
-----------------------

Command line used to start the guest:
/usr/libexec/qemu-kvm -m 1024 -name "RHEL6_com" -drive file=rhel6.1.qcow2,if=virtio -usb -usbdevice tablet -net nic,model=virtio,macaddr=00:16:3E:71:1E:A2 -net tap,ifname=tap1,script=no,downscript=no -device pci-assign,host=02:00.0,multifunction=on,addr=5.0 -device pci-assign,host=02:00.1,addr=5.1 -vnc :0


lspci output from guest
----------------------
00:05.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
00:05.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
-----------------------

On the guest,this is how the functions get mapped:
02:00.0 ->00:05.0
02:00.1 ->00:05.1

Comment 12 juzhang 2011-11-29 08:07:52 UTC
*** Bug 694555 has been marked as a duplicate of this bug. ***

Comment 13 IBM Bug Proxy 2011-11-29 08:14:08 UTC
Created attachment 537810 [details]
multifunction support for virtio

Comment 14 errata-xmlrpc 2011-12-06 15:55:33 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHSA-2011-1531.html

Comment 15 Ronen Hod 2011-12-18 09:13:43 UTC
*** Bug 731845 has been marked as a duplicate of this bug. ***

Comment 16 IBM Bug Proxy 2011-12-19 15:58:56 UTC
------- Comment From mcintire@us.ibm.com 2011-12-19 10:34 EDT-------
IBM is also closing this feature since it is in 6.2


Note You need to log in before you can comment on or make changes to this bug.