From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 2132C1A1E27 for ; Mon, 5 Sep 2016 02:17:45 -0700 (PDT) Received: by mail-wm0-x233.google.com with SMTP id 1so127694226wmz.1 for ; Mon, 05 Sep 2016 02:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=XjoGSvR6Dxxka2zLIBiDJoKWajStcn/X2XbbtkdnnU8=; b=A5BiOWogMuMBEY0Wn9aX/J5QogAxQYrtupzfbzgvUTN+BJZy5Cgm0ayLSi+UnZg4pV ekRncgAkFF7YPT3f/5PV7W8NInOngzfAfbUJcHOtM320vnLNDRIZr1wMl6lq+TMeaV7e S9+AVJY9ygFA3OJnEVfclQABy1hulKZ15h70Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XjoGSvR6Dxxka2zLIBiDJoKWajStcn/X2XbbtkdnnU8=; b=E2y0j5OOGJwhv85uU7QXiEBXdUbcGTV6Hr+MPd5EsibW7cYbhR55dlGGXjzFxTRIH7 6Oplena4zImBd75j3Y3q3NCQz78fBcrm168lwcaqFftKgOsZK/ovpsICoP6O2UPaiZBS SYniJl26zwken6Dsp8+6xjkco/h2vTDKxc6lWbKcdGRRAfc5LEka/8al7vwg+x+7pF+f RrXsBNOPw28shU74HKtckFi0DI1mdItYRqPFZvRU2TFTwTO42ML0LcUft1litiz7vfS7 FOORxc4PvE8ExlJRgQpDfqW13Bx5njjxim/efDeSqee7pYJgUBDZrfugTXxEYqZqUdHi EdAA== X-Gm-Message-State: AE9vXwOZJ9D7x19vIKwwvLhxvwKImIjNHK0jWwti+xCVnwV5+1m8FcKe93IAT50d89MiHETU X-Received: by 10.194.21.229 with SMTP id y5mr30652371wje.170.1473067063650; Mon, 05 Sep 2016 02:17:43 -0700 (PDT) Received: from localhost.localdomain ([197.130.133.164]) by smtp.gmail.com with ESMTPSA id m133sm10157457wmg.0.2016.09.05.02.17.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Sep 2016 02:17:42 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, feng.tian@intel.com, star.zeng@intel.com, liming.gao@intel.com Cc: lersek@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel Date: Mon, 5 Sep 2016 10:17:22 +0100 Message-Id: <1473067049-16252-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [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: Mon, 05 Sep 2016 09:17:45 -0000 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