audk/ArmPkg/Library/ArmLib/AArch64
Heyi Guo edff645fe4 ArmPkg/Mmu: Increase PageLevel when table found at the targeted level
Below code has bug since *BlockEntrySize and *TableLevel are not
updated accordingly:

if (IndexLevel == PageLevel) {
  // And get the appropriate BlockEntry at the next level
  BlockEntry = (UINT64*)TT_GET_ENTRY_FOR_ADDRESS (TranslationTable, \
      IndexLevel + 1, RegionStart);

  // Set the last block for this new table
  *LastBlockEntry = TT_LAST_BLOCK_ADDRESS(TranslationTable, \
      TT_ENTRY_COUNT);
}

Also it doesn't check recursively to get the last level, e.g. the
initial PageLevel is 1 and we already have level 2 and 3 tables at
this address.

What's more, *LastBlockEntry was not updated when we get a table and
IndexLevel != PageLevel.

So we reorganize the sequence, only updating TranslationTable,
PageLevel and BlockEntry in the loop, and setting the other output
parameters with the final PageLevel before returning.

And LastBlockEntry is only an OUT parameter.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18424 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-09 13:37:41 +00:00
..
AArch64ArchTimer.c ArmPkg: Move TimerDxe and ArmArchTimerLib to new ArmGenericTimerCounterLib 2014-09-09 16:10:18 +00:00
AArch64ArchTimerSupport.S ArmPkg: fix ArmWriteCntkCtl simple code bug 2015-05-13 18:21:58 +00:00
AArch64Lib.c ArmPkg/ArmLib: Drain Write Buffer before DCache maintenance operations. 2014-06-03 16:37:29 +00:00
AArch64Lib.h ArmPkg/ArmLib: Move common definitions from ArmV7Lib.h & AArch64Lib.h to ArmLib.h 2014-03-01 10:57:09 +00:00
AArch64Lib.inf ArmPkg: remove cache maintenance by VA operation range size threshold 2015-04-14 11:54:40 +00:00
AArch64LibPrePi.inf ArmPkg: remove cache maintenance by VA operation range size threshold 2015-04-14 11:54:40 +00:00
AArch64LibSec.inf ArmPkg: remove cache maintenance by VA operation range size threshold 2015-04-14 11:54:40 +00:00
AArch64Mmu.c ArmPkg/Mmu: Increase PageLevel when table found at the targeted level 2015-09-09 13:37:41 +00:00
AArch64Support.S ArmPkg: Ensured the stack is always quad-word aligned 2014-11-11 00:51:11 +00:00
ArmLibSupportV8.S ARM Packages: Include 'AsmMacroIoLibV8.h' instead of the 32bit version 2014-02-24 19:20:16 +00:00