From nobody Fri May 10 06:19:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+66932+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+66932+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1604420169; cv=none; d=zohomail.com; s=zohoarc; b=RrMDbgdV1e7hee9It3Jqnzm1m/qhtWODqMvIvfSi4HkdMrhFA0qohVfa8cFT0khLDVxHQvm8MQAs4GWUpMf/iygTNarA8Srn704rFyehJf29J86uWQrs7/EeQB/zzoteYiq/cAHtq93d+SH2IpkQIyEMw0+678yVYp63yBxCTf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604420169; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=TOaFb4QSyFP9CUzEi7cqG+e+9KU5zFhk2Xz9e++5kog=; b=O/yMWU5NIbkevZfdolNDnZSJmzUpgnEvXqFOfppTQ1Oe4IH04K1ec4goe8qW0R6lPIVh3uzp/TX+kjeGmlI3nEpfYVzOowGc9qT6ojXUMaTtRwuep+hmP03wFHkKzXS/cUcqpAztLhS5zgV8e5uKCnn3H7Klc0QPIkUXNQgr0xQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+66932+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 160442016943293.984316978361; Tue, 3 Nov 2020 08:16:09 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id fwTdYY1788612x9ajKE0ZZID; Tue, 03 Nov 2020 08:16:08 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.6385.1604420168116706465 for ; Tue, 03 Nov 2020 08:16:08 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-171-tIr5N7_UMNO0CwBEeP3cTA-1; Tue, 03 Nov 2020 11:16:04 -0500 X-MC-Unique: tIr5N7_UMNO0CwBEeP3cTA-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F336F6D587; Tue, 3 Nov 2020 16:16:00 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-129.ams2.redhat.com [10.36.112.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60C555C3E0; Tue, 3 Nov 2020 16:15:58 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Dandan Bi , Hao A Wu , Jeff Brasen , Jian J Wang , Leif Lindholm , Liming Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH] MdeModulePkg/Core/Dxe: log memory base and length, after lib ctors again Date: Tue, 3 Nov 2020 17:15:57 +0100 Message-Id: <20201103161557.30621-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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,lersek@redhat.com X-Gm-Message-State: xzv6xEp2fI5s7JzIU2E8AvEmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604420168; bh=TOaFb4QSyFP9CUzEi7cqG+e+9KU5zFhk2Xz9e++5kog=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=VWwZPqe6hZoeZ6PH7SmhqVKf51oaX01dmkZTHwiMob3fry8KlvOG7R8vV5uuXANm18k Ce6bJ3BlIUvEKp+QPESPqytja5x2Yfm7zxz1P8c2Kn71trkrYOOFDldCqz/ihXa7QTvlx pLPfrfAkKkbPCbdc6AzhbQkjgetF4KeUqdM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" CoreInitializeMemoryServices() logs "BaseAddress" and "Length" with DEBUG() before DxeMain() calls ProcessLibraryConstructorList() explicitly. (Library construction is not an automatic part of the DXE Core entry point.) So those DEBUG()s in CoreInitializeMemoryServices() are issued against an un-constructed DebugLib, and also against a -- possibly underlying -- un-constructed SerialPortLib. Some DebugLib instances can deal with this (see for example commit 91a5b1365075, "OvmfPkg/PlatformDebugLibIoPort: fix port detection for use in the DXE Core", 2018-08-06), while some others can't (see for example the DebugLib instance "MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf" coupled with the SerialPortLib instance "ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf"). Addressing this issue in a SerialPortLib instance that underlies BaseDebugLibSerialPort seems wrong; either the DebugLib instance should cope directly with being called un-constructed (see again commit 91a5b1365075), or the DXE Core should log relevant information *at least* after library instances have been constructed. This patch implements the latter (only for the "BaseAddress" and "Length" values calculated by CoreInitializeMemoryServices()). Cc: Ard Biesheuvel Cc: Dandan Bi Cc: Hao A Wu Cc: Jeff Brasen Cc: Jian J Wang Cc: Leif Lindholm Cc: Liming Gao Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- Notes: Repo: https://pagure.io/lersek/edk2.git Branch: dxecore_report_mem MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dx= e/DxeMain/DxeMain.c index 5ee4cd10b436..db21311f9352 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -297,8 +297,16 @@ DxeMain ( ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST); PERF_CROSSMODULE_END ("PEI"); PERF_CROSSMODULE_BEGIN ("DXE"); =20 + // + // Log MemoryBaseAddress and MemoryLength again (from + // CoreInitializeMemoryServices()), now that library constructors have + // executed. + // + DEBUG ((DEBUG_INFO, "%a: MemoryBaseAddress=3D0x%Lx MemoryLength=3D0x%Lx\= n", + __FUNCTION__, MemoryBaseAddress, MemoryLength)); + // // Report DXE Core image information to the PE/COFF Extra Action Library // ZeroMem (&ImageContext, sizeof (ImageContext)); --=20 2.19.1.3.g30247aa5d201 -=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 (#66932): https://edk2.groups.io/g/devel/message/66932 Mute This Topic: https://groups.io/mt/78009800/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-