public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Tomas Pilar (tpilar)" <quic_tpilar@quicinc.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
	Ray Ni <ray.ni@intel.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <leif@nuviainc.com>
Subject: Re: [PATCH] MdeModulePkg: Correct high-memory use in NvmExpressDxe
Date: Thu, 24 Feb 2022 12:33:38 +0000	[thread overview]
Message-ID: <10febc7f-62d5-f6fe-0078-ca971274742b@quicinc.com> (raw)
In-Reply-To: <CAMj1kXEOqC7Y+VcX2Wv==JVBu0rfQ71J9VSmL7236sX_C9GVPA@mail.gmail.com>

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

> On Thu, 24 Feb 2022 at 12:58, Ard Biesheuvel <ardb@kernel.org> wrote:
>> On Thu, 24 Feb 2022 at 12:48, Tomas Pilar <quic_tpilar@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@intel.com>
>>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>>> Cc: Leif Lindholm <leif@nuviainc.com>
>>> Signed-off-by: Tomas Pilar <quic_tpilar@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!


      reply	other threads:[~2022-02-24 12:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 11:47 [PATCH] MdeModulePkg: Correct high-memory use in NvmExpressDxe Tomas Pilar
2022-02-24 11:58 ` Ard Biesheuvel
2022-02-24 12:09   ` Ard Biesheuvel
2022-02-24 12:33     ` Tomas Pilar (tpilar) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10febc7f-62d5-f6fe-0078-ca971274742b@quicinc.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox