From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A87B91A1E3E for ; Tue, 6 Sep 2016 00:48:25 -0700 (PDT) Received: by mail-oi0-x232.google.com with SMTP id m11so148405634oif.1 for ; Tue, 06 Sep 2016 00:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FB9X75k4Ed1ooXAPykGegvFKPSKU8SLlnVfv8xffoPE=; b=OIfK7HSUi6/eqtHfthK1oziCxs2Ml3I6mCajAG18jdd2ry/36g3/WLi1KQd0/Rf8H4 sld1cgu5hSxkqIaakJYGQCjhkwoIJGgrRaLIPXd+9tmGEvnPYIzDyjW0w98c2voa3tjB r/6AL9dpI9Z9h/mMqX9POxq+KqvRmEkdo+HBI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FB9X75k4Ed1ooXAPykGegvFKPSKU8SLlnVfv8xffoPE=; b=WoWGRzatITOEwJ2oB7AcP6etpW2+CQPA6uUss9Nesp1otWeGMPoynvd4pyTBD9j3+s 04pMJ36N2DbDw88pmL3UO5oAYUfOdxl2iEBCq+FQSchyH9k1/pC0ZtiL78qanEozT1OS Yu+6KnXNw9jFz0dFiW9mUUaRiQ2XUxe1v/rIfWxf6svibNECNEoqgccGua37n2+F7tXp EUB5ITTtKLGxnOIBR5kwLfL2mDTjF8Y+aKJQqUzlnbAy3/R9fqGK3QYcHa0fBLUX/2JQ U4wa7m/lp+Cl48Z4ivaF5ykIzBkuvtomZGID2rHWziJfIXjqg9n9luEYaY8j6Fm5IW8T NB9Q== X-Gm-Message-State: AE9vXwOuTOjnHCVZuyuuBBVSXtSdd4hNeEtb+hacTIC+rJuleAW3h6LUP25itr8oZ21GweDRsNHmYQh+/xNeWEO4 X-Received: by 10.107.155.140 with SMTP id d134mr3821933ioe.56.1473148104684; Tue, 06 Sep 2016 00:48:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.204.195 with HTTP; Tue, 6 Sep 2016 00:48:24 -0700 (PDT) In-Reply-To: <1473067049-16252-1-git-send-email-ard.biesheuvel@linaro.org> References: <1473067049-16252-1-git-send-email-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Tue, 6 Sep 2016 08:48:24 +0100 Message-ID: To: edk2-devel-01 , "Tian, Feng" , "Zeng, Star" , "Gao, Liming" Cc: Laszlo Ersek , Leif Lindholm , Ard Biesheuvel Subject: Re: [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA 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: Tue, 06 Sep 2016 07:48:25 -0000 Content-Type: text/plain; charset=UTF-8 Feng, Star: do you have any feedback on these patches? Thanks. On 5 September 2016 at 10:17, Ard Biesheuvel wrote: > After moving ArmVirtQemu to the generic PciHostBridgeDxe, we noticed that > setting DmaAbove4G resulted in problems with the emulated EHCI USB host > controller, which were caused by the fact that the PCI layer was providing > DMA buffers allocated above 4 GB while the emulated EHCI controller in QEMU > does not indicate support for 64-bit addressing. > > As it turns out, the PCI drivers in MdeModulePkg *completely* ignore the > EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute, and simply assume that no > PCI root bridge driver will produce mappings above 4 GB. On ARM, this is > problematic, since not all platforms have memory below 4 GB, and so having > full support for DMA above 4 GB is indispensable. > > So first, make the various drivers under MdeModulePkg/Pci/Bus set the > EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE attributes for devices that can > support 64-bit DMA addressing (patches #1 - #5). Then, we can update the > host bridge driver to actually take these attributes into account, and only > create mappings above 4 GB for devices that have indicated support for it. > > Finally, in patch #7 we can remove the 4 GB DMA limit from ArmVirtPkg. > > Branch can be found here: > https://git.linaro.org/people/ard.biesheuvel/uefi-next.git/shortlog/refs/heads/pci-64bit-dma-fixes > > Ard Biesheuvel (7): > MdeModulePkg/AtaAtapiPassThru: enable 64-bit PCI DMA > MdeModulePkg/EhciDxe: enable 64-bit PCI DMA > MdeModulePkg/NvmExpressDxe: enable 64-bit PCI DMA > MdeModulePkg/SdMmcPciHcDxe: enable 64-bit PCI DMA > MdeModulePkg/XhciDxe: enable 64-bit PCI DMA > MdeModulePkg/PciHostBridgeDxe: restrict 64-bit DMA to devices that > support it > ArmVirtPkg/FdtPciHostBridgeLib: enable 64-bit PCI DMA > > ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 2 +- > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 20 +++++++++++++++++- > MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c | 22 +++++++++++++++++++- > MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h | 2 ++ > MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 2 +- > MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 13 ++++++++++++ > MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 14 +++++++++---- > MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 20 ++++++++++++++++++ > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 22 +++++++++++++++++++- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h | 2 ++ > 10 files changed, 110 insertions(+), 9 deletions(-) > > -- > 2.7.4 >