From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 246FF1A1E06 for ; Fri, 2 Sep 2016 08:27:34 -0700 (PDT) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9666D43A37; Fri, 2 Sep 2016 15:27:33 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-76.phx2.redhat.com [10.3.116.76]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u82FRWnC016887; Fri, 2 Sep 2016 11:27:32 -0400 To: Ard Biesheuvel References: <1472666379-25426-1-git-send-email-ard.biesheuvel@linaro.org> <207F4239-0958-4A0E-9DAA-36ABB56E7BB7@linaro.org> Cc: edk2-devel@ml01.01.org, leif.lindholm@linaro.org From: Laszlo Ersek Message-ID: Date: Fri, 2 Sep 2016 17:27:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <207F4239-0958-4A0E-9DAA-36ABB56E7BB7@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 02 Sep 2016 15:27:33 +0000 (UTC) Subject: Re: [PATCH v2 0/6] ArmVirtQemu: move to generic PciHostBridgeDxe X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 15:27:34 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 09/02/16 16:58, Ard Biesheuvel wrote: > (on the road atm, will reply in full later) > >> On 2 sep. 2016, at 14:09, Laszlo Ersek wrote: >> (2) aarch64 KVM, using virtio-gpu-pci and USB 2 keyboard and >> tablet. I actually booted a Fedora 24 guest with this, and in the >> guest, everything works just fine (display, keyboard, >> mouse/tablet). Most of the firmware log looks good too. >> >> (2a) However, the USB 2 keyboard is broken while in the firmware >> (in spite of it working well in the guest OS). >> >> -device ich9-usb-ehci1,multifunction=on,id=ehci,addr=05.0 \ >> -device ich9-usb-uhci1,multifunction=on,masterbus=ehci.0,firstport=0,addr=05.1 \ >> -device ich9-usb-uhci2,multifunction=on,masterbus=ehci.0,firstport=2,addr=05.2 \ >> -device ich9-usb-uhci3,multifunction=on,masterbus=ehci.0,firstport=4,addr=05.3 \ >> -device usb-kbd,bus=ehci.0 \ >> -device usb-tablet,bus=ehci.0 \ >> >> My QEMU has your commit 5d636e21c44e ("hw/arm/virt: mark the PCIe >> host controller as DMA coherent in the DT"), but I guess the EHCI >> driver in edk2 doesn't comply with the "guest drivers should use >> cacheable accesses as well when running under KVM" part. :( >> >> The following snippet repeats in the log: >> >> EhcClearLegacySupport: called to clear legacy support >> processing error - resetting ehci HC >> EhcInitHC: failed to enable period schedule >> EhcDriverBindingStart: failed to init host controller >> EhcCreateUsb2Hc: capability length 32 >> >> Interestingly, if I back out your series, then USB2 works in the >> firmware. I don't understand this, given that my build includes >> commit 3ef3209d3028 ("ArmVirtPkg: remove >> PcdKludgeMapPciMmioAsCached") from the master branch! >> > > Does it work when you limit DMA to < 4 GB? You are one wicked genius, man; the following change > diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c > index efccedcca14f..1f0f87cac8a9 100644 > --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c > +++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c > @@ -317,7 +317,7 @@ PciHostBridgeGetRootBridges ( > EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; > mRootBridge.Attributes = mRootBridge.Supports; > > - mRootBridge.DmaAbove4G = TRUE; > + mRootBridge.DmaAbove4G = FALSE; > mRootBridge.NoExtendedConfigSpace = FALSE; > mRootBridge.ResourceAssigned = FALSE; > does make it work! Excellent! Explain please. :) (Although, I'll look into PciHostBridgeDxe in a moment too. :)) Thank you! Laszlo