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 81B09941AC3 for ; Wed, 10 Jan 2024 16:13:28 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7NQGg5f8UqGOlLCCMijNoLCwDn983sY4obiJcdFAZzA=; 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=1704903207; v=1; b=u+8SwBkxUgsj8APaiXD2Yj7OH0BtIs0tyKQB5NusbUqSCVoiLnuHN+06Yi8KMP/Nv2JQGC2T /B64n0uo67DD+L64n1AjwoyJJTpt5uVj+X0deYe7pKE4wDXmKnEEDWG3HxGem54X7b/aAzBDWfi 91JYoeFv8GCUiUQl6KcwgdIQ= X-Received: by 127.0.0.2 with SMTP id oOdzYY7687511xJqaaH5K2y3; Wed, 10 Jan 2024 08:13:27 -0800 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.73]) by mx.groups.io with SMTP id smtpd.web11.15628.1704903205585851978 for ; Wed, 10 Jan 2024 08:13:26 -0800 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=eyz/3TE3qIMhfkG/+T4t4ltelJ8bKvg7uSN0m4O8oH+xL6R+ZYPOf80tWCxR7eduKPkmxa32MOpjBoNJV0A7w5OJwwSWA09TlPIIU+ODr6FWME0AalLgT1OETSgr7Fu8FAyFuTzvPng7IhI0q4uL3zj3DozHgYjpo+5Pe1VCug8xXnhT5GvE+0b+VJa45pVjLyIoZJMqnrWyuNrL9wX/xkzGnmKgx6I1s93NWZe9u8HxxU97KuhJl2wi9i4k4vp8ZNnvCQx+kWNHtmZmgo1Ow0YgRBRnMskR5bcTMQM3Mez2bl8JsbJZImNkFSyC9I6wAFqxuvKaLNXtu+8AmwoUVA== 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=7GXKt04v/nMdwDXCI+WzUxQM77FKL8eGto7vF9P0u0g=; b=SJKQhE9/GdQ+igJGA/9ibY+vwZAWVFMpiDRs7+TCdCNSruxA3W3C8Q87JluSOHC/qkx4ZbtrviAXS0VpcktwQ8mVsmfYBw3pE5CjG+9IjjxIm0YInY9VoE9jfGPbXMRp7KhQ2LTkpPkok4g4rFg8Oe0JQUEwlLlzrbjgBXKRzYlPP1b3mKNwAI5xnu7M0u5U/jgxF9EN4f83o7MFJWuW1Sbb9+GDCx6d5fL4jxjBGXLdU2rtN7v9gZQzEV6k44iRGgGmXH4Tl3VE4RiSsic/SadYWYOjXWhB6ia3joWgx2a45u+gbMzNI9uSwyDTCJJmwbxAy2zpOm/ps1ENPh50sA== 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 AS8P189CA0031.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:458::23) by AS2PR08MB10109.eurprd08.prod.outlook.com (2603:10a6:20b:64c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Wed, 10 Jan 2024 16:13:15 +0000 X-Received: from AMS1EPF00000040.eurprd04.prod.outlook.com (2603:10a6:20b:458:cafe::94) by AS8P189CA0031.outlook.office365.com (2603:10a6:20b:458::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17 via Frontend Transport; Wed, 10 Jan 2024 16:13:15 +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 AMS1EPF00000040.mail.protection.outlook.com (10.167.16.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.14 via Frontend Transport; Wed, 10 Jan 2024 16:13:14 +0000 X-Received: ("Tessian outbound 67699c3f02bc:v228"); Wed, 10 Jan 2024 16:13:14 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: eb85345572e0805a X-CR-MTA-TID: 64aa7808 X-Received: from 29b409961ead.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2BFFE136-12A3-4E7B-A26E-E93529CCEED3.1; Wed, 10 Jan 2024 16:13:07 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 29b409961ead.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Jan 2024 16:13:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CFw8DLLaTvFNTF/ebP82nl3SAjy2LQAARKGIXKY5J2FuM7gJ3Tofpxp31KWigoLj6BGJftigroV9p8/XG0thfVf3k7Goiz2bAVntWQ3qDjJgCWJlzcJwL2U2E9mnacQfRzqX/us8M8XuW0wY+bSpgCSOMu+ussq2TQiIw1qU3F99j+4VAu+pFEugbqBxqSSH2PO7EbUQceaNiX4lDDyyrfSuunCw40pmtX4DqwnVXa5vAi9LwwdajcKBWDcgMjwJGMc2BSWRdceHu7M8PLkjqwkNBXAiDebzxer+HHNNUmKOGh6a3Fpacq7jlYpkwI45rvcEpVwc4Y70vkuxBhfRrg== 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=7GXKt04v/nMdwDXCI+WzUxQM77FKL8eGto7vF9P0u0g=; b=hPuzuQW1PjNVNTNOz+gO8zucG2T/hwPsIZ2d+O6qQIKWQIG497eUDJ/4RxoWUchXIHC7hT/CXc6PWwMW1WBV+6hsdt9N8JImPfI61MLV27ERlt2o1Ri4Zyc9sKk3XAGafa5q4j4yYg7Va8G08EZ/r0j9XcJ1R1hQxWz5QeKblO+/yUBldWBmDqe4cmR58v4sMVfH4PPQlRZSSAzUsymFo+vVmQb5Hi1WTJ5+XxLlKoKlyvE6Nuf3PnoWvQXGBKtFbwbftKWjFoSshyYSIZR1rmQwOhBygRVPK4AadONuGWkmx+IaLaLMtbixC7pg3t5Zc1obfl8udnj+XKg/5m4FUA== 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 PA4PR08MB6175.eurprd08.prod.outlook.com (2603:10a6:102:eb::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Wed, 10 Jan 2024 16:13:04 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::d1af:fce9:2334:731b]) by AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::d1af:fce9:2334:731b%3]) with mapi id 15.20.7181.015; Wed, 10 Jan 2024 16:13:04 +0000 Message-ID: <5a9cd535-988e-4212-a0bb-f340d0b124f9@arm.com> Date: Wed, 10 Jan 2024 16:13:03 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Initialise serial port early in StandaloneMmEntryPoint To: Laszlo Ersek , Oliver Smith-Denny , devel@edk2.groups.io, Ard Biesheuvel Cc: sami.mujawar@arm.com, ray.ni@intel.com, pierre.gondois@arm.com, nd@arm.com References: <20240105114931.844886-1-yeoreum.yun@arm.com> <5a07db2b-ea25-495d-91f8-7b51ddd9ec75@arm.com> <51aea8c8-25bd-4630-b305-e4337284661e@linux.microsoft.com> <90dd9b46-b0a6-99f3-db30-4225c337e0a9@redhat.com> From: "levi.yun" In-Reply-To: <90dd9b46-b0a6-99f3-db30-4225c337e0a9@redhat.com> X-ClientProxiedBy: LO4P265CA0011.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ad::19) To AM0PR08MB4289.eurprd08.prod.outlook.com (2603:10a6:208:148::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AM0PR08MB4289:EE_|PA4PR08MB6175:EE_|AMS1EPF00000040:EE_|AS2PR08MB10109:EE_ X-MS-Office365-Filtering-Correlation-Id: 38ebad56-26b6-4fff-86b1-08dc11f70cbf 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: zd/8BDg/x7uW/LWDbXNXBVM9ZuZr5UVHr75dtrY4ma6Mi8Yaw/ImVpNVpCxmcsehBoma0Adqx38k3odWq+879F6FVebUB+bKUW9gM9UcT1IoZ+ccUx0d46hmNNVY4ngG44B43MQoguErn7CgfGRa6+1ZMXSCNhTwC7EZDN7xRReQGUkj3/QUURjGrrlXERPtyz6prviCAZSk+ooOPGxhfBWbXb9VdOnZikcC2GrovSVcNLUCNCdApCg/RrEr0j/4BcuOVKPKA5U0LsYYyI9cOKiGAoSmlh5zFPd3EbbAmgrd4O/B47ibgFsmJqarSRYalLIHM6J+9WqYJp4h567eiibpgcBtOYpbxK8FZdWmiMpiYoKEP8ZnRDRqQN+N8xskDrpfotLpdEVCZi9WVNFbQIF3n5WGi2pMJydSrcC8zREnmJs/8/pmgiqe86LUZcah90NP1SYG7fD1MqkD9sZ9yeB3lCnhxu3j/4JzZ4HzhvWHAKTAde8kk1tezEkz6jCEUb8EeDmmAElC12NqduYImHk8PgZgAVVAaXZYmffZWt+ToLWxI65i35PCDsFPMgI0Fw0hrGWxW8wsnKvq+M0NL2B91Mm7msL7PHvBWC3BXnS68MHgHPScZdZQi2+z9b3MKcgKeSYCcZWr5O3RLtsggA== 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)(136003)(396003)(39860400002)(346002)(366004)(376002)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(31686004)(478600001)(966005)(6512007)(6506007)(2616005)(26005)(38100700002)(31696002)(86362001)(36756003)(4326008)(41300700001)(19627235002)(83380400001)(5660300002)(2906002)(8936002)(8676002)(110136005)(66946007)(66556008)(316002)(66476007)(6486002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6175 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: AMS1EPF00000040.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8438f9a2-d9aa-4a06-f51f-08dc11f70697 X-Microsoft-Antispam-Message-Info: WJhVAtL8XRWUXwRjjOchUVa7Qna7oioHec89acztSLgnFwhQPKxDxkjTiiAUiWRw3XweJXvP4drBa7l8qnmb2OZoFJlddTGH7Mb3Qti8s7OE+DAF5/AvHCBjYrnhBTJv9lkzEl+cVPMhosympE+B9UwIQeaNPMbfqs9Be+WbyBo9P5Uoh0bdfxElavKQ7WwWbJSLfXs5c+44hxlErrXduSPD6/Ajmw6NuFmqacmNPyXMp+ZY5sxQVh+Z55pNW9frYSwTo6yapYrgPkwVKuLyM67ypskn+ZG86tLYiMxSGFBKF7BgJWiuXjiaid40rhRo2W/gDb9dBAg5FIVN7hqdUdEMS8aTOrTt0EBTKnUAM9js8OEc57wdDOqldRCzbCRVQC5VtWHlwoD4M/Z3SRlsJVj4R6T6WEFzCBsxcuOJorvBJdfLTNLS1nO6heWQzTXD5ePHfbEIKbbJpxb3wM5SW6Z3rKH8vU4c9XeAOoyZfEjLrCEH5br8Ht4BShCEhDuxgdglbiRYfcdRNFQ3BBIQyKztbKJ6rQHsPAE9v9q2lMl7sNi/IUYgdMZbFOoDhCEhtVWKsA8GZqg++4C2Nb/s5lrkft0Zdn+1zvmR4WT3+k5oETcvj9LZ+Tkhnvm/GTwEE/Qf4Hh00gMrBnjFNiV1X5Kt2BbrZmgXDOUJD3Fc8nm6V3d3r1F59liYFNynMDD/t8EQinUWjWu9D/P1JV3F2xV0mj3ozSMTjDNO6FrpK5WzOQCr/K7b+cdV70zt9LodymwzufJlXPDihZZl2kflkw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 16:13:14.7771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38ebad56-26b6-4fff-86b1-08dc11f70cbf 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: AMS1EPF00000040.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10109 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: xw36yA10llXbuzLT2HmVOI4vx7686176AA= 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=u+8SwBkx; 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 > My personal conclusion in that thread was [1], and correspondingly, > commit 5087a0773645 ("ArmVirtPkg/FdtPL011SerialPortLib: initialize > implicitly", 2023-10-07). In the end, the only tractable solution was to > initialize the serial port (hardware, and library instance) exactly > once, in (a) the constructor, or (b) the explicit SerialPortInitialize() > call, or (c) any SerialPortLib API, whichever occurred first. (And (a) > and (b) can be coalesced, because SerialPortInitialize() can be marked > as the constructor for the lib instance.) > > [1] http://mid.mail-archive.com/542db9e1-cd28-27a2-3a98-5b0c85cd7c79@redh= at.com > https://edk2.groups.io/g/devel/message/109235 > > Laszlo > In my personal thinking, It's better to make new interface like RETURN_STATUS EFIAPI SerialPortInitializeEarly ( VOID ); to solve this problem. Because, It makes a memory permission fault when we call SerialPortInitialize like ArmVirtPkg/Library/FdtPL011SerialPortLib where try to modify global variable. At the _ModuleEntryPoint of StandAloneMmCore which is FIRST entry from TF-A All of Image area is mapped as RO+X, so before load StandaloneMmCore, We couldn't write global variable. the purposes of above interface are: - Initalize serial port to use in early environment only (like StandAloneMmCore Entry Point) where couldn't write global variable by static information (FixedPcd). - It presume that all setting configured by it will be overwritten by SerialPortInitialize. 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 (#113534): https://edk2.groups.io/g/devel/message/113534 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-