diff mbox

[Linaro-uefi,2/2] Platforms/Hisilicon/D0x: remove EFI_MEMORY_UC attribute from normal memory

Message ID 1473328166-18228-2-git-send-email-ard.biesheuvel@linaro.org
State Accepted
Commit fabb4463baa3b108c0e66fcf42413c1998045c7a
Headers show

Commit Message

Ard Biesheuvel Sept. 8, 2016, 9:49 a.m. UTC
On ARM systems, mapping normal memory as device memory may have unintended
side effects, given that unaligned accesses or loads and stores with special
semantics (e.g., load/store exclusive) may fault or may not work as expected.
Similarly, DC ZVA instructions are only supported on normal memory, not
device memory.

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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Leif Lindholm Sept. 8, 2016, 3:11 p.m. UTC | #1
On Thu, Sep 08, 2016 at 10:49:26AM +0100, Ard Biesheuvel wrote:
> On ARM systems, mapping normal memory as device memory may have unintended
> side effects, given that unaligned accesses or loads and stores with special
> semantics (e.g., load/store exclusive) may fault or may not work as expected.
> Similarly, DC ZVA instructions are only supported on normal memory, not
> device memory.
> 
> 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.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

For the series:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c b/Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c
> index fb712909e873..6eb85bb62f30 100644
> --- a/Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c
> +++ b/Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c
> @@ -114,7 +114,6 @@ MemoryPeim (
>    ResourceAttributes = (
>        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 |
> -- 
> 2.7.4
>
diff mbox

Patch

diff --git a/Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c b/Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c
index fb712909e873..6eb85bb62f30 100644
--- a/Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c
+++ b/Platforms/Hisilicon/Binary/D02/MemoryInitPei/MemoryInitPeiLib.c
@@ -114,7 +114,6 @@  MemoryPeim (
   ResourceAttributes = (
       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 |