There is no need to issue a full data synchronization barrier and an
instruction synchronization barrier after each and every set/way or
MVA cache maintenance operation. For the set/way case, we can simply
remove them, since the set/way outer loop already issues the required
barriers after completing its traversal over all the cache levels.
For the MVA case, move the data synchronization barrier out of the
loop, and add the instruction synchronization barrier to the I-cache
invalidation by MVA routine.
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@18755
6f19259b-4bc3-4df7-8a09-
765794883524
LineOperation(AlignedAddress);\r
AlignedAddress += ArmCacheLineLength;\r
}\r
+ ArmDataSynchronizationBarrier ();\r
}\r
\r
VOID\r
\r
ASM_PFX(ArmInvalidateDataCacheEntryByMVA):\r
dc ivac, x0 // Invalidate single data cache line\r
- dsb sy\r
- isb\r
ret\r
\r
\r
ASM_PFX(ArmCleanDataCacheEntryByMVA):\r
dc cvac, x0 // Clean single data cache line\r
- dsb sy\r
- isb\r
ret\r
\r
\r
ASM_PFX(ArmCleanInvalidateDataCacheEntryByMVA):\r
dc civac, x0 // Clean and invalidate single data cache line\r
- dsb sy\r
- isb\r
ret\r
\r
\r
ASM_PFX(ArmInvalidateDataCacheEntryBySetWay):\r
dc isw, x0 // Invalidate this line\r
- dsb sy\r
- isb\r
ret\r
\r
\r
ASM_PFX(ArmCleanInvalidateDataCacheEntryBySetWay):\r
dc cisw, x0 // Clean and Invalidate this line\r
- dsb sy\r
- isb\r
ret\r
\r
\r
ASM_PFX(ArmCleanDataCacheEntryBySetWay):\r
dc csw, x0 // Clean this line\r
- dsb sy\r
- isb\r
ret\r
\r
\r
\r
ASM_PFX(ArmInvalidateDataCacheEntryByMVA):\r
mcr p15, 0, r0, c7, c6, 1 @invalidate single data cache line\r
- dsb\r
- isb\r
bx lr\r
\r
ASM_PFX(ArmCleanDataCacheEntryByMVA):\r
mcr p15, 0, r0, c7, c10, 1 @clean single data cache line\r
- dsb\r
- isb\r
bx lr\r
\r
\r
ASM_PFX(ArmCleanInvalidateDataCacheEntryByMVA):\r
mcr p15, 0, r0, c7, c14, 1 @clean and invalidate single data cache line\r
- dsb\r
- isb\r
bx lr\r
\r
\r
ASM_PFX(ArmInvalidateDataCacheEntryBySetWay):\r
mcr p15, 0, r0, c7, c6, 2 @ Invalidate this line\r
- dsb\r
- isb\r
bx lr\r
\r
\r
ASM_PFX(ArmCleanInvalidateDataCacheEntryBySetWay):\r
mcr p15, 0, r0, c7, c14, 2 @ Clean and Invalidate this line\r
- dsb\r
- isb\r
bx lr\r
\r
\r
ASM_PFX(ArmCleanDataCacheEntryBySetWay):\r
mcr p15, 0, r0, c7, c10, 2 @ Clean this line\r
- dsb\r
- isb\r
bx lr\r
\r
ASM_PFX(ArmInvalidateInstructionCache):\r
\r
ArmInvalidateDataCacheEntryByMVA\r
mcr p15, 0, r0, c7, c6, 1 ; invalidate single data cache line\r
- dsb\r
- isb\r
bx lr\r
\r
ArmCleanDataCacheEntryByMVA\r
mcr p15, 0, r0, c7, c10, 1 ; clean single data cache line\r
- dsb\r
- isb\r
bx lr\r
\r
\r
ArmCleanInvalidateDataCacheEntryByMVA\r
mcr p15, 0, r0, c7, c14, 1 ; clean and invalidate single data cache line\r
- dsb\r
- isb\r
bx lr\r
\r
\r
ArmInvalidateDataCacheEntryBySetWay\r
mcr p15, 0, r0, c7, c6, 2 ; Invalidate this line\r
- dsb\r
- isb\r
bx lr\r
\r
\r
ArmCleanInvalidateDataCacheEntryBySetWay\r
mcr p15, 0, r0, c7, c14, 2 ; Clean and Invalidate this line\r
- dsb\r
- isb\r
bx lr\r
\r
\r
ArmCleanDataCacheEntryBySetWay\r
mcr p15, 0, r0, c7, c10, 2 ; Clean this line\r
- dsb\r
- isb\r
bx lr\r
\r
\r