Bug 1181409
Summary: | PCI pass-through device works improperly due to the PHB's index being set to a big value | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Xu Han <xuhan> |
Component: | qemu-kvm-rhev | Assignee: | David Gibson <dgibson> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.1 | CC: | dgibson, hhuang, knoel, michen, ngu, sherold, virt-maint, ypu, zhengtli |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | ppc64 | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | qemu-kvm-rhev-2.2.0-8.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-12-04 16:25:15 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: |
Description
Xu Han
2015-01-13 06:08:42 UTC
Also tested with a negative value (-0x4000), the device didnot functioned well either. PCI info (part): ---------------- # lspci -vvv -s 0001:00:01.0 0001:00:01.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02) (prog-if 30 [XHCI]) Subsystem: IBM Device 04b2 Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Interrupt: pin A routed to IRQ 19 Region 0: Memory at fffc0100b0000000 (64-bit, non-prefetchable) [size=64K] Region 2: Memory at fffc0100b0010000 (64-bit, non-prefetchable) [size=8K] ... Qtree info: ----------- dev: spapr-pci-vfio-host-bridge, id "vfiohost" iommu = 3 (0x3) index = -16384 (0xffffffffffffc000) buid = 576460752840278016 (0x80000001fffc000) liobn = 2147467264 (0x7fffc000) mem_win_addr = -1124797710860288 (0xfffc0100a0000000) mem_win_size = 536870912 (0x20000000) io_win_addr = -1124798247731200 (0xfffc010080000000) io_win_size = 65536 (0x10000) irq 0 bus: vfiohost.0 type PCI dev: vfio-pci, id "" host = "0003:03:00.0" x-intx-mmap-timeout-ms = 1100 (0x44c) x-vga = false bootindex = -1 (0xffffffffffffffff) addr = 01.0 romfile = "" rombar = 1 (0x1) multifunction = false command_serr_enable = true class USB controller, addr 00:01.0, pci id 104c:8241 (sub 1014:04b2) bar 0: mem at 0x90000000 [0x9000ffff] bar 2: mem at 0x90010000 [0x90011fff] Ok, it's expected that such large (or negative) index values won't work. But qemu should provide a better error message. I'll work on this upstream. I'm still working on this upstream, but I've made a preliminary downstream build here: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=8523816 That should give a proper error message for out-of-range index values. Can you give that a test, please? (In reply to David Gibson from comment #4) > I'm still working on this upstream, but I've made a preliminary downstream > build here: > > http://brewweb.devel.redhat.com/brew/taskinfo?taskID=8523816 > > That should give a proper error message for out-of-range index values. > > Can you give that a test, please? Have made following tests. Step: # ./qemu-kvm ... \ -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=3,index={ 0x4000 | 0xff | 0x100 | -0x1 | 0x100000000 } \ -device vfio-pci,host=0003:03:00.0,bus=vfiohost.0,addr=0x1 Results: [index=0x4000]: qemu-kvm: -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=3,index=0x4000: "index" for PAPR PHB is too large (max 255) qemu-kvm: -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=3,index=0x4000: Device 'spapr-pci-vfio-host-bridge' could not be initialized [index=0xff]: # lspci -vvv -s 0001:00:01.0 0001:00:01.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02) (prog-if 30 [XHCI]) Subsystem: IBM Device 04b2 ... Kernel driver in use: xhci_hcd [index=0x100]: qemu-kvm: -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=3,index=0x100: "index" for PAPR PHB is too large (max 255) qemu-kvm: -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=3,index=0x100: Device 'spapr-pci-vfio-host-bridge' could not be initialized [index=-0x1]: qemu-kvm: -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=3,index=-0x1: Parameter 'index' expects uint32_t [index=0x100000000]: qemu-kvm: -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=3,index=0x100000000: Parameter 'index' expects uint32_t Thanks. Upstream patch posted at http://lists.gnu.org/archive/html/qemu-devel/2015-01/msg01540.html Fix included in qemu-kvm-rhev-2.2.0-8.el7 Reproduced the problem with the envs below: Host: 3.10.0-295.el7.ppc64 qemu-kvm-rhev-2.1.2-21.el7 And passed with envs: Host: 3.10.0-295.el7.ppc64 qemu-kvm-rhev-2.3.0-2.el7 [root@ibm-p8-rhevm-15 ~]# sh boot.sh QEMU 2.3.0 monitor - type 'help' for more information (qemu) 2015-08-07T06:05:35.129717Z qemu-kvm: -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=2,index=0x4000: "index" for PAPR PHB is too large (max 255) 2015-08-07T06:05:35.129752Z qemu-kvm: -device spapr-pci-vfio-host-bridge,id=vfiohost,iommu=2,index=0x4000: Device 'spapr-pci-vfio-host-bridge' could not be initialized So I think the bug is verified 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. https://rhn.redhat.com/errata/RHBA-2015-2546.html |