From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.65]) by mx.groups.io with SMTP id smtpd.web10.26796.1658747562243996151 for ; Mon, 25 Jul 2022 04:12:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=IGnSUKG6; spf=pass (domain: arm.com, ip: 40.107.2.65, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=XNrNmBaGDBXEHjIo9hvoEyqamr82dNM87odqvHwTZw2LZ7VAvH3hIEkaVFjtjyUDsN14JSg89THgQi1zAna8uglV+BXeVutCmQxGeJOEBFCziG33BG91+8E3q2+MZ8wv727AvTyWVkX688p7xRVBI70J4AB7DkTnefVsscjz8aC7J/W16jZlB1bnfn6cCZfo1Efe+cFfrglpIn52JaKJZjy3DxOOA76FyJcvvv4H2fck8N8rwFZgre8Dh3gSoST/QRgtWjvORUncGXYfBWfpZw/ApZDEPFpt0TxUcb6PTxjEVzGjYcthfWjLvZrff7gjSukmIuL9FCsop2ecwmVPHw== 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=vFJRMRK3zvs6Ynrrf1PGQVtbUqxMPsLD7y4HKm5oMh4=; b=JDAc700oTHUKsiQxu15f+tDk+zXE4vITvh9noYeZlbdyx6xlZj1Q44QSHSXBP3XlKR7/ZFoLQk5kIZVz0Pzg4R1VNtbSzEiYxa6yC2C9alDOhnbVN55juQ6O0C3WaDnyONPYINE7hRgL98QDdc+h5TVVojJXkNFuuruXjczUuM8clDlwjYgpODRcT2vkLyFPiIK3WEl8tfO6Bp2SXaGSzparz8yU8/knuSFbUOspD96FHyVLRfrE/3keVUHGKLJrlLCUx18CoN2eBi3kXBtrdn9W3HXZ4P5c/aD8hDzGpBVjf5vIqtz0CCm6px3GkpAfGk5nWSQItgbOsZmDc5sThw== 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=vFJRMRK3zvs6Ynrrf1PGQVtbUqxMPsLD7y4HKm5oMh4=; b=IGnSUKG6S4+TUAI3qjOTSqBLeMiSwoadzuz9wevg8LiHmHfkiTE9qYILwmi2psLYrjpiwIlPKa8uatHovaMoVRAbjJq2QGvEx//CLbm+SNwaBY93QFBI3382oMBmiSc1U6yZZ9f94XiDqi3vfEi8MRSVxK5EC7lI8U5SRj6mclI= Received: from AS9PR06CA0278.eurprd06.prod.outlook.com (2603:10a6:20b:45a::18) by DB8PR08MB3932.eurprd08.prod.outlook.com (2603:10a6:10:a2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15; Mon, 25 Jul 2022 11:12:36 +0000 Received: from VE1EUR03FT035.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45a:cafe::3e) by AS9PR06CA0278.outlook.office365.com (2603:10a6:20b:45a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19 via Frontend Transport; Mon, 25 Jul 2022 11:12:36 +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 VE1EUR03FT035.mail.protection.outlook.com (10.152.18.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.17 via Frontend Transport; Mon, 25 Jul 2022 11:12:35 +0000 Received: ("Tessian outbound cc6a8ab50b6b:v123"); Mon, 25 Jul 2022 11:12:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d1530698ce1d54c4 X-CR-MTA-TID: 64aa7808 Received: from 0d635526bdd6.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 752FB11E-8277-41AD-84FE-55EFC4FE6766.1; Mon, 25 Jul 2022 11:12:29 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0d635526bdd6.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 25 Jul 2022 11:12:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cdkvaZwBw48iLnM/c+1diVkOrf+qkutPHluo+97V7oMEVjyaf6LmeB5PLAhwFMnSTckvQtlvGmPhtxO/r8apqbzTbDvlq+MNw4TP2LaKAuHfRuBXl2VOIl6KLmPSLFhy5UFVtdbj9seHuBcLfDBfPSim4h1M7ofsv3Of0uFDLgKIFHLPJ4LGB/fqeG/4hVB+3JSYCBmlo97helNIQ0k5F+WhLZ6jKoc64B8rew29U8xkFBN++8NKPIwDDMyRjVbDbTjn2/6P2HcLvBJbow+ybeW9yBneNpQkkFF+x1XnzHflbW0jJl1keOK+G1mtWK8J0bBkZkON2e0Xz7AfwqKpfw== 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=vFJRMRK3zvs6Ynrrf1PGQVtbUqxMPsLD7y4HKm5oMh4=; b=emWlGiErPoWBEy+xg/MtKMeXM3wArjyQiRU00jZeCkSPJttHzYZfnhSa5+lNpBWql0wSvnMBn28KLZlmcMG8ymocCayxAllpH/RGfVLODtqR2e3xDvFMtymm63RtpASnAPB5agkyF7JrsLwbndc28Z77AhplqamN0OddUVxeCmeCl/lu8YDM0mNciG2qhWuZwZb6XBL4PLHu6OmRhj2uwfk/+q1PCh3YVl/YnOzUnGrCXHUUsPlO71e5xIAHXS7mdTf/Qh8ZW3pbYN6dLNkd63E/JQD+ph6lyH3L8mLmng6tt9tnR9AW76E+FH0Sq3FJ5TFNndaaC8y1/y4oauuPtw== 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=vFJRMRK3zvs6Ynrrf1PGQVtbUqxMPsLD7y4HKm5oMh4=; b=IGnSUKG6S4+TUAI3qjOTSqBLeMiSwoadzuz9wevg8LiHmHfkiTE9qYILwmi2psLYrjpiwIlPKa8uatHovaMoVRAbjJq2QGvEx//CLbm+SNwaBY93QFBI3382oMBmiSc1U6yZZ9f94XiDqi3vfEi8MRSVxK5EC7lI8U5SRj6mclI= 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 GV1PR08MB7379.eurprd08.prod.outlook.com (2603:10a6:150:23::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Mon, 25 Jul 2022 11:12:25 +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.024; Mon, 25 Jul 2022 11:12:25 +0000 Message-ID: Date: Mon, 25 Jul 2022 12:12:24 +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 V4 1/1] ArmPlatformPkg/PrePeiCore: Invoke constructors for SEC phase To: Rohit Mathew , devel@edk2.groups.io Cc: Ard Biesheuvel , Rebecca Cran , Pierre Gondois , Thomas Abraham , nd@arm.com References: <20220722170257.32249-1-rohit.mathew@arm.com> From: "Sami Mujawar" In-Reply-To: <20220722170257.32249-1-rohit.mathew@arm.com> X-ClientProxiedBy: LO4P123CA0642.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:296::11) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 1d1052bd-b358-44f6-bb81-08da6e2e9423 X-MS-TrafficTypeDiagnostic: GV1PR08MB7379:EE_|VE1EUR03FT035:EE_|DB8PR08MB3932: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: DP7mLcrNw3yaYyL/grkRRu9FVhOm2OAuLYv9Rth5Kb2n2B00Ma5ziQxuAezLg23T0nvfRkEzw7NF0GYTJB6GpEuKZmLU1ybxEJEJVGlxxlfoRbF+f9RQAbUdZzOvJvJsEku2OvAeUZl4nBf35w7omLuxOvqXidi548dyPZfe4DQLX8UocTGMeUPPFFJCkePAsCk/yIWpwOviKyXNL/Oh9tlgqNEvsXVE4k/0/C0EONq5nIraTEo8dZYp4gykCRKr4xav9E1bPV/b7//snaTpzGBR+3+GPvJbz9zmktYFYnsPEDJrBkf99qwqAdWpMUJOU/G/bnozSqcpdFthmKRMXMIlsBy/YBeKO20gzO1SjKurcdyRJ7wr9GiUM2KTq/STTGHMlT1fYzIK7iV+qNBDGG/VaGjz49glpQSwq/UPalqboLy0iL0194po16XsdB2cbitenqZrUrdkOmGdNlrxP64pzdQDbop/MfPn+KlLfSNxXXgDF8CNZjP9VpbdmDyq6wceouxd/80O2wIvdegJBtGWchHkV74ASYnPTrupKbIn6q1O5WCy9iPMU0qNqRcZmS3FS4uAig8KV5C6g0kvqkOzY64nKO2j4UjJoYkK0xGfcx7jFdcWXTDN7oOdKpC8GFvYQnb8zgaVPyhLiice3NKdSFskNA/tVd17ebxpVIuRxmqNRt6LFTQM2MUtb9qqP4Ch7vzMyGuR2eDLViSO3lduSIkjaSLLuDDmLPrT4HdaRGRo1fbav0pRkc64//aQCO29804ibuUYS90lmxlWHlfJQHXkkW8iaootPSVQPcGhz+E++AZb3ZrXy5ouYexu0/TkmktcBqXTd+GyfuQxyWIFjAwjfUIElKXcY8eQabo= 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)(396003)(376002)(136003)(346002)(366004)(39860400002)(6506007)(5660300002)(41300700001)(44832011)(8936002)(478600001)(316002)(38100700002)(6512007)(53546011)(966005)(6486002)(26005)(4326008)(54906003)(186003)(8676002)(66476007)(66556008)(86362001)(31696002)(31686004)(2616005)(66946007)(36756003)(83380400001)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7379 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: VE1EUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 283c0199-cd97-4dda-923f-08da6e2e8e0f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EwM0dTVR8XM6gNESk3Xvg+h5nEuUb8U8wr/agnnyo6ZNTRW6Y2s+NmXAYLoDIFr5a08M395IP0qVp+CcgKMYqptR3x0t+E/7/bbB+mFFAAur9yFeY7Pd5nusGhLQtL3vr29g5di7F1MwMTLmmBEgVaWND7FHvy1w31AQTntfkD1Mv187bYfRzDRZgkPji3H6BPoQVKyOz+KTjuxetag0EgDUtG+7V39zMLHQtrIQ63zMf8qvzxtQKZK2O+gw5eIO85MnnheJ12IEWTiYYN4uLZhDDNtvZ8D1eZEXqNmRgbrOxqN0f40Th0F1mB40ERSjIuJ+R255KSaWL4ACAKwGdQUgzIQD2BqVOPl72NvkRa9kpvji2k6F1Ku+23s/Lj3mZE6TBNA8sIOwFPzVEJG2YaLjb71fM21j/jh0EwbbWP9o9Hi82RCnIT5haMqZ5nxbPBFFy+XkwvJBODto44Y33mmayko3bdq5rLadEIrRN3+2znSPFfB+DKpnSihUoch0WPUK4N+FZUVhKwabjskvZKZx2Wgis5a/av5Yts6S/p9TdOPz6136V7vCrWkbuJJlQ9BJZZBxCfMHzWGSLdeXxbmmaitKs4NaLqX1iNeMPQkxLuOk4AYhvSPMX/3vDfFGeu4LL5MyrCRNHQ8HhPT8x0fy+ISLRP9ZH3v88iNM9ZpwzgaQZPsdqgqjmHmSzCtqla4m1YyNYT1CQ+KxD1nDlfivTogsmd7WHoK42isMdaIC5Te348RRS6YeQg8AOafyXK8P1TdOzARHN+0z7HaISqXuHOjbJvCHWmDOqoopyIvosD3cVuc68VHDk6WqOT8nwvI/XnpHuIzPAkKWfkDG3T96QkPXHb6eEeDpgCfod3K7vO/U+tKP6M6Q13k8xOsb 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)(376002)(136003)(346002)(36840700001)(46966006)(40470700004)(2616005)(44832011)(70586007)(316002)(41300700001)(70206006)(82310400005)(8936002)(83380400001)(81166007)(966005)(8676002)(186003)(31686004)(6506007)(5660300002)(2906002)(36756003)(6512007)(36860700001)(40480700001)(54906003)(86362001)(82740400003)(40460700003)(47076005)(53546011)(4326008)(356005)(6486002)(31696002)(336012)(478600001)(26005)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 11:12:35.8094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d1052bd-b358-44f6-bb81-08da6e2e9423 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: VE1EUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB3932 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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);