From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.32.84; helo=nam01-sn1-obe.outbound.protection.outlook.com; envelope-from=brijesh.singh@amd.com; receiver=edk2-devel@lists.01.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0084.outbound.protection.outlook.com [104.47.32.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F3BDA21BADAB2 for ; Fri, 3 Aug 2018 07:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fZu0JGzV2UWywQPVN5jJK2UBustp9rkKPcLVLxf3hYk=; b=b/BmvJHSV3mHCebEyzaB58aOk4HvQghKae8TVtSb7hn25c4Ef/a/tOIRMcT5SShmUZUWEPaKwG566sjUlrYiH7It/9zq8R8T0TbjyANCv1rXrL/TRuR5kRSMgnvPstYniaGHbsTsxMRvHQ9QKl9tVSFbWgi40MNuE1D0B+nun+8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [10.236.136.62] (165.204.77.1) by DM6PR12MB2684.namprd12.prod.outlook.com (2603:10b6:5:4a::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Fri, 3 Aug 2018 14:21:42 +0000 Cc: brijesh.singh@amd.com, Ard Biesheuvel , Jordan Justen To: Laszlo Ersek , edk2-devel-01 References: <20180803003045.31740-1-lersek@redhat.com> From: Brijesh Singh Message-ID: <770a20d7-b2df-45e1-d3c7-353d35b0d34b@amd.com> Date: Fri, 3 Aug 2018 09:21:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180803003045.31740-1-lersek@redhat.com> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0801CA0002.namprd08.prod.outlook.com (2603:10b6:803:29::12) To DM6PR12MB2684.namprd12.prod.outlook.com (2603:10b6:5:4a::33) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c16ab8d9-80fd-4733-7127-08d5f94c6fea X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DM6PR12MB2684; X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2684; 3:fB3H4yVvPbz40B5APdc0Q620kqM3wDyF0vqOgG23pa2fpuGe0rSA/28zWMPvb7jS6CQGnjIOUwn3mNRJTduLe1MJy/qv575TCapVQ4tbAsH7a+mucZdJTTwfJjLzzpoUK7QA0gYe+5xsJiIMLZPJIE7MCzgag5zlhuaW/gjyhg+6FpAtyflclrUhU8aKY6R0bllT/qHB15ALBGZIwtem0eXdPC5PCG8V5UpALeOpDa22q7HnApNR3/X7lzZ95V50; 25:5DbRjYtpFexj78CJubjPlQzlYo4P+2yBmvpj2jrtFdo4ytUkqOFmI93hvkoea7RuAH/DCTcPPB3Hofq9ciJ9SQUuktVewweYINn6XDzUKlNSZfX2Q6gYYX04Egyt1yC6moHTGCV0l8N+tu63TNk3XnjYDyP0EkU9Ulgh2fyJwcCW0YIx4Sci3EiLVwZR8ZZVRa2BPPd9G7SLYv9sJMRjD39XWJKxvUnA/aUS0veY3QfKLzMJsqHxHh99bl6hLWUTU99qDr7H+ZA3VIF/ZFCjqkVNfECotwt8Jf5PNs+cCmB8GyHu9kFmFqBlQ4ekTr2Wu/7VXrmXb0+FhGVaR33Vmw==; 31:ggMbC4jHIqhnmo3h8hIIh8dWfPT7UlaOSpnaVs0xFzO4Qit+Cgv9NfU88eewmasskMPymZ26PH8y7MD1XWBLxtndjgYBS+xidON9DgblEgUjaClEynNwmghskHQo5qii+XuIA/ZjK15BoOwVy6WEcUEwSCBlwZ+W0FwJQcTEJwse2SKae4wobFRm5f/sRpTiF3htpIMhB5YV4YW3qN4fEZPQRgI9SE2biokIMQ0mEIU= X-MS-TrafficTypeDiagnostic: DM6PR12MB2684: X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2684; 20:dh1BytHrTHadR7LiA9wcDv3FBRWCJ8HGLM/Av5yNeJKcRO3XqCpekrgQEf86VY4nEhlnL6ozQUcIUxhy+E9WrAnPXeJpFTvyINKolIyos9YDnto0x1QxLy9/8Qxts5WmM2283U+o9L0unJnYmir73ex/xNp+BTYwwccFjX+fVBCAyySfhEejWoH5kGcb7uEEY6GQycsZXrtKFUVvBKtogxUEslijcaU1Pp460f91VKjun46ptGreWcFURAVjI0ny9xiRVHMOiyHHLhFaucO3Fg7m5WThgqDtM7tFhyDZ/EaLGeGbLBxN+pk7wDOLQduJmjQ163se18hiO9wm3GX1vMLxxYefJ4GXFRNSa0MYU5CX42cmxoZaMbBBY0DwIip0l5ssb2kQTwRuX0JpwV28AGDfcC26OlJr2JuxRCo+qo+QL2fDhcjxZIAtRxiyyK7ev4wK8l3dkGfl7XZ/ypwVOZSLJEHDj22fNVx13zASdTm2dHkAp+cguhIKRB6mA4XZ; 4:VBr8qXQKrjsem7cshuL3kcH78zovoxmwkcva1MnS3vcwZ6yYcsdlxZLtamJCo9EPsvZpxGjwbjCOKxDa99+5tJox/wWj/LoYCVBUZFziIrQuBStcpLEVefEeimJXJs0hIu0tXryBNyYzC0ll97kjrZTERrStXOHqFM5mo1CYnL+cFMYf/l4FjyyUY2R2v8+v1p5uKk9dtzpeyab80aYun8y6VS57gFO3zEG5xK5I8X0nXTIrcI/5sqc+WIapvStq/UmvXejZlySjgb2seey8ogk8hd488YBXKtlovaVJdvHGRGBM7Ljv2TL9BBZhb3k4ZwSrciMV6va5TnkPT873cA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM6PR12MB2684; BCL:0; PCL:0; RULEID:; SRVR:DM6PR12MB2684; X-Forefront-PRVS: 0753EA505A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6029001)(39860400002)(366004)(136003)(396003)(376002)(346002)(199004)(189003)(53936002)(81166006)(8676002)(76176011)(3846002)(8936002)(7736002)(305945005)(50466002)(6116002)(230700001)(97736004)(65826007)(52116002)(25786009)(64126003)(478600001)(6666003)(81156014)(2486003)(5660300001)(52146003)(6246003)(86362001)(68736007)(77096007)(316002)(4326008)(16526019)(47776003)(66066001)(65806001)(2906002)(44832011)(446003)(67846002)(26005)(31696002)(58126008)(31686004)(16576012)(386003)(11346002)(476003)(486006)(36756003)(575784001)(105586002)(956004)(110136005)(2616005)(106356001)(53546011)(23676004)(229853002)(186003)(6486002)(54906003)(65956001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2684; H:[10.236.136.62]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTZQUjEyTUIyNjg0OzIzOmlnSmIvZW12bGFuQmtWTnJwVVl3d2hTWm1m?= =?utf-8?B?eE9USDNNNytyWHhWa1c5WVczdGJrN1pCWXZQd0hjaThsdGJXaStkeFErSUNa?= =?utf-8?B?a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Tb/aBsRT2GrsU/7zjI9W3zMSutfoaeOpoksZWoLuo9XAFweesnCk1AvbW/4sQ+RFXjuGJp6ZoLPj5z8U6y7KCCrwiqGICz6Lts5c/NkZ0XcnXKvOvgKCuLXdeiime2nzU0cmrXSr8wc2GhNjvD8Fd0=; 7:krkFUcnrbFJRu+zO0hT3cG6mD21NxpS6i4zqeC+Ud3UroyqKBliSs2IGn1u5PdZdgS/VCn/tOqiQUoNemhXW7gIdz0GVJS2Th2JmY5eMUztZ4ocN+GPADAxeOXMKlrdruwHt5EZhDOGz7gnbKMvRXgvy3W+wBxffjj9wFMQurUwrtuKHOLidK/ioqZ70ikWVX/p6Vf3fLgEoyPRpbpaP5WPuZ5oA/0w4ZVeVJLdDHXUs5F3cw2IVKOgFMjulyQIq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2684; 20:VfDAqB+qlYE6HtUlbhUt/mFEvxC8ktxAE/Y0/K8EkLMGGX6svJ2QQz5jWLkwXYMALAMp/jpMiFJUSwTxq4CjHtZVGzas9EpCJdDvVUjC6Ep4SPnCozGtu7v2yEJnXAXOHKwmd5qJd0hJnyGJDzG7l/Zx8dcSnbuhrVnVS+ENHYWz2Lv1FF2tVzUEhKoBmfL0yyg+b0Kectmj1JM1/m+sramExuErj3PkU/72LzlivCGiEIy0FvqoCOb2dCY3H09W X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 14:21:42.9866 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c16ab8d9-80fd-4733-7127-08d5f94c6fea X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2684 Subject: Re: [PATCH] OvmfPkg/PlatformDebugLibIoPort: fix port detection for use in the DXE Core X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Aug 2018 14:21:46 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 08/02/2018 07:30 PM, Laszlo Ersek wrote: > The DXE Core is one of those modules that call > ProcessLibraryConstructorList() manually. > > Before DxeMain() [MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c] calls > ProcessLibraryConstructorList(), and through it, our > PlatformDebugLibIoPortConstructor() function, DxeMain() invokes the > DEBUG() macro multiple times. That macro lands in our > PlatformDebugLibIoPortFound() function -- which currently relies on the > "mDebugIoPortFound" global variable that has (not yet) been set by the > constructor. As a result, early debug messages from the DXE Core are lost. > > Move the device detection into PlatformDebugLibIoPortFound(), also caching > the fact (not just the result) of the device detection. > > (We could introduce a separate DebugLib instance just for the DXE Core, > but the above approach works for all modules that currently consume the > PlatformDebugLibIoPort instance (which means "everything but SEC").) > > This restores messages such as: > >> CoreInitializeMemoryServices: >> BaseAddress - 0x7AF21000 Length - 0x3CDE000 MinimalMemorySizeNeeded - 0x10F4000 > > Keep the empty constructor function -- OVMF's DebugLib instances have > always had constructors; we had better not upset constructor dependency > ordering by making our instance(s) constructor-less. > > Cc: Ard Biesheuvel > Cc: Brijesh Singh > Cc: Jordan Justen > Fixes: c09d9571300a089c35f5df2773b70edc25050d0d > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- > > Notes: > Brijesh, can you please test this patch on SEV, with and without > capturing the debug port? (In the first case, the debug log should just > work; in the second case, the boot should remain fast.) Thanks! I have tested the patch on SEV and it works well with and without the debug flag. thank you! Tested-by: Brijesh Singh