From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXfpu-000701-3X for qemu-devel@nongnu.org; Sun, 11 Nov 2012 17:17:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXfpr-00012h-1N for qemu-devel@nongnu.org; Sun, 11 Nov 2012 17:17:02 -0500 Received: from mail-vb0-f45.google.com ([209.85.212.45]:42277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXfpq-00012S-Rh for qemu-devel@nongnu.org; Sun, 11 Nov 2012 17:16:58 -0500 Received: by mail-vb0-f45.google.com with SMTP id p1so5449873vbi.4 for ; Sun, 11 Nov 2012 14:16:57 -0800 (PST) Date: Sun, 11 Nov 2012 17:16:51 -0500 From: "Gabriel L. Somlo" Message-ID: <20121111221650.GA3575@foober.ini.cmu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] q35, usb-ehci1, and Mac OS X boot problems List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: rene@exactcode.com, jbaron@redhat.com, agraf@suse.de Hi, I'm testing OS X on the q35 tree, and it seems to work quite nicely so far. However, with the addition of "usb-ehci1" in the latest round of updates, I've started experiencing hangs during OS X boot. First, what works: With the following command line (usb items on the last line): bin/qemu-system-x86_64 -enable-kvm -m 2048 -cpu core2duo \ -M q35 -L q35-seabios/out -monitor stdio \ -device isa-applesmc,osk="our......Inc" \ -kernel ./Chameleon_RC5_Trunk_Binaries_r668/i386/boot \ -netdev user,id=hub0port0 -device e1000,netdev=hub0port0,id=eth0 \ -device ide-drive,bus=ide.0,drive=MacHDD \ -drive id=MacHDD,if=none,snapshot=on,file=./mac_10.6.img \ -device ich9-usb-uhci1 -device usb-kbd -device usb-mouse I get a working OS X guest, with the following USB related bits in 'info qtree': ... dev: gmch-pcihost, id "" MCFG = 2952790016 irq 0 bus: pcie.0 type PCI dev: ich9-usb-uhci1, id "" masterbus = firstport = 0 bandwidth = 1280 addr = 03.0 romfile = rombar = 1 multifunction = off command_serr_enable = on class USB controller, addr 00:03.0, pci id 8086:2934 (sub 1af4:1100) bar 4: i/o at 0xc040 [0xc05f] bus: usb-bus.0 type usb-bus dev: usb-hub, id "" port = full-path = on addr 0.3, port 2, speed 12, name QEMU USB Hub, attached dev: usb-mouse, id "" port = full-path = on addr 0.4, port 2.1, speed 12, name QEMU USB Mouse, attached dev: usb-kbd, id "" port = full-path = on addr 0.2, port 1, speed 12, name QEMU USB Keyboard, attached ... If I replace: -device ich9-usb-uhci1 -device usb-kbd -device usb-mouse with the generic default: -usb -device usb-kbd -device usb-mouse I get a hang at boot time. OS X (SnowLeopard) prints the following USB-related warning/error to its console: USBF: 2.557 AppleUSBEHCI[0xffffff80056c5000]::CheckSleepCapability - controller will be unloaded across sleep The following USB bits show up in 'info qtree': ... dev: gmch-pcihost, id "" MCFG = 2952790016 irq 0 bus: pcie.0 type PCI ... dev: ich9-usb-uhci3, id "" masterbus = "usb-bus.0" firstport = 4 bandwidth = 1280 addr = 1d.2 romfile = rombar = 1 multifunction = on command_serr_enable = on class USB controller, addr 00:1d.2, pci id 8086:2936 (sub 1af4:1100) bar 4: i/o at 0xc080 [0xc09f] dev: ich9-usb-uhci2, id "" masterbus = "usb-bus.0" firstport = 2 bandwidth = 1280 addr = 1d.1 romfile = rombar = 1 multifunction = on command_serr_enable = on class USB controller, addr 00:1d.1, pci id 8086:2935 (sub 1af4:1100) bar 4: i/o at 0xc060 [0xc07f] dev: ich9-usb-uhci1, id "" masterbus = "usb-bus.0" firstport = 0 bandwidth = 1280 addr = 1d.0 romfile = rombar = 1 multifunction = on command_serr_enable = on class USB controller, addr 00:1d.0, pci id 8086:2934 (sub 1af4:1100) bar 4: i/o at 0xc040 [0xc05f] dev: ich9-usb-ehci1, id "" maxframes = 128 addr = 1d.7 romfile = rombar = 1 multifunction = on command_serr_enable = on class USB controller, addr 00:1d.7, pci id 8086:293a (sub 1af4:1100) bar 0: mem at 0xfebf1000 [0xfebf1fff] bus: usb-bus.0 type usb-bus dev: usb-mouse, id "" port = full-path = on addr 0.0, port 2, speed 12, name QEMU USB Mouse, attached dev: usb-kbd, id "" port = full-path = on addr 0.0, port 1, speed 12, name QEMU USB Keyboard, attached Note how both the keyboard and mouse are now under 'ehci1', rather than under one of the 'uhci' entries, e.g. uhci1 like in the working example earlier on. When I try to start with ehci1 only, with the following USB command line items: -device ich9-usb-ehci1 -device usb-kbd -device usb-mouse I get an error from qemu: speed mismatch trying to attach usb device QEMU USB Keyboard to bus usb-bus.0 The simple presence of EHCI1 as configured by "-device ich9-usb-ehci1" will prevent OS X from booting (with the above-mentioned "controller will be unloaded across sleep" warning). If added all by itself, it looks like this in qtree: ... dev: gmch-pcihost, id "" MCFG = 2952790016 irq 0 bus: pcie.0 type PCI dev: ich9-usb-ehci1, id "" maxframes = 128 addr = 03.0 romfile = rombar = 1 multifunction = off command_serr_enable = on class USB controller, addr 00:03.0, pci id 8086:293a (sub 1af4:1100) bar 0: mem at 0xfebf1000 [0xfebf1fff] bus: usb-bus.0 type usb-bus ... I don't know if/how I can tell '-device usb-kbd' to connect under usb-uhci1 specifically (in the case where both ehci1 and uhci[1-3] are present), so I did not have a chance to try that. I wonder what specifically about the way ehci1 is added to the device tree make it not work properly on OS X -- any ideas for what may be wrong, or what else I may try, would be much appreciated ! Thanks, --Gabriel PS. For comparison with some real Apple hardware, here are the usb bits from lspci on an old first-generation MacBookPro from 2006: 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) (prog-if 00 [UHCI]) Subsystem: Intel Corporation Device 7270 Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR-