From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web10.25095.1662386053407197176 for ; Mon, 05 Sep 2022 06:54:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UUxvP8Ap; spf=pass (domain: kernel.org, ip: 145.40.68.75, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D8AACB81148 for ; Mon, 5 Sep 2022 13:54:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AACAC433B5 for ; Mon, 5 Sep 2022 13:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662386050; bh=4cSKKImmi1z35QQQF7FmeI3OE7vzw0ZY2fXuV4eGcfY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UUxvP8ApTpTHPwxiiaCwVKN6i0s8f9hJD9DGmGFyHg871GF/vPKvuz5yqPYORCBb4 RasyjSP3M6lkJ1pCdY2jH1hedEV1eIPlNEEoT62XptGVGPxgvsQGtbm4w4tKYwGlLL LdEPPueLny1X4fM+AQz07UKTTimEsxH4rdqiXeQcv8DOZstlci78puyRUpzfCIMSxR VZCQ/DGkZ0uAUHFqxEf6f9rQSkx9bXMVrXe0DaV4PXIrDK+qdVJ1G3n45LCr3pYjNU +wiHnI6Ta8CSVmkOu9Ft2k9qsGRibP+8l2sIvEHxODy14afINzDX0ETt8AER9MaJ/v lr9FEuDYVeb7w== Received: by mail-lj1-f182.google.com with SMTP id b19so9320242ljf.8 for ; Mon, 05 Sep 2022 06:54:10 -0700 (PDT) X-Gm-Message-State: ACgBeo3Ik5aZ+YzC12Z0gvlq3FYylpBncR4tCSVwBDEDnakMkEpDyUmQ s7gAYtE9eU9qTAq/ls1HYBYWA4OCBImY+nPX1t0= X-Google-Smtp-Source: AA6agR5Dzhg4Ab9o2BVTgfet3TYGGYVI178CGVjl8swuu6DqXoRhX/nPi5dHpb0kP7GGCIrjeIdEL3sT98rfqvtkoOE= X-Received: by 2002:a2e:9b0e:0:b0:268:cb68:575b with SMTP id u14-20020a2e9b0e000000b00268cb68575bmr5797725lji.152.1662386048653; Mon, 05 Sep 2022 06:54:08 -0700 (PDT) MIME-Version: 1.0 References: <20220722170257.32249-1-rohit.mathew@arm.com> In-Reply-To: From: "Ard Biesheuvel" Date: Mon, 5 Sep 2022 15:53:57 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [edk2][PATCH V4 1/1] ArmPlatformPkg/PrePeiCore: Invoke constructors for SEC phase To: Rebecca Cran Cc: devel@edk2.groups.io, rohit.mathew@arm.com, Sami Mujawar , Ard Biesheuvel , Rebecca Cran , Pierre Gondois , Thomas Abraham , nd Content-Type: text/plain; charset="UTF-8" On Tue, 30 Aug 2022 at 00:18, Rebecca Cran wrote: > > It would be good if we could get this committed now the stable tag has > been created. > Merged as #3287 > > On 8/9/22 03:39, Rohit Mathew wrote: > > Hi, > > > > Could anyone please let me know if there are any more comments on this patch? > > Saw that we have moved into soft freeze for edk2 and wanted to add that we had one round of review on the patch. > > > > Regards, > > Rohit > > > >> -----Original Message----- > >> From: Sami Mujawar > >> Sent: 25 July 2022 12:12 > >> To: Rohit Mathew ; devel@edk2.groups.io > >> Cc: Ard Biesheuvel ; Rebecca Cran > >> ; Pierre Gondois ; Thomas > >> Abraham ; nd > >> Subject: Re: [edk2][PATCH V4 1/1] ArmPlatformPkg/PrePeiCore: Invoke > >> constructors for SEC phase > >> > >> Hi Rohit, > >> > >> This patch looks good to me. > >> > >> Reviewed-by: Sami Mujawar > >> > >> Regards, > >> > >> Sami Mujawar > >> > >> On 22/07/2022 06:02 pm, Rohit Mathew wrote: > >>> On platforms that do not have the serial console port pre-initialized > >>> prior to the SEC phase and due to the absence of a call to > >>> "SerialPortInitialize", this results in missing debug logs. So, call > >>> the auto-generated "ProcessLibraryConstructorList" function from SEC > >>> phase to have all the dependent library constructors called (this > >>> includes a call to "SerialPortInitialize"). > >>> > >>> Signed-off-by: Rohit Mathew > >>> --- > >>> ArmPlatformPkg/PrePeiCore/PrePeiCore.h | 12 +++++++++++- > >>> ArmPlatformPkg/PrePeiCore/PrePeiCore.c | 6 +++++- > >>> 2 files changed, 16 insertions(+), 2 deletions(-) > >>> > >>> Changes since V1: > >>> - Rebased on top of latest master branch. > >>> - Addressed comments from Ard. > >>> > >>> Changes since V2: > >>> - Rebased on top of latest master branch. > >>> > >>> Changes since V3: > >>> - Addressed comments from Sami. > >>> > >>> Link to github branch for the patch - > >>> https://github.com/rohit-arm/edk2/tree/sec_constructor_issue > >>> > >>> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h > >>> b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h > >>> index 0345dd7bdd2a..c1e13e23e11e 100644 > >>> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h > >>> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h > >>> @@ -1,7 +1,7 @@ > >>> /** @file > >>> Main file supporting the transition to PEI Core in Normal World > >>> for Versatile Express > >>> > >>> - Copyright (c) 2011, ARM Limited. All rights reserved. > >>> + Copyright (c) 2011 - 2022, ARM Limited. All rights reserved. > >>> > >>> SPDX-License-Identifier: BSD-2-Clause-Patent > >>> > >>> @@ -73,4 +73,14 @@ PeiCommonExceptionEntry ( > >>> IN UINTN LR > >>> ); > >>> > >>> +/* > >>> + * Autogenerated function that calls the library constructors for all > >>> +of the > >>> + * module's dependent libraries. > >>> + */ > >>> +VOID > >>> +EFIAPI > >>> +ProcessLibraryConstructorList ( > >>> + VOID > >>> + ); > >>> + > >>> #endif > >>> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > >>> b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > >>> index 6dd9bcdea24f..9c4b25df953d 100644 > >>> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > >>> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > >>> @@ -1,7 +1,7 @@ > >>> /** @file > >>> Main file supporting the transition to PEI Core in Normal World > >>> for Versatile Express > >>> > >>> - Copyright (c) 2011-2014, ARM Limited. All rights reserved. > >>> + Copyright (c) 2011 - 2022, ARM Limited. All rights reserved. > >>> > >>> SPDX-License-Identifier: BSD-2-Clause-Patent > >>> > >>> @@ -90,6 +90,10 @@ CEntryPoint ( > >>> > >>> // If not primary Jump to Secondary Main > >>> if (ArmPlatformIsPrimaryCore (MpId)) { > >>> + // Invoke "ProcessLibraryConstructorList" to have all library constructors > >>> + // called. > >>> + ProcessLibraryConstructorList (); > >>> + > >>> // Initialize the Debug Agent for Source Level Debugging > >>> InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL); > >>> SaveAndSetDebugTimerInterrupt (TRUE); > > > > > > > > >