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 1/6] ArmVirtPkg/PrePi: Ensure timely execution of library constructors
Date: Tue, 24 Jan 2023 17:34:12 +0100	[thread overview]
Message-ID: <20230124163417.584727-2-ardb@kernel.org> (raw)
In-Reply-To: <20230124163417.584727-1-ardb@kernel.org>

PrePi has a bare metal entry point, and so it is in charge of calling
the library constructors once the C runtime has been initialized
sufficiently.

However, we are now relying on a HOB to have been constructed by the
time the MMU code runs, and so the constructors should be run before
that.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 ArmVirtPkg/PrePi/PrePi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c
index c15dc305fced..3d943b2138d3 100755
--- a/ArmVirtPkg/PrePi/PrePi.c
+++ b/ArmVirtPkg/PrePi/PrePi.c
@@ -60,6 +60,9 @@ PrePiMain (
   //
   InvalidateDataCacheRange ((VOID *)(UINTN)PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize));
 
+  // SEC phase needs to run library constructors by hand.
+  ProcessLibraryConstructorList ();
+
   // Initialize MMU and Memory HOBs (Resource Descriptor HOBs)
   Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize));
   ASSERT_EFI_ERROR (Status);
@@ -93,9 +96,6 @@ PrePiMain (
   // Now, the HOB List has been initialized, we can register performance information
   PERF_START (NULL, "PEI", NULL, StartTimeStamp);
 
-  // SEC phase needs to run library constructors by hand.
-  ProcessLibraryConstructorList ();
-
   // Assume the FV that contains the SEC (our code) also contains a compressed FV.
   Status = DecompressFirstFv ();
   ASSERT_EFI_ERROR (Status);
-- 
2.39.0


  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 ` Ard Biesheuvel [this message]
2023-01-24 16:34 ` [PATCH v2 2/6] ArmVirtPkg/ArmVirtQemu: enlarge initial flash mapping Ard Biesheuvel
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-2-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