public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Heyi Guo <heyi.guo@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	 Linaro UEFI Mailman List <Linaro-uefi@lists.linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	"Ni, Ruiyu" <ruiyu.ni@intel.com>
Subject: Re: [RFC] MdeModulePkg/NonDiscoverablePciDeviceDxe: NonCoherentPciIoAllocateBuffer issue with AArch64
Date: Mon, 30 Oct 2017 08:21:40 +0000	[thread overview]
Message-ID: <CAKv+Gu-tnh1Ly9+se5M+r5EmAfwuRbw=eNMraUnXyGn8Ptk1wg@mail.gmail.com> (raw)
In-Reply-To: <f1b9be00-4ff3-95f8-c768-750071aaf958@linaro.org>

On 30 October 2017 at 03:52, Heyi Guo <heyi.guo@linaro.org> wrote:
> Hi folks,
>
> In NonDiscoverablePciDeviceDxe driver, NonCoherentPciIoAllocateBuffer may
> allocate EFI_MEMORY_UC buffer depending on input Attributes and GCD
> capabilities. If it does, it actually allocates memory of "device" type in
> AArch64, but not "normal uncacheable" memory. For "device" memory type, it
> requires restrict access alignment and it may trigger alignment fault
> exception with BaseMemoryLibOptDxe in which read/write alignment is not
> guaranteed.
>
> Is EFI_MOMORY_WC enough for AArch64 platforms? How about other platforms,
> like X86?
>

Hello Heyi,

Do you mean EFI_MEMORY_UC in the last sentence? If not, I don't
understand the question.

Anyway, in reality, this code will only allocate EFI_MEMORY_UC memory
if any memory already exists in the memory map with that capability,
otherwise it will fall back to EFI_MEMORY_WC. On most arm64 platforms,
we no longer add this capability to system memory by default, so you
should be getting EFI_MEMORY_WC in most cases.

So the question is actually the opposite: does this interfere with
correct operation in cases where the shared mapping between the CPU
and the device should be strongly ordered, and EFI_MEMORY_WC doesn't
give sufficient guarantees.

-- 
Ard.


  reply	other threads:[~2017-10-30  8:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30  3:52 [RFC] MdeModulePkg/NonDiscoverablePciDeviceDxe: NonCoherentPciIoAllocateBuffer issue with AArch64 Heyi Guo
2017-10-30  8:21 ` Ard Biesheuvel [this message]
2017-10-30 15:13   ` Heyi Guo
2017-10-30 15:17     ` Ard Biesheuvel
2017-10-31 15:25       ` Heyi Guo

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='CAKv+Gu-tnh1Ly9+se5M+r5EmAfwuRbw=eNMraUnXyGn8Ptk1wg@mail.gmail.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