On 23 November 2015 at 07:13, Heyi Guo <[email protected]> wrote:
> It is implied that the memory returned from UncachedMemoryAllocationLib
> should have cache invalidated. So we invalidate memory range after
> changing memory attribute to uncached.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Heyi Guo <[email protected]>
> Cc: Leif Lindholm <[email protected]>
> Cc: Ard Biesheuvel <[email protected]>
> ---
>  .../Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c  | 3 
> +++
>  .../UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf        | 1 +
>  2 files changed, 4 insertions(+)
>

Reviewed-by: Ard Biesheuvel <[email protected]>

Thanks Heyi,
Committed as SVN r18920


> diff --git 
> a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c 
> b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
> index b859f63..1dfc740 100644
> --- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
> +++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
> @@ -25,6 +25,7 @@
>  #include <Library/PcdLib.h>
>  #include <Library/ArmLib.h>
>  #include <Library/DxeServicesTableLib.h>
> +#include <Library/CacheMaintenanceLib.h>
>
>  VOID *
>  UncachedInternalAllocatePages (
> @@ -165,6 +166,8 @@ AllocatePagesFromList (
>      return Status;
>    }
>
> +  InvalidateDataCacheRange ((VOID *)(UINTN)Memory, EFI_PAGES_TO_SIZE 
> (Pages));
> +
>    NewNode = AllocatePool (sizeof (FREE_PAGE_NODE));
>    if (NewNode == NULL) {
>      ASSERT (FALSE);
> diff --git 
> a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf 
> b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
> index 0a0b6cb..d7a0f2f 100644
> --- 
> a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
> +++ 
> b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
> @@ -38,6 +38,7 @@
>    MemoryAllocationLib
>    PcdLib
>    DxeServicesTableLib
> +  CacheMaintenanceLib
>
>  [Pcd]
>    gArmTokenSpaceGuid.PcdArmFreeUncachedMemorySizeThreshold
> --
> 2.6.2
>
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to