diff options
author | Olivier Martin <olivier.martin@arm.com> | 2014-09-01 13:21:54 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-09-01 13:21:54 +0000 |
commit | 5779aaafe95e5cf8d9f1b192725bba60c4b9e245 (patch) | |
tree | 7a7de375410078442f006dfb31050c8601b642df | |
parent | f4b491b56f827052d0823c3217fa2049fd479a7d (diff) | |
download | edk2-5779aaafe95e5cf8d9f1b192725bba60c4b9e245.tar.gz edk2-5779aaafe95e5cf8d9f1b192725bba60c4b9e245.tar.bz2 edk2-5779aaafe95e5cf8d9f1b192725bba60c4b9e245.zip |
ArmPkg/BdsLib/Arm: Clean Data cache before disabling it
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
-rw-r--r-- | ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c index d85547b589..3d512486da 100644 --- a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c +++ b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c @@ -25,9 +25,11 @@ PreparePlatformHardware ( {
//Note: Interrupts will be disabled by the GIC driver when ExitBootServices() will be called.
- // Clean, invalidate, disable data cache
- ArmDisableDataCache();
- ArmCleanInvalidateDataCache();
+ // Clean before Disable else the Stack gets corrupted with old data.
+ ArmCleanDataCache ();
+ ArmDisableDataCache ();
+ // Invalidate all the entries that might have snuck in.
+ ArmInvalidateDataCache ();
// Invalidate and disable the Instruction cache
ArmDisableInstructionCache ();
|