From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: "Cohen, Eugene" <eugene@hp.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
"leif.lindholm@linaro.org" <leif.lindholm@linaro.org>
Subject: Re: [PATCH] ArmPlatformPkg: remove EFI_MEMORY_UC attribute from normal memory
Date: Thu, 8 Sep 2016 18:49:31 +0100 [thread overview]
Message-ID: <CAKv+Gu9z8MK68VeOs3SwpF5m-JhmbND0wbikXd8sOE3_5LPh1w@mail.gmail.com> (raw)
In-Reply-To: <AT5PR84MB0291F60478ED6A5F5925A4E3B4FB0@AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM>
On 8 September 2016 at 18:33, Cohen, Eugene <eugene@hp.com> wrote:
> Ard,
>
>> So remove the EFI_MEMORY_UC attribute that we set by default on
>> system RAM.
>> If any region requires this attribute, it is up to the driver to set this
>> attribute, and to ensure that no offending operations are performed
>> on it.
>>
>
> For DMA common-buffer operations on systems without snooping DMA capabilities, UC or WC mapping of system memory regions is required.
>
>> EFI_RESOURCE_ATTRIBUTE_PRESENT |
>> EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
>> - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
>> EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
>> EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
>> EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
>
> The EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE bit your removing is removing the capability for uncacheable memory such that even if a driver wanted to make a DMA buffer uncacheable GCD will no longer allow this because the resource does not support this capability.
>
> Is it your intent to indicate that system memory is no longer capable of being uncacheable? If so how would you plan to accomodate the DMA use case for GCD SetMemorySpaceAttributes?
>
In general, memory should be mapped as memory, and if strongly ordered
mappings of RAM are required in some cases, it is up to the module
itself to set the memory space capabilities, and to ensure that
routines that expect normal memory are not used on them. The typical
example is the proposed ARM implementation of BaseMemoryLibOptDxe,
which uses unaligned accesses and DC ZVA operations to speed up
operations.
I checked ArmDmaLib, and it uses WC mappings for its uncached
allocations, so those users should be fine. Do you have any examples
of drivers that require device mappings of RAM for DMA? I think it
would be preferable in this case to carve out a chunk of memory at the
platform level instead of annotating all of RAM with the UC bit, given
that it turns up in runtime services code/data regions as well, giving
the OS license to map it using attributes that may be problematic.
prev parent reply other threads:[~2016-09-08 17:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-08 8:13 [PATCH] ArmPlatformPkg: remove EFI_MEMORY_UC attribute from normal memory Ard Biesheuvel
2016-09-08 9:21 ` Leif Lindholm
2016-09-08 9:39 ` Ard Biesheuvel
2016-09-08 17:37 ` Cohen, Eugene
2016-09-08 20:54 ` Leif Lindholm
2016-09-08 17:33 ` Cohen, Eugene
2016-09-08 17:49 ` Ard Biesheuvel [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=CAKv+Gu9z8MK68VeOs3SwpF5m-JhmbND0wbikXd8sOE3_5LPh1w@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