From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 302A67803D2 for ; Fri, 5 Jan 2024 17:23:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=QGQciTS07Qx80qVOiIWtR1JS/rsHNyti7ui2fB2ioek=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Authentication-Results-Original:Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:NoDisclaimer:Original-Authentication-Results:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1704475388; v=1; b=gbgA/KJLhz5L0NaslUdnZb/JwlOszNwLZPKW/jrGCOpPT7Xs48lt1skQHLB23dJdc33M4q6q yE7ulaquluX5gtjA0SKAf3xHm+tX6GcqRd6IIOBS3t/ZHHNC3SUn2iRX0AuuMYSZH1DZ4hhtCQ/ 8vsBdyb4mdQoyplzf+nx14Uw= X-Received: by 127.0.0.2 with SMTP id UtgUYY7687511xZdbQWnoXba; Fri, 05 Jan 2024 09:23:08 -0800 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.62]) by mx.groups.io with SMTP id smtpd.web11.29198.1704475387750999073 for ; Fri, 05 Jan 2024 09:23:08 -0800 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=TDTA1eVr1TpYxa587tx1H+jqpX51dLLB1j1180L7eN0Ua2V1gqoIX7+quh6drXnlQ7VxbENDtLlTydA6f8e7+1w9ZOzyLs9oHgWcTut7yV+gceG9c3eQOgSaK1aNSR+Zyii0TrW/I8FhRmd3FiJyffWnlna+a8JglDZH7jUQA+9mhvOIyonyTL+5o1lwq0XZJsPNjZ0W6/3wPiz+bJEHW6VMVLMqZ6g1yKvvyaPLMkYH06BJrm04Jqger+9DqD/12sioQUsowklKAdjEUOJICKhowZOcwC7MqFozXMS9wYIZ5iA2MzUiuqrleVP1AxX6V6svRQsT5ia6Q4IO8uoxqg== 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=ur4IkzIwtPjdsLBFUtqLhbyuc3IosGbtvDU2t6zQGmM=; b=bMGz16493jVcGVdM+smdCEIJAtuiQYz9L7rha9wY7olhBgUoUggXFFEp/wtbAD0rbU0766ftdY4jx2gdz7vSDKE/zZ0wPvFW2cXysLksceEonU9H0MI0r1jJGzJQipErUFCqbmlVckkKKo/lvw4FnAY2TdpFkBPDkf2/yJSHHoIJAFxgoK5fpmp8vKfvJE8G6UiASQ5QdZGepd3lyraaClexA60CSFJjujGy9OZ/jkhLkzyyiYKppjnNgsDuJZ4mT3P+TTUTua7AtrC+kxLga+woKTvjhHLFeRSrGYlhWv4MGSWPPVxL4rW6L9Ob0tcEdzOWBxm7MRIS6e1SeFXGyA== 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]) X-Received: from AS9PR06CA0590.eurprd06.prod.outlook.com (2603:10a6:20b:486::14) by DU0PR08MB9439.eurprd08.prod.outlook.com (2603:10a6:10:42d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.17; Fri, 5 Jan 2024 17:23:03 +0000 X-Received: from AM4PEPF00025F95.EURPRD83.prod.outlook.com (2603:10a6:20b:486:cafe::42) by AS9PR06CA0590.outlook.office365.com (2603:10a6:20b:486::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16 via Frontend Transport; Fri, 5 Jan 2024 17:23:03 +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 X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM4PEPF00025F95.mail.protection.outlook.com (10.167.16.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.1 via Frontend Transport; Fri, 5 Jan 2024 17:23:03 +0000 X-Received: ("Tessian outbound 968ce956f8b7:v239"); Fri, 05 Jan 2024 17:23:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e6b6ae4fe6546d81 X-CR-MTA-TID: 64aa7808 X-Received: from 9732b1ea283c.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5A52A07F-0FA1-46D8-A208-F006236EECB5.1; Fri, 05 Jan 2024 17:22:56 +0000 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9732b1ea283c.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 Jan 2024 17:22:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTiK7GnPoq09COrLv061j3x5+hszdA4jS7pXLjEHMuMzvQTd52rgh21Fe79Je3SypDCCsMRSc5Uhd8btCNStfA2JRDY0XwyLmzSgvKOuFHWeJB6HQDys5FB8gO7b7K2P8/7MB4NyHeMofeirAB6+SJ3sq4s47R7d1JFrdvKEcupU0kU6cnkHf1uE6ry83s4l7EVBWzgzRuDHEgCow0neBc5dBSMxKOs0HkIWy09zAc+13ba382jmS8QHUa0+myl0oxOEsLSLHzD45A+UwP0w+Zll0hfiEH2fGdcj/kp/BxcmLEas1vtp3IKApzqdi245dAqJQPlktpgYTpmhu+4Gdg== 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=ur4IkzIwtPjdsLBFUtqLhbyuc3IosGbtvDU2t6zQGmM=; b=LQlfHLHoDcgpAXBBG0XPP+xUQcCBZMtzTA86qv+XCLFq+gBsC4nKe8fBfLS86mHac2mzQFo8JGjZKjEgIvEHocvLyjqcQWNEUElQVVdNhvd2GYoubjhUzFfrj8WVGPTprb6mmMeqfz826pSn9SWGjMaj1sCJLWs5kwMu+uxFTGOupuFshn6EezLQbFrvzqm/jvNrmWW3mDGvqEShLgeePQ3fXzJikBelga+p+u44VvXDUR9n3+Evg2Njkctk5iYDMhMqBNXPOMyir+q1eALwIEJqfJMIRWLyaQQMkRdLsGVrQ7ouOFDK3E3wCFxXqACSj6+WFt7jdYb4HTyUT+sZtg== 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 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com (2603:10a6:208:148::12) by AS8PR08MB5910.eurprd08.prod.outlook.com (2603:10a6:20b:296::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16; Fri, 5 Jan 2024 17:22:53 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::50d8:8f44:8189:811f]) by AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::50d8:8f44:8189:811f%7]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 17:22:53 +0000 Message-ID: <5a07db2b-ea25-495d-91f8-7b51ddd9ec75@arm.com> Date: Fri, 5 Jan 2024 17:22:49 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Initialise serial port early in StandaloneMmEntryPoint To: Ard Biesheuvel , devel@edk2.groups.io Cc: sami.mujawar@arm.com, ray.ni@intel.com, pierre.gondois@arm.com, nd@arm.com References: <20240105114931.844886-1-yeoreum.yun@arm.com> From: "levi.yun" In-Reply-To: X-ClientProxiedBy: LO4P265CA0145.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c4::7) To AM0PR08MB4289.eurprd08.prod.outlook.com (2603:10a6:208:148::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AM0PR08MB4289:EE_|AS8PR08MB5910:EE_|AM4PEPF00025F95:EE_|DU0PR08MB9439:EE_ X-MS-Office365-Filtering-Correlation-Id: 10c6e259-3c3f-4b9e-853c-08dc0e12f925 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: 3Rei2GF8tpPB+ewFChdssHvQn4PRhNMo9Gxu5m+yHrq77R0SWTiRtQTsbQKJ+bHkaBQ2WGGlaVONr9QZQMKYVIxFU2QYIZodg7IqyDCel42zHnb5gPWesL6cEr1Qo1KdbzRcrSeMwhotyaOv4kgeKdSSKYp+tR0rIxiLyeoD6bFfOT3yzVSlQ0uKVHKz/9sXXVWdCPpBxuZQtZdcrWEw7Ax31TWUFDvXJKhoqt+axWUrXakVAtiKXHXCxg20STSnZ6t3kyT6H5cTwK5Nzv5e1v19W/wi2G0Xe04vWnZ5uP/muU1o4d0aUuAtN6XcGNLH0DwHiNLTXIsFSL51MZz4t8ehH3/du3E8cidfTnD/g/PED/NVAFRxxAzfuPvSmYtHJXT0UJcl4rp1Dg3pckZ6O5WVLKG3e8oXtlJUMMpmywyg6dTVVdfTmBprCdC2dqGrFAnwzkIUCK425vkJKaCooZ8GN8AuPhb4Tw9HVq2GiZKoliAk9PHZsgH1sDjuHXqY/0lvqgL5K8VbS5Z6Fr1Ue052pyQp2mslNetKoEooXmg0PDAw8tVW3+VJPEQ6alWVBj3c4AH5BqSkpXW3MmaRQXRehDnUoswbkyYBbr5LLhciuHKsDCOmtDdIgTZBR9L4LQMCNBVY3gGWMOErCvyoubw7Bq3WWm5REn9TLNQpMkQ= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB4289.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(6029001)(346002)(396003)(136003)(39860400002)(376002)(366004)(230922051799003)(64100799003)(451199024)(186009)(1800799012)(66556008)(66476007)(66946007)(38100700002)(31686004)(31696002)(6506007)(86362001)(6512007)(6666004)(26005)(2616005)(2906002)(5660300002)(36756003)(478600001)(6486002)(83380400001)(8676002)(8936002)(4326008)(316002)(41300700001)(21314003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5910 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00025F95.EURPRD83.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 76ad28f9-799b-435d-10cc-08dc0e12f320 X-Microsoft-Antispam-Message-Info: 25T0WTgLSHRapDDZGDVlRSYQTkWA//GJDNE6+R14KCtPfm/fJTmn7y0cCR2VdtClx+v5YhZ6gmwW99x9pbgRJwZWAQgHx5H5t8oY5vv6q60m3EPve7uQhKUM8jHBUeLNEwIhPF4X41FjMRySERbOgKo0vBhq3SQho79A02kyUBXemxNIymwd6b/xhSEoenAVkvW5VqqXKLkBJ3zlLzcpAMAXJh1NNMjIijXHdHZMIXM72TC97TRBuHSVC+uY1f7KBmgPv/Gsq+jpCGqNBZUovwpWlTBxqfvhetQy+k0pgTMa0iNbMjXguj9dgLEkMP4U6a/dtXcGsrf/q+mRu6m5XC15uRgQZymxzRBZtmVBzbSSYbzKQLDZfrNrYYpfi2T8SkoDVspv6ATzz8HzuobvA5BneToO19R1fcMi7NrYFSSU7X4NultRNrUI6HQTTF6Hmyt544bM4PHL1iLz0JeN/jI1HqGFBpGQL166251n6VRGzWGQaLODZYZrGdDxquDQe7mtEUtQ8fkyt9/D1F2pbHDsA2tejZ8ZDnfMv3AA1Fsqv5wsoF64u1XjKr7ezpUQEG0pIMQhjXbG/mDC7v58HIubVroufUnRNWbxIHkPcN1eBtwF0Hsa1RY78TrkBFDmyEtkEVCHuVGNe/L3yh0dkYx2lT+LcQ1jh025Uj1aCdL3aM2QyE5f3lzDqSgJ+tSmRVdjL7kt4XHuXXbI7zQDhK4iL7VCfYKuTUvIRgHR3AE/jVJ7rpTtU6lm1jX86qWF84TmfpVqbWlSB4IgRIX+meAK2oFgrpD9R5dJfL/v9L0= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 17:23:03.1327 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10c6e259-3c3f-4b9e-853c-08dc0e12f925 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: AM4PEPF00025F95.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9439 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,yeoreum.yun@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: vO7bHuJzENQXsDQ92gXiLcPsx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="gbgA/KJL"; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Ard :) > So now we will always initialize the serial port in the entrypoint > only because DebugLib might use it later with doing the > initialization. > > That doesn't sound quite correct to me. > > Could you explain why we cannot rely on DebugLib to call the > initializer / constructor at the right time? Because, DebugLib constructor which use serial port is called in StandAloneMmMain function. But, this constrcutor is in _ModuleEntryPoint in StandAloneMmCoreEntry. That means all DEBUG used in _ModuleEntryPoint can use uninitialized serial port. one of typical example is GetSpmVersion function. _ModuleEntryPoint (in StandAloneMmCoreEntry) // Hazard Area start GetSpmVersion DEBUG (DEBUG_INFO, xxx) // It could be use uninitalized Serial port. ... // Hazard Area end ProcessModuleEntryPointList (StandAloneMmMain) ProcessLibraryConstructorList // Here. call DebugLib constructor with SerialPortIntialize When you see above, I would be clear. between Hazard Area Start to Hazard Area End. DEBUG macro would use uninitailized Serial port if that's not initialized by TF-A. So, It should be call SerialPortInitialized at the _ModuleEntryPoint. IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113313): https://edk2.groups.io/g/devel/message/113313 Mute This Topic: https://groups.io/mt/103540969/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-