From patchwork Fri Oct 26 20:24:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Baron X-Patchwork-Id: 194564 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1DFC32C00A4 for ; Sat, 27 Oct 2012 07:24:57 +1100 (EST) Received: from localhost ([::1]:55845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRqSd-0000mO-8Z for incoming@patchwork.ozlabs.org; Fri, 26 Oct 2012 16:24:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRqSW-0000mE-Pu for qemu-devel@nongnu.org; Fri, 26 Oct 2012 16:24:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRqSV-0000Dg-MQ for qemu-devel@nongnu.org; Fri, 26 Oct 2012 16:24:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRqSV-0000DO-E8 for qemu-devel@nongnu.org; Fri, 26 Oct 2012 16:24:47 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9QKOjcu007922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Oct 2012 16:24:45 -0400 Received: from redhat.com (dhcp-185-114.bos.redhat.com [10.16.185.114]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9QKOjS2030566; Fri, 26 Oct 2012 16:24:45 -0400 Date: Fri, 26 Oct 2012 16:24:44 -0400 From: Jason Baron To: "Gabriel L. Somlo" Message-ID: <20121026202444.GA25597@redhat.com> References: <20121024145527.GB2107@hedwig.ini.cmu.edu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121024145527.GB2107@hedwig.ini.cmu.edu> User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, kraxel@redhat.com, qemu-devel@nongnu.org, hdegoede@redhat.com Subject: Re: [Qemu-devel] q35: usb keyboard trouble X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Wed, Oct 24, 2012 at 10:55:28AM -0400, Gabriel L. Somlo wrote: > Jason, > > Commit d8b0dbdba325773469733222a167b54aca74de55 in the q35 tree breaks > '-usbdevice keyboard' for me. Instead of being able to type at the VM, > none of the keypresses make it through, and qemu stderr soon starts > logging this error: "usb-kbd: warning: key event queue full". > > Specifically, it's the introduction of ich9-usb-ehci1 that causes the > issue (in hw/pc_q35.c, line 197): > > + pci_create_simple_multifunction( > + host_bus, PCI_DEVFN(ICH9_USB_DEV, ICH9_USB_EHCI1_FUNC), > + true, "ich9-usb-ehci1"); > > Commenting out the above makes the problem go away. > > Thanks much, > --Gabriel > > Thanks for the bug report! What OS are you running? I'm not seeing any issue with -usbdevice keyboard on Fedora. Paolo pointed out that I was missing some ich9 specific initialization from docs/ich9-ehci-uhci.cfg. I've added that in the patch below. I have no idea if that will resolve this issue for you. Thanks, -Jason diff --git a/hw/pc_q35.c b/hw/pc_q35.c index a72ad36..22b72ed 100644 --- a/hw/pc_q35.c +++ b/hw/pc_q35.c @@ -200,20 +200,27 @@ static void pc_q35_init_late(BusState **idebus, ISADevice *rtc_state, idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1"); if (usb_enabled) { + int i; + PCIDevice *usb; + DeviceState *usb_qdev; + /* Should we create 6 UHCI according to ich9 spec? */ - pci_create_simple_multifunction( - host_bus, PCI_DEVFN(ICH9_USB_DEV, ICH9_USB_UHCI1_FUNC), - true, "ich9-usb-uhci1"); - pci_create_simple_multifunction( - host_bus, PCI_DEVFN(ICH9_USB_DEV, ICH9_USB_UHCI2_FUNC), - true, "ich9-usb-uhci2"); - pci_create_simple_multifunction( - host_bus, PCI_DEVFN(ICH9_USB_DEV, ICH9_USB_UHCI3_FUNC), - true, "ich9-usb-uhci3"); - pci_create_simple_multifunction( + usb = pci_create_multifunction( host_bus, PCI_DEVFN(ICH9_USB_DEV, ICH9_USB_EHCI1_FUNC), true, "ich9-usb-ehci1"); - /* XXX: EHCI */ + usb_qdev = &usb->qdev; + usb_qdev->id = g_strdup("ich9-usb-bus"); + qdev_init_nofail(usb_qdev); + + for (i = 0; i < 3; i++) { + usb = pci_create_multifunction( + host_bus, PCI_DEVFN(ICH9_USB_DEV, ICH9_USB_UHCI1_FUNC + i), + true, "ich9-usb-uhci1"); + usb_qdev = &usb->qdev; + qdev_prop_set_string(usb_qdev, "masterbus", "ich9-usb-bus.0"); + qdev_prop_set_uint32(usb_qdev, "firstport", i * 2); + qdev_init_nofail(usb_qdev); + } } /* TODO: Populate SPD eeprom data. */