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 71A50941B4A for ; Wed, 10 Jan 2024 17:16:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=OvS8CX4yDVCcBnEc+m69SaWbKt0CH6ZK7cJ8kWVTbRw=; 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=1704906984; v=1; b=ih/w9eBvAcrMb9ZIq1RpLFwgzqScbN/P03+NWUjx1hwwXdfG3GRSbNndXK9rr5U1EfJVYamk hyZJKmFPheb+U80CNQGRozVnrS25DT4xkjjrv+YRmbPyjzK+P6qBW4wkRFLqY4oGpo0YJGAaO2H FBKW0xBIJd9rxHp8PBVvskog= X-Received: by 127.0.0.2 with SMTP id 0lYTYY7687511xv54KXXw7QI; Wed, 10 Jan 2024 09:16:24 -0800 X-Received: from EUR03-DBA-obe.outbound.protection.outlook.com (EUR03-DBA-obe.outbound.protection.outlook.com [40.107.104.62]) by mx.groups.io with SMTP id smtpd.web10.17485.1704906982951770411 for ; Wed, 10 Jan 2024 09:16:23 -0800 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=GkgFjuApkv5V0cIUKOX/6Ecg3jkZVO8vddw1Kn6W/OIWIlLPu4dDKrf1Q17FwMig/RLLNugq7MKdfILnc5ZgNaXZcCTsJrwJiVHAYj1OA48Yjr7ocE9dBTv2LULfiSanYlYBFJWChxVQRqwlJ4bEyqkOX/aQc77IIL6atH3EBgu4HFwzWmJ5cF6R9AQFj7CGdWbLBzJuryiYh9zBXlKPPI0n+Kxz7kRatiCMV1UGr3xYfLBMNDFVayuer0R5LVMndlpWBDgbLv3Eha8WilncJekvd5JEiMrSVNN27ElMJCt6M/xyWL3phXbLHY1daCu/7BWjN17EfVmy4v1V8Y78XQ== 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=/Mw/1I1N/RaBzERuBO3tZr5tClhrIr3KcHln/JVW//8=; b=R0GdwBxV4Y+HkGppHIP5zT8lihU4ocfKNagYtrZa6b3YWdUWE4fnRq4sV9vrtNQIdJwkQT18ZsnM/93LkIxweLoejPSqm+HsG+cMTvdYbj96JVMmzOIkBt8ov4AzPG4DKiQenKq1GAfa+nAs7pzhNhAwJAUa7ckgdPRQcqAHt3ww2x279aiJ5gfLhajkgOXe+UJgpWXf1TZkODPbZZsbo3zlfTbzwzDIpdOWWrXP1yW1YnPh682Ec0cd8VEBZ5oqPy1/9vOst4MlhlJ/1WJ8zy2/SsOaPdJp2kENN7YYjFisq8iDOQVcfV/xWMd/h9fvn1AvjbEo31dbzJ+Fy6HikA== 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 AS9P250CA0022.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:532::28) by AM8PR08MB5603.eurprd08.prod.outlook.com (2603:10a6:20b:1d4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Wed, 10 Jan 2024 17:16:14 +0000 X-Received: from AMS0EPF0000019E.eurprd05.prod.outlook.com (2603:10a6:20b:532:cafe::34) by AS9P250CA0022.outlook.office365.com (2603:10a6:20b:532::28) 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 17:16:14 +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 AMS0EPF0000019E.mail.protection.outlook.com (10.167.16.250) 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 17:16:14 +0000 X-Received: ("Tessian outbound a064b9944658:v228"); Wed, 10 Jan 2024 17:16:14 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6b6e79a92c954e94 X-CR-MTA-TID: 64aa7808 X-Received: from 3cca14272a59.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BD2A055A-C1A2-443B-8838-2EC413B9C9C7.1; Wed, 10 Jan 2024 17:16:08 +0000 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3cca14272a59.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Jan 2024 17:16:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OMQWzrB34pVUTkdTjEWUzPi2rCVB0JhfX2/6vshNYsN80ai0KydyZGpUpqz5H8gAwh+EOzoruTQg7wDw+amCYDJQEMLD7oBXJ7n2I6AkUN3kl+0x46PZ+RGigdzyhPZlITRdBW5ZLQDHsZklt5fRNW+oWV0r3XjZCGrgnGwd6FbpMLWoTGkfJ1PrrnX+MuZ2ZJ21+PaZhlMaGvIeWZVAWzA9Bkwi2Rbhd9vzG+lN217RszhBVsJJRshgD95amluCmYpsIz5EWv78Zc7G8H1rcbwukzF9GiQv0zCjBw9eGApvvJc4o8JOFcN+lKPafIGNFGB7nkDMBYqHQPhRar1ipw== 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=/Mw/1I1N/RaBzERuBO3tZr5tClhrIr3KcHln/JVW//8=; b=Z8tVwUf6pY/NNmhFTff0WMnBlV02IBN2JKyj4UuFXE7064CtOLy0Ou1QqrO//+4lL6qEwGfODerUmtXn1QRhInK+TAyfLjiKxHkBDq2jvQ4UFIMBX2PKD2chCj22YHDtuos8Yc93dQPGPgrnrwcnyKBHQdc61pz6cxwnUdclHYmzXZO4gOc674V4K/cxIEqZajkiR0779oXVaRnllHyiiieZMxr4Up3R5Oj9ZJDxmFfm0WdzsmrYAhTM9NOY1mYQX+c1cGLNbkbVPj7WlCknqX4Mft/Rq+PG6rB/bS39o3Z5HJjyt5HPg+taCgFjTl9fDWF41NU6iYw5RpHzNZGuJA== 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 DBAPR08MB5816.eurprd08.prod.outlook.com (2603:10a6:10:1b3::16) 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 17:16:05 +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 17:16:05 +0000 Message-ID: <9e1c0701-c6f1-45a1-843f-5f4821eb6259@arm.com> Date: Wed, 10 Jan 2024 17:16:04 +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> <5a9cd535-988e-4212-a0bb-f340d0b124f9@arm.com> From: "levi.yun" In-Reply-To: X-ClientProxiedBy: LO2P123CA0103.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:139::18) To AM0PR08MB4289.eurprd08.prod.outlook.com (2603:10a6:208:148::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AM0PR08MB4289:EE_|DBAPR08MB5816:EE_|AMS0EPF0000019E:EE_|AM8PR08MB5603:EE_ X-MS-Office365-Filtering-Correlation-Id: 423b6fb1-424c-410e-5bea-08dc11ffd997 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: h8ToBEb9c0ZHui+rLWqV6erGumWtHGKNAgKGG8B1fNlNa0BWHn5KhISXA6ok75q+UTqUnmvVDjkLn2D2mzTo5STk4NuO+m5je0zCBQ9VE3CVFGXr3obI7qeD4TDEzhyfDdCO1BnqduaMtjfeVfMxc8bKuomv1fryudXD/F5vJOhv/ZA/oFCTjfrVs6E9H+9vsLdLt2yErnsDsBMl3Ck/QCcnw0TVAMYjjI1cg5xfGZmwaFQhc6SKRsbHqwn1v8CszMvoKX675LCl9kZkE9gm1SaIUxH3S64afEGVhAUTBTBDXCxZK7E/JsOlLdz4TrhzFa1meQOhgHebxcPU3+/lD2kHioMBSEw8/6B76gnYv+LhnupEkyt8DKifF/SS0W52SnH2GKl1lGuSrxh/RwO4tZ6DQl7JLtVvcB6t2bxbtLWbMuIgtJy1DgNKlXLoAo1MHhXXNkScUJXvTY8zjcEeKv/RAqX7PJrp0+4pjFTyfZbnJOS1J1MJprOhqlmBkwFM9hT3wsGSW3pGPF+2zFqvEeTjGbjhKrjx0JvYzqH4ai0hM1/DSvmSwjdNXRk/EF0io7PqMM56W71po3YqzGfZt7wC5AGK73/Np6Rr4v3Ybcx2JoNwl3h4aC7n44IsLMyt8Y16PTz6NEsDS2Iu1/KbyQ== 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)(376002)(136003)(366004)(346002)(396003)(39850400004)(230922051799003)(186009)(64100799003)(1800799012)(451199024)(31686004)(83380400001)(66946007)(41300700001)(86362001)(36756003)(31696002)(316002)(38100700002)(8676002)(26005)(2616005)(6506007)(6512007)(6486002)(2906002)(66556008)(66476007)(110136005)(478600001)(4326008)(5660300002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5816 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: AMS0EPF0000019E.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: cdc451fa-8dca-4207-7299-08dc11ffd424 X-Microsoft-Antispam-Message-Info: blOTe4JBXpOaG+Y1HquMobl5t+N9OOVo2ZR01VRG2hejiwIRV0fU44sJ4e8BQTKzhVgZcefceo1pqFXnAjQlFUPbxkbtI1rOD2SBQdf301QE8QX/BjKYCLM5nDj/EuB6d1oiSNA59DCBcauSf/4kl2pC9WUp9+WLqHuW6zORZHTK4DnF0pr/nDOblVWKa/Gw8USZd3GkWQpF6iA9CH10GH5ZGVtYUZVxwPMJk4qjE9Awi2t/Jg6R8kxX4D76ec+ln2VZn3NfrObeROJv9BmVOWhT3OP5hKx1MwD70TSfuRttagbni5XYXovk89y/npuGOYnAX6aepVl91G5jJFVw7gzNrdKF9dtZfh2fZOLnfqSvJGekEnyQBCDDjITs0AUwNekQQYQSxMcc28mbkM+7ASp30zFfuVrzWJqIzeaDGAS742+l1nOtPlq53OdEaCBR1Dif5oFRNqZhYNjrVhWNlWJ2LoE+KyzCLhT9n/c69ftx2c6IMq3fkkw7Pg6NXkv9r9O4LJcqMNW9VA8sQLLzTnaOGeVNtkkzZVFTPeXQbDTQAykgtvkDAGdhJVsmhGZAU17kTymzu0DOgIj2lNW6HbnZgUVbXw5v8F2KgqkMqOuX8CYpKhd2LGQcqmAABp8MrH4sD9pmiohx4kJJGKNcylqHoT1Zd+pbbAZul/pQIyiqnt2lVFwpMdpXWr1VCtNzW+OUWAB2eZVbqWM3jxADGkX1ztJf3EL5QkkIsinv58OxIXZJhEVDyc0msUsp5pn7mkVex7X9dF8IPhZ9TD8Ueg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 17:16:14.4050 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 423b6fb1-424c-410e-5bea-08dc11ffd997 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: AMS0EPF0000019E.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5603 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: BH8laZLF3AqVz82BNixr3mImx7686176AA= 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="ih/w9eBv"; 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, Laszlo. > This will keep initing the serial port upon every API call until the > global variable becomes writeable, and then the next API call will init > the serial port for one last time, and also prevent further page table > checks. > > The CheckWritable() function is an implementation detail. In the DXE > phase, it could be implemented (I think?) with the > GetMemorySpaceDescriptor() DXE service, or perhaps even the > EFI_MEMORY_ATTRIBUTE_PROTOCOL.GetMemoryAttributes() UEFI protocol member > function. In the standalone MM core, CheckWritable() could walk the page > tables explicitly. The idea is, either way, to *predict* whether writing > to "mInitialized" would trap. I think it wouldn't proper, to DxeCore and StMM too. IIUC, before CoreInitializeMemoryServices is called, we couldn't use that method in case DxeCore. And the problem now I face is also StMM before populating memory information (done in LibConstructor). > Now I think that speculative / out of order execution could actually > trigger the trap *before* GlobalsWriteable is calculated; however, I > think such a trap should be architecturally hidden (i.e., invisible). I > think at worst we could need a compiler barrier (maybe throw in some > "volatile" for GlobalsWriteable and mInitialized), so that the > *compiler* not try to reorder the accesses. But even that sounds like a > stretch. Agree if we develop CheckPerm?? Currently, (In my narrow thinking) there is no more generic solution than create new interface SerialPortInitilizeEarly. Am I missing? Many Thanks. -------- Sincerely, Levi. 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 (#113537): https://edk2.groups.io/g/devel/message/113537 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-