From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.42]) by mx.groups.io with SMTP id smtpd.web10.1107.1594402468051058746 for ; Fri, 10 Jul 2020 10:34:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=U8c+NygQ; spf=pass (domain: arm.com, ip: 40.107.20.42, mailfrom: sami.mujawar@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=nwurAguN3Ivlb1muvplHJ+YU2IhTUnRnsPaEQbeG9ok=; b=U8c+NygQNsj8y7Qg0ug0kc1+Yrd+nq7okR2ZR4QQkoSmqdTyftnL9koRvCr/M6vQxy4+XLTrUsNf+Ax/dXv34K7yEDg7LI1qkzfamYfHi6WDdG2y18VuTjQy4FHseJYHgM99wgNxOcqb8RQhPhPW2C9rOoeGdfkXfKUOUeuC9FE= Received: from AM5PR0602CA0018.eurprd06.prod.outlook.com (2603:10a6:203:a3::28) by VI1PR0802MB2511.eurprd08.prod.outlook.com (2603:10a6:800:b1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Fri, 10 Jul 2020 17:34:23 +0000 Received: from VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:a3:cafe::3f) by AM5PR0602CA0018.outlook.office365.com (2603:10a6:203:a3::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22 via Frontend Transport; Fri, 10 Jul 2020 17:34:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT031.mail.protection.outlook.com (10.152.18.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Fri, 10 Jul 2020 17:34:22 +0000 Received: ("Tessian outbound 2ae7cfbcc26c:v62"); Fri, 10 Jul 2020 17:34:22 +0000 X-CR-MTA-TID: 64aa7808 Received: from 135072930b40.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3BACAF7D-1CE2-4E2A-B747-486783FED3A4.1; Fri, 10 Jul 2020 17:34:17 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 135072930b40.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jul 2020 17:34:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lrcXNeSH1GwUqJ9f1QWVMeMwxtE6KCxptjmrT9ofcE6zAnL6fOac3IbFoFEAUfRXtXLKie/Z6RyHARPAY5M9oOO7PqJt8TxaQBQ0UElgSTLpBFibkSxsl9m8xf6jGvQBM0bJK1iMTzyy3kSMsntD2nS2CslYKu/BCq7Oxyauo7RjcPEPjgXXrgaoRVbB4tK8DWnMwrwIYk9qzM+7+Zv4HpSiCduthEH61xTS9rSzFnhrDfAyn+U1fDsNde7u1ikKYrZoYHEty6VgI5QXUqxxiA+IfjZkeCVJCE5x8Sm4j93e+4T6ryimFxrmtVAmdodIW3gW81MAzHW081Q8thzwdA== 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-SenderADCheck; bh=nwurAguN3Ivlb1muvplHJ+YU2IhTUnRnsPaEQbeG9ok=; b=V43s8Zex/c+FqXpH2s+ilcQ9ZJa4R2VDcML/Eo/wkVx1u93RVMlzSneJ5I2UoZZ2ikNC4W4OmEY4jhrSVSWSJQI2Pe6BqZP3pRUgIZDbxtu0TVjr6CT8dL+cH/r7ytFRbhupRbEFpJbSTJFCQVxbw1EQH05IB8yR/oYIffUH6BJi7Mic5E89Eg4N9/ZM38S7ISteK/Pj6i4vFhNIQ15F+2CT7G5s8SOEpGmJrWcqwDh1FgXoAyU9xDw+JX2H188DgJXr5LxuwWWdWi8FctuGlvwglg6//QVYwMXdyNhWc+w9BEmHMjFJvbqoY5N0gCXG0JHJMOSIKAmFDc1qjN535A== 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=nwurAguN3Ivlb1muvplHJ+YU2IhTUnRnsPaEQbeG9ok=; b=U8c+NygQNsj8y7Qg0ug0kc1+Yrd+nq7okR2ZR4QQkoSmqdTyftnL9koRvCr/M6vQxy4+XLTrUsNf+Ax/dXv34K7yEDg7LI1qkzfamYfHi6WDdG2y18VuTjQy4FHseJYHgM99wgNxOcqb8RQhPhPW2C9rOoeGdfkXfKUOUeuC9FE= Received: from DB7PR08MB3097.eurprd08.prod.outlook.com (2603:10a6:5:1d::27) by DB8PR08MB5273.eurprd08.prod.outlook.com (2603:10a6:10:e8::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Fri, 10 Jul 2020 17:34:15 +0000 Received: from DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::9832:4116:bba6:2b97]) by DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::9832:4116:bba6:2b97%4]) with mapi id 15.20.3174.023; Fri, 10 Jul 2020 17:34:15 +0000 From: "Sami Mujawar" To: "devel@edk2.groups.io" , Hao A Wu , Ray Ni , "jian.j.wang@intel.com" , "hao.a.wu@intel.com" CC: Ard Biesheuvel , "leif@nuviainc.com" , "lersek@redhat.com" , Alexandru Elisei , Andre Przywara , Matteo Carlini , Laura Moretta , nd Subject: Re: [edk2-devel] [PATCH v4 07/15] MdeModulePkg: Fix constructor invocation ordering Thread-Topic: [edk2-devel] [PATCH v4 07/15] MdeModulePkg: Fix constructor invocation ordering Thread-Index: AQHWVF18ufLVrjgTKUiHDZxJ1r7SWKkBFpYg Date: Fri, 10 Jul 2020 17:34:15 +0000 Message-ID: References: <20200707124810.50668-1-sami.mujawar@arm.com> <161F794363CF42EE.6803@groups.io> In-Reply-To: <161F794363CF42EE.6803@groups.io> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: fd474176-2008-4679-b527-b31ca0490882.0 x-checkrecipientchecked: true Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; x-originating-ip: [217.140.99.251] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a8f71cfd-f1e0-4834-f71f-08d824f77bfc x-ms-traffictypediagnostic: DB8PR08MB5273:|VI1PR0802MB2511: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: n2lYuNPNC0s2flIPIixtISa0BmFGr/MmU0Nlm4AKhb/2zRDnacvbrQzyaHnrAs5PR1QE62RP+PnMVSusBXfVmxuCaAx0VHzTI3YQlNRk7gOZxRssHbpGPxmI1xHguE3Yi/2Pn160co/jrUgLiiL7L1mXlFhe4gRaJZ9cLimnS6d3gGN5EyMvcJZVmZpZBEsR4lUpK4lEJFu9hLhTOynx/lm1jh/P/qhMlz0ey1pZGGYYspTNWxHgCzjEja839petRwZfJoTDC3d99kvwC4POohL6DCGa1jDBZwpzNxeNlaC63PrJRlNYw56FO23gEVTqUjN7ySwlwY2x67f9rDSHKPdsDLPXzpLcrNP0+uzGYvCJ6mxs217iejFtF4Aj03xuSpSmPSzESms4xWrFkqn0+A== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3097.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(39860400002)(376002)(346002)(366004)(2906002)(7696005)(52536014)(5660300002)(19627235002)(4326008)(55016002)(76116006)(66446008)(8676002)(54906003)(71200400001)(316002)(110136005)(66946007)(9686003)(966005)(8936002)(6506007)(53546011)(26005)(33656002)(83380400001)(478600001)(86362001)(66556008)(64756008)(66476007)(186003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: q5ZwmILfwn2vn/EDBZn655uBi2gCnqszoMExjXF91OAyDoDJlBBPByk+dYnkkJ8rXOL1yVQqWBFWZb7kRYVRY7Da/htfqVNTsTD8329eYuvnkQy1Nhf9czj5Sfc3JJkrIXTQYX8YqPIyprcUoHftY8/J55LW7uDZ4u8eXMFTFJh37JvIpd+q9vZzvJ33OSZt8hO8DpQFrQmtpa5KqQ+CZJeuduWd4EcouzEgCTsQLFmnT6HzaTcR1sjfh4jjo0LWuTdQ7EpzcMb+kGT/S3iu6A3Ur1YGHN9n9iDUNToDtolIjqdQfJt6MU9UM63JAzA2RyeX/Zx7NcQG1dkw8CMetmHukFXuPbEZRviLNuUxUSUl7SmoWKVsTiz0FlE82ygwc5u+OcEijoH0KcseGps/090XfCubN5hZn17xDC/p3efyG0TIQ6i1hVFjGEOrYTCS+CcsCksUA7EjQoro8Cc2mrvNTUSLcJspNZI/sPZ4jKCzKP+Qn6qr9asE07Z84uoj MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5273 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com 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;SFTY:;SFS:(4636009)(46966005)(110136005)(498600001)(83380400001)(8676002)(19627235002)(82310400002)(186003)(81166007)(336012)(5660300002)(9686003)(8936002)(356005)(54906003)(4326008)(55016002)(36906005)(26005)(966005)(52536014)(47076004)(33656002)(53546011)(70586007)(70206006)(2906002)(7696005)(6506007)(86362001);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 91a51625-0616-4d55-ab2f-08d824f77780 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LePrYqg1NxxqZ044vPI4rY3pMlnutPfQ2+0ZlwTWgRW4CMH3Adm1USIzRnGAHpRfhvTSlKf5WxvItCxBEvameIfm062lZw4oPdIBDEhdG4wEsf0wGxxot+J0tc2uE2KDAen2qVqgf6LyonesLp9ka6H9MUpd0wCNgTFOHNH5525MhOyndQDfBkzSDE1U/6++CPhUv6lfVUbQ1YPNMTrVihqOEDW2Ddo0GE+MmKu3Cad+6jFYIltrBSlDbgXuGGrZyPOMOaILj35C84F6hXHoTbYGMdGaPC1Usd7d7xsS2P2Apku5jd8z5OlzL+o37yM7QC74TWnOnlG183ZoTVeEfQLbRBd1JS5qyoagvOrCSBPXd740zuQMCIEmZ8LStcNZhE/tbcdl/ks+l45Y8GVMPnUe5t1KLiXgVUn4i4SKUnH74A9sMVhSUHbHbmkxhemU/dp/3P8lARMu4IejpVsKbXDQqxS4RuvNjtcJAoXU2eM= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2020 17:34:22.7530 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8f71cfd-f1e0-4834-f71f-08d824f77bfc 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: VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2511 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Hao, Jian, Can you let me know your feedback for this patch, please? Previous discussion on this patch can be seen at https://edk2.groups.io/g/= devel/topic/75081484 Regards, Sami Mujawar -----Original Message----- From: devel@edk2.groups.io On Behalf Of Sami Mujawa= r via groups.io Sent: 07 July 2020 01:48 PM To: devel@edk2.groups.io Cc: Sami Mujawar ; Ard Biesheuvel ; leif@nuviainc.com; lersek@redhat.com; jian.j.wang@intel.com; hao.a.= wu@intel.com; Alexandru Elisei ; Andre Przywara <= Andre.Przywara@arm.com>; Matteo Carlini ; Laura Mor= etta ; nd Subject: [edk2-devel] [PATCH v4 07/15] MdeModulePkg: Fix constructor invoc= ation ordering The BaseSerialPortLib16550 library does not implement a constructor. This = prevents the correct constructor invocation order for dependent libraries. e.g. A PlatformHookLib (for the Serial Port) may have a dependency on retr= ieving data from a Hob. A Hob library implementation may configure its init= ial state in the HobLib constructor. Since BaseSerialPortLib16550 does not = implement a constructor, the Basetools do not resolve the correct order for= constructor invocation. To fix this, add an empty constructor to the serial port library BaseSeria= lPortLib16550. Signed-off-by: Sami Mujawar Acked-by: Ard Biesheuvel --- Notes: v4: - No code change, resending patch with v4 series. [Sam= i] Ref: https://edk2.groups.io/g/devel/topic/75081484 MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c | = 17 +++++++++++++++++ MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf | = 3 +++ 2 files changed, 20 insertions(+) diff --git a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib= 16550.c b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib1655= 0.c index 9cb50dd80d5634ab2aa6d68bf5ca7fb891463eef..0fd1382ee83c9de09d8250830b= d9569056fcee2f 100644 --- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c +++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550 +++ .c @@ -4,6 +4,7 @@ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
Copyright (c) 2018, AMD Incorporated. All rights reserved.
+ Copyright (c) 2020, ARM Limited. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -1102,3 +1103,19 @@ SerialPortSetAttributes ( return RETURN_SUCCESS; } =20 +/** Base Serial Port 16550 Library Constructor + + @retval RETURN_SUCCESS Success. +*/ +EFI_STATUS +EFIAPI +BaseSerialPortLib16550 ( + VOID + ) +{ + // Nothing to do here. This constructor is added to + // enable the chain of constructor invocation for + // dependent libraries. + return RETURN_SUCCESS; +} + diff --git a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib= 16550.inf b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16= 550.inf index 8b4ae3f1d4ee1e2e9a8b81eab4c900541ce8cfb6..92b7a8b7896a305d2ce22589f8= a9593618d37bb7 100644 --- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.i= nf +++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550 +++ .inf @@ -2,6 +2,8 @@ # SerialPortLib instance for 16550 UART. # # Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, ARM Limited. All rights reserved. +# # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -14,6 +16,7 @@ = [Defines] MODULE_TYPE =3D BASE VERSION_STRING =3D 1.1 LIBRARY_CLASS =3D SerialPortLib + CONSTRUCTOR =3D BaseSerialPortLib16550 =20 [Packages] MdePkg/MdePkg.dec -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'