summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/Library
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-01-24 13:49:51 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-01-26 18:54:58 +0000
commit619f077252226be45eb8c357f43c93ed88101228 (patch)
tree8e5fa9e02c5b3c739a4c1e0b74b838f22d235a9e /ArmVirtPkg/Library
parent6c8a08bd8a6803c18a54267379e8f5d78c831796 (diff)
downloadedk2-619f077252226be45eb8c357f43c93ed88101228.tar.gz
edk2-619f077252226be45eb8c357f43c93ed88101228.tar.bz2
edk2-619f077252226be45eb8c357f43c93ed88101228.zip
ArmVirtPkg/ArmVirtQemu: enlarge initial flash mapping
The initial ID map used by ArmVirtQemu only covers 2 MiB of NOR flash, while the NOOPT build can be up to 3 MiB in size, resulting in a crash if the unmapped 1 MiB is accessed before the real page tables are up. So increate the initial flash mapping to 4 MiB. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ArmVirtPkg/Library')
-rw-r--r--ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S b/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S
index 4a4b7b77ed..584ffcb3eb 100644
--- a/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S
+++ b/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S
@@ -15,6 +15,7 @@
.set TT_MT_MEM, (0x3 << 2) | (0x3 << 8) // MAIR #3
.set PAGE_XIP, TT_TYPE_PAGE | TT_MT_MEM | TT_AF | TT_RO | TT_NG
+ .set BLOCK_XIP, TT_TYPE_BLOCK | TT_MT_MEM | TT_AF | TT_RO | TT_NG
.set BLOCK_DEV, TT_TYPE_BLOCK | TT_MT_DEV | TT_AF | TT_XN | TT_NG
.set BLOCK_MEM, TT_TYPE_BLOCK | TT_MT_MEM | TT_AF | TT_XN | TT_NG
@@ -33,7 +34,8 @@ idmap: /* level 0 */
20: /* level 2 */
.quad 3f + TT_TYPE_TABLE // up to 2 MB of flash
- .fill 63, 8, 0x0 // 126 MB of unused flash
+ .quad BLOCK_XIP | (0x1 << 21) // another 2 MB of flash
+ .fill 62, 8, 0x0 // 124 MB of unused flash
.set idx, 64
.rept 448
.quad BLOCK_DEV | (idx << 21) // 896 MB of RW- device mappings