From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a01:111:f400:fe02::61d; helo=eur01-db5-obe.outbound.protection.outlook.com; envelope-from=achin.gupta@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on061d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::61d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EDDDE211D56BC for ; Wed, 6 Mar 2019 08:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XzDslCyWNaafDnpgJlLWBuS6gXfuQiJmwn99Mna4EFc=; b=LA6B4tY8uR3Lpb4if7edpeqrHy7Io8C2UNd1HUzNEZdVUn28Yu+ynIh0ji5rgJkqJlWyNlBIOrhf821iz7hhS8wxT9JkE3zH4Y5eQ8y0SbYi0U3+J0QINMto7dP3yI+0bQPDDXDKyOF3LuNR/ihIVqMCVDd/f9Xv/UTkf6x3MsA= Received: from AM0PR08MB2980.eurprd08.prod.outlook.com (52.134.92.153) by AM0PR08MB3524.eurprd08.prod.outlook.com (20.177.109.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.19; Wed, 6 Mar 2019 16:55:23 +0000 Received: from AM0PR08MB2980.eurprd08.prod.outlook.com ([fe80::a133:50fa:bbbe:81a6]) by AM0PR08MB2980.eurprd08.prod.outlook.com ([fe80::a133:50fa:bbbe:81a6%5]) with mapi id 15.20.1665.020; Wed, 6 Mar 2019 16:55:23 +0000 From: Achin Gupta To: Ard Biesheuvel CC: "edk2-devel@lists.01.org" , Supreeth Venkatesh , Jiewen Yao , Leif Lindholm , Jagadeesh Ujja , nd Thread-Topic: [PATCH 05/10] StandaloneMmPkg/StandaloneMmCoreEntryPoint: drop explicit SerialPortLib call Thread-Index: AQHU01f1YoQlVPxnRE+q4w/HKlZ+T6X+zmMAgAAB0wCAAAPVgA== Date: Wed, 6 Mar 2019 16:55:22 +0000 Message-ID: <20190306165513.GR21602@mac-ubuntu-vm> References: <20190305133248.4828-1-ard.biesheuvel@linaro.org> <20190305133248.4828-6-ard.biesheuvel@linaro.org> <20190306163458.GQ21602@mac-ubuntu-vm> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mutt/1.9.4 (2018-02-28) x-originating-ip: [95.146.138.15] x-clientproxiedby: LO2P265CA0401.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:f::29) To AM0PR08MB2980.eurprd08.prod.outlook.com (2603:10a6:208:5b::25) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Achin.Gupta@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e4e4f35d-3a80-48b6-c3ae-08d6a25485e3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3524; x-ms-traffictypediagnostic: AM0PR08MB3524: nodisclaimer: True x-microsoft-exchange-diagnostics: 1; AM0PR08MB3524; 20:dF1zJcD2lcO1wY+LrsxY/Or7PXX5xX9n8AlWGMafG30XclwRndoVvMntoQB+c4OYmEC0TLHS1VM1OGeRPXwcJf9f5LRbs9kmZv5ktaloEElHmjZYn0HWIpxXD5wfQXCXbMXmoMCTTlscbJ+6Xd7tDLQHoV2BoXANkRsPEVfxrB8= x-microsoft-antispam-prvs: x-forefront-prvs: 0968D37274 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6029001)(7916004)(136003)(366004)(376002)(346002)(39860400002)(396003)(199004)(189003)(316002)(105586002)(7736002)(476003)(86362001)(446003)(44832011)(6436002)(478600001)(76176011)(6486002)(5660300002)(25786009)(256004)(11346002)(99286004)(1076003)(71200400001)(71190400001)(52116002)(229853002)(72206003)(93886005)(486006)(53936002)(9686003)(58126008)(33656002)(6512007)(26005)(81156014)(66066001)(8676002)(6506007)(4326008)(386003)(102836004)(6246003)(6916009)(54906003)(186003)(68736007)(14454004)(2906002)(33716001)(305945005)(97736004)(81166006)(6116002)(3846002)(8936002)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3524; H:AM0PR08MB2980.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: W8xe83+b5XSsyPn4ArtsX3JL+gcyhM/PYGVLd47HqVGhnYO8Mbh7Pdc8tKfQNhuvi8niTL8yjtG7OOgpG5rymAN66BRk7udmDXYfqtIlADJrg5A63xQjndyh0TYoRtwY5bhTEouM+54ZZzuQlS+yOzRhN5/EkhLYyj91rbQ1zfZJLR1uPZq/wju3WS6T6hmruIpP57fkXZNBguLsMQQ56vQbNP7InLDzimk8Rly2+zkqhI2iBMEomIMjzAx3mueuT4H+JDs9ALVXl3ZZRsMCnpXYDM2BH/Ud4NJymrPAF7I0wa9T8IsdP7cKClhv7e/9XF4EVs23a6CLt50HGCMsKL512lJpcyBjjUlU3aU+4j8UDfjPAo5Z+UXWgkG82/KXqeM02gBfck1I7l0vYzGnJNuEWXroHeo/+fjtgERMRa0= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4e4f35d-3a80-48b6-c3ae-08d6a25485e3 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Mar 2019 16:55:22.9444 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3524 Subject: Re: [PATCH 05/10] StandaloneMmPkg/StandaloneMmCoreEntryPoint: drop explicit SerialPortLib call X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 X-List-Received-Date: Wed, 06 Mar 2019 16:55:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable On Wed, Mar 06, 2019 at 05:41:30PM +0100, Ard Biesheuvel wrote: > On Wed, 6 Mar 2019 at 17:35, Achin Gupta wrote: > > > > Hi Ard, > > > > On Tue, Mar 05, 2019 at 02:32:43PM +0100, Ard Biesheuvel wrote: > > > Sending DEBUG output to the serial port should only be done via > > > DebugLib calls, which is in charge of initializing the serial > > > port when appropriate. So drop the explicit SerialPortInitialize () > > > invocation, and rely on normal constructor ordering to get the > > > serial port into the appropriate state at the right time. > > > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > Signed-off-by: Ard Biesheuvel > > > --- > > > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standalon= eMmCoreEntryPoint.c | 3 --- > > > 1 file changed, 3 deletions(-) > > > > > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch= 64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreE= ntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > > > index 5cca532456fd..c8e11a253d24 100644 > > > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Stan= daloneMmCoreEntryPoint.c > > > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Stan= daloneMmCoreEntryPoint.c > > > @@ -232,9 +232,6 @@ _ModuleEntryPoint ( > > > VOID *TeData; > > > UINTN TeDataSize; > > > > > > - Status =3D SerialPortInitialize (); > > > - ASSERT_EFI_ERROR (Status); > > > > This is done in the first few instructions after EL3 ERETs into S-EL0 t= o > > initialise the StMM partition. The constructors will be called a bit la= ter. I > > agree with the change but does EDK2 provide a mechanism for early print= s to the > > console in case we need this in future. > > > > If so, the correct way to achieve this would be to call the DebugLib > constructor by hand, and that should call the SerialPortLib > constructor. Unfortunately, EDK2 is not put together like that, and > especially constructor ordering is slightly broken. Thanks! Reviewed-by: achin.gupta@arm.com