public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Michael Kubacki <michael.kubacki@microsoft.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Oliver Steffen <osteffen@redhat.com>
Subject: [PATCH v2 2/6] ArmVirtPkg/ArmVirtQemu: enlarge initial flash mapping
Date: Tue, 24 Jan 2023 17:34:13 +0100	[thread overview]
Message-ID: <20230124163417.584727-3-ardb@kernel.org> (raw)
In-Reply-To: <20230124163417.584727-1-ardb@kernel.org>

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>
---
 ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S b/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S
index 4a4b7b77ed83..584ffcb3ebe2 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
-- 
2.39.0


  parent reply	other threads:[~2023-01-24 16:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 16:34 [PATCH v2 0/6] ArmVirtPkg: Increase PlatformCI coverage Ard Biesheuvel
2023-01-24 16:34 ` [PATCH v2 1/6] ArmVirtPkg/PrePi: Ensure timely execution of library constructors Ard Biesheuvel
2023-01-24 16:34 ` Ard Biesheuvel [this message]
2023-01-24 16:34 ` [PATCH v2 3/6] ArmVirtPkg/PlatformCI: factor out reusable PlatformBuildLib.py Ard Biesheuvel
2023-01-26 14:34   ` [edk2-devel] " Michael Kubacki
2023-01-24 16:34 ` [PATCH v2 4/6] ArmVirtPkg/PlatformCI: Enable optional features on Qemu AARCH64 builds Ard Biesheuvel
2023-01-26 14:35   ` [edk2-devel] " Michael Kubacki
2023-01-24 16:34 ` [PATCH v2 5/6] ArmVirtPkg/PlatformCI: Add CI coverage for ArmVirtQemuKernel Ard Biesheuvel
2023-01-26 14:35   ` [edk2-devel] " Michael Kubacki
2023-01-24 16:34 ` [PATCH v2 6/6] ArmVirtPkg/PlatformCI: Perform build test of ArmVirtKvmTool Ard Biesheuvel
2023-01-26 14:35   ` [edk2-devel] " Michael Kubacki
2023-01-25  9:41 ` [edk2-devel] [PATCH v2 0/6] ArmVirtPkg: Increase PlatformCI coverage Gerd Hoffmann
2023-01-25 12:38   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230124163417.584727-3-ardb@kernel.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox