From 25549bda46c581271a303840fb266539c00ede71 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Tue, 28 Feb 2017 12:13:11 +0000 Subject: 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 Reviewed-by: Leif Lindholm --- .../Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ArmPkg') diff --git a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c index cd13a7da92..0d8abad234 100644 --- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c +++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c @@ -545,7 +545,7 @@ UncachedInternalAllocatePool ( IN UINTN AllocationSize ) { - UINTN CacheLineLength = ArmDataCacheLineLength (); + UINTN CacheLineLength = ArmCacheWritebackGranule (); return UncachedInternalAllocateAlignedPool (MemoryType, AllocationSize, CacheLineLength); } -- cgit v1.2.3