ArmPkg/ArmDmaLib: use the cache writeback granularity for alignment

When allocating memory to perform non-coherent DMA, use the cache
writeback granule rather than the data cache linesize for alignment.
This prevents the explicit cache maintenance from corrupting
unrelated adjacent data if the cache writeback granule exceeds
the cache linesize.

Reported-by: Mark Rutland <mark.rutland@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18759 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Ard Biesheuvel 2015-11-09 13:28:33 +00:00 committed by abiesheuvel
parent c653fc2a91
commit 07c707858d
1 changed files with 1 additions and 1 deletions

View File

@ -277,7 +277,7 @@ ArmDmaLibConstructor (
Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu); Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu);
ASSERT_EFI_ERROR(Status); ASSERT_EFI_ERROR(Status);
gCacheAlignment = ArmDataCacheLineLength (); gCacheAlignment = ArmCacheWritebackGranule ();
return Status; return Status;
} }