]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtQemu: enlarge initial flash mapping
authorArd Biesheuvel <ardb@kernel.org>
Tue, 24 Jan 2023 12:49:51 +0000 (13:49 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 26 Jan 2023 18:54:58 +0000 (18:54 +0000)
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>
ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S

index 4a4b7b77ed836c8bcfa3bb232c7f28c4559a8667..584ffcb3ebe2ef348f205763b43bccc49ac8188a 100644 (file)
@@ -15,6 +15,7 @@
   .set      TT_MT_MEM, (0x3 << 2) | (0x3 << 8)  // MAIR #3\r
 \r
   .set      PAGE_XIP,  TT_TYPE_PAGE  | TT_MT_MEM | TT_AF | TT_RO | TT_NG\r
+  .set      BLOCK_XIP, TT_TYPE_BLOCK | TT_MT_MEM | TT_AF | TT_RO | TT_NG\r
   .set      BLOCK_DEV, TT_TYPE_BLOCK | TT_MT_DEV | TT_AF | TT_XN | TT_NG\r
   .set      BLOCK_MEM, TT_TYPE_BLOCK | TT_MT_MEM | TT_AF | TT_XN | TT_NG\r
 \r
@@ -33,7 +34,8 @@ idmap:      /* level 0 */
 \r
 20:         /* level 2 */\r
   .quad     3f + TT_TYPE_TABLE            // up to 2 MB of flash\r
-  .fill     63, 8, 0x0                    // 126 MB of unused flash\r
+  .quad     BLOCK_XIP | (0x1  << 21)      // another 2 MB of flash\r
+  .fill     62, 8, 0x0                    // 124 MB of unused flash\r
   .set      idx, 64\r
   .rept     448\r
   .quad     BLOCK_DEV | (idx << 21)       // 896 MB of RW- device mappings\r