[edk2-devel] [PATCH] MdeModulePkg: Correct high-memory use in NvmExpressDxe

Tomas Pilar (tpilar) quic_tpilar at quicinc.com
Thu Feb 24 12:33:38 UTC 2022


On 24/02/2022 12:09, Ard Biesheuvel wrote:

> On Thu, 24 Feb 2022 at 12:58, Ard Biesheuvel <ardb at kernel.org> wrote:
>> On Thu, 24 Feb 2022 at 12:48, Tomas Pilar <quic_tpilar at quicinc.com> wrote:
>>> Delay and move the allocation and mapping of memory that backs the DMA
>>> engine in NvmExpress devices to NvmeInit() to ensure that
>>> the allocation only happens after the
>>> EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute is set
>>> on the PciIo controller.
>>>
>>> This ensures that the DMA-backing memory is not forcibly allocated
>>> below 4G in system address map. Otherwise the allocation fails on
>>> platforms that do not have any memory below the 4G mark and the drive
>>> initialisation fails.
>>>
>>> Cc: Ray Ni <ray.ni at intel.com>
>>> Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
>>> Cc: Leif Lindholm <leif at nuviainc.com>
>>> Signed-off-by: Tomas Pilar <quic_tpilar at quicinc.com>
>> NvmeControllerInit () can be called multiple times, no? So you should
>> probably make sure that the buffer is not allocated and mapped again
>> if one already exists.
>>
> Alternatively, you could move all PCI attribute handling into the
> start() hook. Other drivers keep it there as well, and it seems like a
> more natural place for it (given the fact that NvmeControllerInit() is
> also called on a host controller reset)

Brilliant idea, I'll do this!



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86968): https://edk2.groups.io/g/devel/message/86968
Mute This Topic: https://groups.io/mt/89363151/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list