ArmPkg/UncachedMemoryAllocationLib: use CWG value to align pool allocations

Uncached pool allocations are aligned to the data cache line length under
the assumption that this is sufficient to prevent cache maintenance from
corrupting adjacent allocations. However, the value to use in such cases
is architecturally called the Cache Writeback Granule (CWG), which is
essentially the maximum Dcache line length rather than the minimum.

Note that this is mostly a cosmetical fix, given that the pool allocation
is turned into a page allocation later, and rounded up accordingly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Ard Biesheuvel 2017-02-28 12:13:11 +00:00
parent bb52ec2d6b
commit 25549bda46
1 changed files with 1 additions and 1 deletions

View File

@ -545,7 +545,7 @@ UncachedInternalAllocatePool (
IN UINTN AllocationSize
)
{
UINTN CacheLineLength = ArmDataCacheLineLength ();
UINTN CacheLineLength = ArmCacheWritebackGranule ();
return UncachedInternalAllocateAlignedPool (MemoryType, AllocationSize, CacheLineLength);
}