From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (EUR03-DBA-obe.outbound.protection.outlook.com [40.107.104.40]) by mx.groups.io with SMTP id smtpd.web09.8252.1658418902904766671 for ; Thu, 21 Jul 2022 08:55:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=IWB6hezQ; spf=pass (domain: arm.com, ip: 40.107.104.40, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ip3zCtNo1f66KF9PEkCwbT/FRNId158phqKfwNPTaN81az7F5uS8dSISs7EaKY/or1UEjl/jFF4uzA8Kv25RKTWOrXI45ucCwpRZFvSUGuZ+ycEr9/jxrRTP2C89qs54vw2dDmpsmq6jxMA0GmUbwlkq3uaONWLH9H7zQD6AzYPnZ8OoPlP8ATHOffvCN8fV6CBI47mTehpRTBG1tIdw96MjvxWAY4WXTfTJcsy/Pw0pKWVe5O48ZdLMJrHJHRkYwLK0bX2M6kE4sxbnDjlulB2OysYxbR/ZRP0H2249FXRmc5r0hVO3axtStuOq4S1xNJcnNPQAPY+2e7v0pMImhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tQ1WPpl+iyVxkGezeAM3szAZrTCaQDTcFqYYq0Vjp44=; b=fTcjOYojsVdv5rXI9ts9V7Yw+wL3vtCkzg5T73n89HiXaRp3PnkP7K+0joyTVLSkGGa7QjLr5gEa3PLSP/B8ynyhwDRenkys3zz69TZPbmlw5U4NT9cc54IFR2piPCn0CGvaUxIbmYfaQ6Zv+I/zsCm0P9KjayfJrXJuXyBgyhb8HlN5SHhtTJp8wrDvOcDmMyQVajuRqMjNSmupsv3477XGTsSdZGpRE4qPFcArdKdYmtiCDP4uwUo3RnoFpb4lBpf/O7j4kf6pWUkiiAPvPfE2t2XjvMzJlo4J7jEQiLkVYeUPVu+OJdn2ZuaWvxlAZ0nxAlsxRmHwdj049V1rig== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tQ1WPpl+iyVxkGezeAM3szAZrTCaQDTcFqYYq0Vjp44=; b=IWB6hezQtzH3Oj+uWseaGIKSAQie+uW9rsL3Hs+CcDh/jLBkdqSNt5sXvuQhFaeT0STJgmt0G0jqRPFcD5heznPbgEUzsHdxkvNnd7BQyqTvESkzChsFo5zrJoV7Wx//oe8zsyrlWRTW9Vp22LuZVsmSFgCFdW3Lt2pCdJd51ok= Received: from DB7PR05CA0023.eurprd05.prod.outlook.com (2603:10a6:10:36::36) by VI1PR08MB3488.eurprd08.prod.outlook.com (2603:10a6:803:7d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Thu, 21 Jul 2022 15:54:59 +0000 Received: from DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:36:cafe::ea) by DB7PR05CA0023.outlook.office365.com (2603:10a6:10:36::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.25 via Frontend Transport; Thu, 21 Jul 2022 15:54:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT034.mail.protection.outlook.com (100.127.142.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.17 via Frontend Transport; Thu, 21 Jul 2022 15:54:58 +0000 Received: ("Tessian outbound 2af316122c7a:v123"); Thu, 21 Jul 2022 15:54:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7bd32094a2408598 X-CR-MTA-TID: 64aa7808 Received: from 964c8e7840f1.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7C8CBC37-BA5D-438E-83A5-6F539BEDEFA7.1; Thu, 21 Jul 2022 15:54:52 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 964c8e7840f1.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Jul 2022 15:54:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j8SKO4WutgKjP5K8Eu5jN8PxUuLVc9dDjQJQ0QijpiUHjjVKr1Xv+CVyFI9lAPlZfjxwHl5da5T+AbuLk7+nEcPqDbX+qzLi8ZJcjSVKehgFLZjT9u4tH0ereQ7d+XSI6Zhq7hCJCebmjsE6hMInKKhkITIZMKLMyJh5inpd2dCFnrEeMK+u12R/a0D6M2eUoDftwF+poyjGqtU8qM6bUsluGnO0wbaaYMapJCT9CpiQqvuXfd7AT5WYljJ3w08GNs1X2EM4sXOB9q3xxdgG0ajgZtQVUU8vvKjenjNWABJwaymUYUapWqVA+oR38Mn8+njaLn4mpiK1m06iNa3msQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tQ1WPpl+iyVxkGezeAM3szAZrTCaQDTcFqYYq0Vjp44=; b=SuDWFeoObVFgFdXWwyuvVaJBfYhaHbQbV7B0JwgucCvpqefQDAwoHxqO15pbW1PU/+ZfD+uoIrK7UuOxFxb9jJqDsNFUII6ujIA3kmd9WTjPHhEb97qrbQpZmNuIblCQDgbcdcZe4mIlMvN2FCqVMPFuRR5M5HOtInVgMyCeI26kVw0MU4w2RnTeQsPUt8fvbXS65LQ5qjsXcwj8+iK2NzGRZd9KFtkcWc6nfgtnZfGlii7Y12CcexHpcs16QTVx12mcEpIKhGTMHqk8poTeLABCXxT0bx4RIKrPpiKhl3ykW4A8pLTLnInGLYwcwfAqB1Veh2DyLm2ZUlU8utP1Og== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tQ1WPpl+iyVxkGezeAM3szAZrTCaQDTcFqYYq0Vjp44=; b=IWB6hezQtzH3Oj+uWseaGIKSAQie+uW9rsL3Hs+CcDh/jLBkdqSNt5sXvuQhFaeT0STJgmt0G0jqRPFcD5heznPbgEUzsHdxkvNnd7BQyqTvESkzChsFo5zrJoV7Wx//oe8zsyrlWRTW9Vp22LuZVsmSFgCFdW3Lt2pCdJd51ok= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM6PR08MB4423.eurprd08.prod.outlook.com (2603:10a6:20b:bf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Thu, 21 Jul 2022 15:54:50 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9%4]) with mapi id 15.20.5458.018; Thu, 21 Jul 2022 15:54:49 +0000 Message-ID: Date: Thu, 21 Jul 2022 16:54:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [edk2][PATCH V3 1/1] ArmPlatformPkg/PrePeiCore: Explicitly invoke constructor for SEC phase To: Rohit Mathew , devel@edk2.groups.io Cc: Ard Biesheuvel , Rebecca Cran , Pierre Gondois , Thomas Abraham , nd@arm.com References: <20220706134234.17847-1-rohit.mathew@arm.com> From: "Sami Mujawar" In-Reply-To: <20220706134234.17847-1-rohit.mathew@arm.com> X-ClientProxiedBy: LO4P123CA0041.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::10) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 18759ccb-dd01-45b2-1242-08da6b315d57 X-MS-TrafficTypeDiagnostic: AM6PR08MB4423:EE_|DBAEUR03FT034:EE_|VI1PR08MB3488:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: W6wYAaxF/FBQ8kBvEZiR3F2iaLXhcFkAaasDsDCe3k8yxCa72swSGJyIgFFnXxdmmvwPxOJOyaberTSb9RXRf9uH0hmvqZxy5kJsn75oBKxjNOYsdlk6fm3m8DDjaZff92g5jrKbUTAJJBiJbHTr4udTOCTjsrAjfnNhU7wWk/QcLPH+PQ6x8aa6gck55DP3h4rVOrQNObW6x6az6h7DTZCffz5Qqls8cUCoj/BRx2Q0832is6OUoussUPGniex/oek/ipU3Ga/G570QfzqTPEklZtyxP2c4nKFtxfpcufDe0kZAqE1ikBdfs0K3ZDF/ah1PWTD58QzFHV3nGOcXjcpmtXKQKpxTjvZoqRaSLH9IC2CYz9Ud3Xpu+eIq6WwXlMavoC93DaaEt604A144zFARWJKWEigU03CwGGXXdBCthLQmWRxyZniGk8QF77F2HToEzu39wHUEJNRK0oDiCLczOUVOHUJxZVAFuGC4HgtR5OzSdR55foNmtOfsgGZR5W8JsJCyRM3l/GhKrHOCW4CU91O5qLQK1PWd7jJfUbimAcorXzu1YTArj1QuWmaDMeFSEnwRWGNFmjmM0614Ugc1Mo0JBr63K7WMbKbxFl2W1HCf9oLiTenXyW+x6ebmmBVOsITojjaSX1LMpWcol1xyA3Urqe28Db6ywql+SgFf9g+V1yQWn3LouU4nnYyjrbnEZG7M7wGL9pxJnkSeJueaXL6HEcI95pfhVrB9kQ1KF6DPuAN/MriR3E/emmAR1aNgyr4IMtFukoiMRIWSb8rVtU71Sg4DpQcvz7J/hAuXeLQl6mCGDQdYbHqOTyiJ4E5PFMvTJ2/f58k8p60tpBx7XI8lVQ+v2VFHohXLXUM= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(366004)(396003)(39860400002)(376002)(346002)(26005)(478600001)(8936002)(166002)(31686004)(31696002)(5660300002)(54906003)(41300700001)(36756003)(316002)(186003)(2616005)(83380400001)(44832011)(2906002)(4326008)(966005)(6506007)(6486002)(66476007)(8676002)(86362001)(33964004)(66946007)(6512007)(53546011)(66556008)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4423 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: bfbb25eb-2876-47f8-beca-08da6b3157cf X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Won05vkmptWNNZSFXdVrSRCOI8oywbGiQXgcfladfY0gh6yy6aljbIEqHriFXXnJoWYNHGcOqekPY2s4vzoSn+DB2okjAWu04B1BP4EnR19fPw0H9N7HCB/PApj7WmVx0LPQ/FKJT9imwGudPb2BohEtORksJUZ6OC44Q+7jYZnrYz3sKi0aZt1T2wqa6knNFHIWMXvIkz8Nx600sfG/n+dwrgH2M3vTwTbXfWmE26j1krMULGoBvoAdlv3qltV39YSkpzjK25Tn8buCQLatS1M2BWxqujqiBPlDUfITiWAkpzaBPrF4graQDQCNYgG3NUF9rCsGUCArRB8k07uv6znyAmAEmgWVOZjtpEd7aYon+uaVYSQx6kjOz7iL5F7koAgUPLuYIch5AlRna7TqkyHSTNlzJ0YLrHLJFxOjCeiUTe0kZTk2H4+PVXs13v7+hLqGw54Ki7oFyoeOafL6Oc8hQ0sWVYjzimIG42Kg4+Gn++KF4/6JHp6OongF4PAFKD4i8ooizVE+u8sGXIljddZgIvcf45BlcZYZRU2HmtTZdioBbZj6JglTGCNfiJFOzGV+FDgTnw92MMZpcNOWJMXrE/Iw0baH9LvEM8TJfrBWi6+w2LKLjimNcQObCtzZdtlZeEt34AYEvU/WrD8dQDNpNaSlMc7O4LdZCW33KDG6C27MAZGmZxXhjheI2fBJi6Zou5BdHiR0YUqZpGhmOANAgE3yKhCjdagBH4z4w+PC4T7nAllAjVfHAT7zm7KjOGbMSbQM4ypcY/fggvdUSrCSUbvcUho3uvAGjCuS/3Bcz9SVILKClsWzF/iTz8sWsj7tBVFQE2tKcj1ALf8G45logCZZKemttW2A+/NJIk= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(396003)(136003)(346002)(376002)(40470700004)(46966006)(36840700001)(166002)(40480700001)(4326008)(186003)(36756003)(54906003)(8676002)(70586007)(47076005)(336012)(31686004)(6512007)(70206006)(41300700001)(26005)(2616005)(83380400001)(6506007)(2906002)(33964004)(53546011)(36860700001)(82310400005)(31696002)(40460700003)(86362001)(44832011)(8936002)(5660300002)(6486002)(316002)(82740400003)(81166007)(356005)(966005)(478600001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2022 15:54:58.9747 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18759ccb-dd01-45b2-1242-08da6b315d57 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3488 Content-Type: multipart/alternative; boundary="------------0hZEMxuGkrDkaYIfpqHodVCD" --------------0hZEMxuGkrDkaYIfpqHodVCD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Rohit, Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 06/07/2022 02:42 pm, Rohit Mathew wrote: > Invoke the constructor in the SEC phase to call into initialization > functions associated with libraries linked with this particular module. > For instance, PrePeiCore's CEntryPoint function calls DebugLib library's > print API before the library is initialized. [SAMI] Can you rephrase the commit message to be clearer, please? > This change is essential > to initialize uart for SEC phase. > > Signed-off-by: Rohit Mathew > --- > ArmPlatformPkg/PrePeiCore/PrePeiCore.h | 11 ++++++++++- > ArmPlatformPkg/PrePeiCore/PrePeiCore.c | 6 +++++- > 2 files changed, 15 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. > > 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..b752c4b9e617 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,13 @@ PeiCommonExceptionEntry ( > IN UINTN LR > ); > > +/* > + * Constructor for SEC phase [SAMI] The above description does not appear to be correct. Would the following test be more appropriate?   Autogenerated function that calls the library constructors for all of the module's   dependent libraries. [/SAMI] > + */ > +VOID > +EFIAPI > +ProcessLibraryConstructorList ( > + VOID > + ); > + > #endif > diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > index 6dd9bcdea24f..9654866f0c13 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 > > @@ -86,6 +86,10 @@ CEntryPoint ( > ArmEnableVFP (); > } > > + // Explicitly invoke the library constructor to resolve any library > + // dependency. > + ProcessLibraryConstructorList(); [SAMI] I don't think this will pass the edk2 CI. Can you check, please? > + > // Note: The MMU will be enabled by MemoryPeim. Only the primary core will have the MMU on. > > // If not primary Jump to Secondary Main --------------0hZEMxuGkrDkaYIfpqHodVCD Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Rohit,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 06/07/2022 02:42 pm, Rohit Mathew wrote:
Invoke the constructor in the SEC phase to call into initialization
functions associated with libraries linked with this particular module.
For instance, PrePeiCore's CEntryPoint function calls DebugLib library's
print API before the library is initialized.  
[SAMI] Can you rephrase the commit message to be clearer, please?
This change is essential
to initialize uart for SEC phase.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
---
 ArmPlatformPkg/PrePeiCore/PrePeiCore.h | 11 ++++++++++-
 ArmPlatformPkg/PrePeiCore/PrePeiCore.c |  6 +++++-
 2 files changed, 15 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.

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..b752c4b9e617 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,13 @@ PeiCommonExceptionEntry (
   IN UINTN   LR
   );
 
+/*
+ * Constructor for SEC phase

[SAMI] The above description does not appear to be correct.

Would the following test be more appropriate?

  Autogenerated function that calls the library constructors for all of the module's
  dependent libraries.
[/SAMI]
+ */
+VOID
+EFIAPI
+ProcessLibraryConstructorList (
+  VOID
+  );
+
 #endif
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
index 6dd9bcdea24f..9654866f0c13 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
 
@@ -86,6 +86,10 @@ CEntryPoint (
     ArmEnableVFP ();
   }
 
+  // Explicitly invoke the library constructor to resolve any library
+  // dependency.
+  ProcessLibraryConstructorList();
[SAMI] I don't think this will pass the edk2 CI. Can you check, please?
+
   // Note: The MMU will be enabled by MemoryPeim. Only the primary core will have the MMU on.
 
   // If not primary Jump to Secondary Main
--------------0hZEMxuGkrDkaYIfpqHodVCD--