Revision: 16206
http://sourceforge.net/p/edk2/code/16206
Author: oliviermartin
Date: 2014-10-10 11:25:04 +0000 (Fri, 10 Oct 2014)
Log Message:
-----------
ArmPkg/ArmLib/AArch64: Initialize the new N+1-level page table before
registering it
Prior to this change, when a new page table was created at level N+1,
the reference to the table was added to the level N translation table,
before being initialized.
It means if virtual addresses were in the address range defined by
this new table the CPU would crash as the address range was not
initialized.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <[email protected]>
Modified Paths:
--------------
trunk/edk2/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c
Modified: trunk/edk2/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c
===================================================================
--- trunk/edk2/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c 2014-10-10
11:24:11 UTC (rev 16205)
+++ trunk/edk2/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c 2014-10-10
11:25:04 UTC (rev 16206)
@@ -251,6 +251,7 @@
UINTN RootTableEntryCount;
UINT64 *TranslationTable;
UINT64 *BlockEntry;
+ UINT64 *SubTableBlockEntry;
UINT64 BlockEntryAddress;
UINTN BaseAddressAlignment;
UINTN PageLevel;
@@ -382,17 +383,18 @@
}
TranslationTable = (UINT64*)((UINTN)TranslationTable &
TT_ADDRESS_MASK_DESCRIPTION_TABLE);
+ // Populate the newly created lower level table
+ SubTableBlockEntry = TranslationTable;
+ for (Index = 0; Index < TT_ENTRY_COUNT; Index++) {
+ *SubTableBlockEntry = Attributes | (BlockEntryAddress + (Index <<
TT_ADDRESS_OFFSET_AT_LEVEL(IndexLevel + 1)));
+ SubTableBlockEntry++;
+ }
+
// Fill the BlockEntry with the new TranslationTable
*BlockEntry = ((UINTN)TranslationTable &
TT_ADDRESS_MASK_DESCRIPTION_TABLE) | TableAttributes | TT_TYPE_TABLE_ENTRY;
// Update the last block entry with the newly created translation table
*LastBlockEntry = TT_LAST_BLOCK_ADDRESS(TranslationTable,
TT_ENTRY_COUNT);
- // Populate the newly created lower level table
- BlockEntry = TranslationTable;
- for (Index = 0; Index < TT_ENTRY_COUNT; Index++) {
- *BlockEntry = Attributes | (BlockEntryAddress + (Index <<
TT_ADDRESS_OFFSET_AT_LEVEL(IndexLevel + 1)));
- BlockEntry++;
- }
// Block Entry points at the beginning of the Translation Table
BlockEntry = TranslationTable;
}
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits