Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA
On 6 September 2016 at 13:41, Tian, Feng <feng.t...@intel.com> wrote: > ATA/USB/NVME/SD are ok to me > > Reviewed-by: Feng Tian <feng.t...@intel.com> > Thanks everyone Committed as a2c9b0873a77 MdeModulePkg/AtaAtapiPassThru: enable 64-bit PCI DMA 167c3fb45674 MdeModulePkg/EhciDxe: enable 64-bit PCI DMA 4e28ea2c29e0 MdeModulePkg/NvmExpressDxe: enable 64-bit PCI DMA df0a0e4b6fae MdeModulePkg/SdMmcPciHcDxe: enable 64-bit PCI DMA 5c1b371a8839 MdeModulePkg/XhciDxe: enable 64-bit PCI DMA e58a71d9c50b MdeModulePkg/PciHostBridgeDxe: restrict 64-bit DMA to devices that support it 4c0b2d25c61c ArmVirtPkg/FdtPciHostBridgeLib: enable 64-bit PCI DMA > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Tuesday, September 6, 2016 6:36 PM > To: Ni, Ruiyu <ruiyu...@intel.com> > Cc: edk2-devel-01 <edk2-devel@lists.01.org>; Tian, Feng > <feng.t...@intel.com>; Zeng, Star <star.z...@intel.com>; Gao, Liming > <liming@intel.com>; Laszlo Ersek <ler...@redhat.com>; Leif Lindholm > <leif.lindh...@linaro.org> > Subject: Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI > DMA > > On 6 September 2016 at 09:54, Ni, Ruiyu <ruiyu...@intel.com> wrote: >> Ard, >> The patch to MdeModulePkg/PciHostBridgeDxe is good. >> >> Reviewed-by: Ruiyu Ni <ruiyu...@intel.com> >> > > Thanks Ray! > > Who is responsible for the AtapPassThru, USB, NVME and SDHCI drivers? > >>> -Original Message- >>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf >>> Of Ard Biesheuvel >>> Sent: Tuesday, September 6, 2016 3:48 PM >>> To: edk2-devel-01 <edk2-devel@lists.01.org>; Tian, Feng >>> <feng.t...@intel.com>; Zeng, Star <star.z...@intel.com>; Gao, Liming >>> <liming@intel.com> >>> Cc: Laszlo Ersek <ler...@redhat.com>; Leif Lindholm >>> <leif.lindh...@linaro.org>; Ard Biesheuvel >>> <ard.biesheu...@linaro.org> >>> Subject: Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for >>> 64-bit PCI DMA >>> >>> Feng, Star: do you have any feedback on these patches? Thanks. >>> >>> On 5 September 2016 at 10:17, Ard Biesheuvel >>> <ard.biesheu...@linaro.org> >>> 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 >>> > /re >>> > fs/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
Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA
ATA/USB/NVME/SD are ok to me Reviewed-by: Feng Tian <feng.t...@intel.com> -Original Message- From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] Sent: Tuesday, September 6, 2016 6:36 PM To: Ni, Ruiyu <ruiyu...@intel.com> Cc: edk2-devel-01 <edk2-devel@lists.01.org>; Tian, Feng <feng.t...@intel.com>; Zeng, Star <star.z...@intel.com>; Gao, Liming <liming@intel.com>; Laszlo Ersek <ler...@redhat.com>; Leif Lindholm <leif.lindh...@linaro.org> Subject: Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA On 6 September 2016 at 09:54, Ni, Ruiyu <ruiyu...@intel.com> wrote: > Ard, > The patch to MdeModulePkg/PciHostBridgeDxe is good. > > Reviewed-by: Ruiyu Ni <ruiyu...@intel.com> > Thanks Ray! Who is responsible for the AtapPassThru, USB, NVME and SDHCI drivers? >> -Original Message- >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf >> Of Ard Biesheuvel >> Sent: Tuesday, September 6, 2016 3:48 PM >> To: edk2-devel-01 <edk2-devel@lists.01.org>; Tian, Feng >> <feng.t...@intel.com>; Zeng, Star <star.z...@intel.com>; Gao, Liming >> <liming@intel.com> >> Cc: Laszlo Ersek <ler...@redhat.com>; Leif Lindholm >> <leif.lindh...@linaro.org>; Ard Biesheuvel >> <ard.biesheu...@linaro.org> >> Subject: Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for >> 64-bit PCI DMA >> >> Feng, Star: do you have any feedback on these patches? Thanks. >> >> On 5 September 2016 at 10:17, Ard Biesheuvel >> <ard.biesheu...@linaro.org> >> 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 >> > /re >> > fs/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 >> > >> ___ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA
On 6 September 2016 at 09:54, Ni, Ruiyu <ruiyu...@intel.com> wrote: > Ard, > The patch to MdeModulePkg/PciHostBridgeDxe is good. > > Reviewed-by: Ruiyu Ni <ruiyu...@intel.com> > Thanks Ray! Who is responsible for the AtapPassThru, USB, NVME and SDHCI drivers? >> -Original Message- >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >> Ard Biesheuvel >> Sent: Tuesday, September 6, 2016 3:48 PM >> To: edk2-devel-01 <edk2-devel@lists.01.org>; Tian, Feng >> <feng.t...@intel.com>; Zeng, Star <star.z...@intel.com>; Gao, Liming >> <liming@intel.com> >> Cc: Laszlo Ersek <ler...@redhat.com>; Leif Lindholm >> <leif.lindh...@linaro.org>; Ard Biesheuvel <ard.biesheu...@linaro.org> >> Subject: Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit >> PCI DMA >> >> Feng, Star: do you have any feedback on these patches? Thanks. >> >> On 5 September 2016 at 10:17, Ard Biesheuvel <ard.biesheu...@linaro.org> >> 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/re >> > fs/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 >> > >> ___ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA
Ard, The patch to MdeModulePkg/PciHostBridgeDxe is good. Reviewed-by: Ruiyu Ni <ruiyu...@intel.com> Thanks/Ray > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Ard Biesheuvel > Sent: Tuesday, September 6, 2016 3:48 PM > To: edk2-devel-01 <edk2-devel@lists.01.org>; Tian, Feng > <feng.t...@intel.com>; Zeng, Star <star.z...@intel.com>; Gao, Liming > <liming@intel.com> > Cc: Laszlo Ersek <ler...@redhat.com>; Leif Lindholm > <leif.lindh...@linaro.org>; Ard Biesheuvel <ard.biesheu...@linaro.org> > Subject: Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit > PCI DMA > > Feng, Star: do you have any feedback on these patches? Thanks. > > On 5 September 2016 at 10:17, Ard Biesheuvel <ard.biesheu...@linaro.org> > 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/re > > fs/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 > > > ___ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA
Also cc Ruiyu to see if any comments. Thanks, Star -Original Message- From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] Sent: Tuesday, September 6, 2016 3:48 PM 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 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/re > fs/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 > ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA
Feng, Star: do you have any feedback on these patches? Thanks. On 5 September 2016 at 10:17, Ard Biesheuvelwrote: > 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 > ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA
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 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel