]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/BdsLib/Arm: Clean Data cache before disabling it
authorOlivier Martin <olivier.martin@arm.com>
Mon, 1 Sep 2014 13:21:54 +0000 (13:21 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 1 Sep 2014 13:21:54 +0000 (13:21 +0000)
It is actually the same sequence as AArch64.
Without cleaning the data cache prior to disable the cache, the LR value
pushed on the stack when entering in ArmCleanInvalidateDataCache()
might have been overwritten by this specific cache line maintenance.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16012 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c

index d85547b589807f04645a7829eca26cb439cfebb1..3d512486da415f5d2d19edb6cbb00e94a48e6a14 100644 (file)
@@ -25,9 +25,11 @@ PreparePlatformHardware (
 {\r
   //Note: Interrupts will be disabled by the GIC driver when ExitBootServices() will be called.\r
 \r
-  // Clean, invalidate, disable data cache\r
-  ArmDisableDataCache();\r
-  ArmCleanInvalidateDataCache();\r
+  // Clean before Disable else the Stack gets corrupted with old data.\r
+  ArmCleanDataCache ();\r
+  ArmDisableDataCache ();\r
+  // Invalidate all the entries that might have snuck in.\r
+  ArmInvalidateDataCache ();\r
 \r
   // Invalidate and disable the Instruction cache\r
   ArmDisableInstructionCache ();\r