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 EE8A9740B6D for ; Thu, 7 Sep 2023 10:12:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=gNcMZ8ZeLnoo6jaaK25OmU+olKfJdL5N7f7kYqkLV8g=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1694081552; v=1; b=Bs1BLLhFpyDtmqYv1VDOUbqxPM0Gz63pGeu5uMGSzcHbY43H5zBpHwCAb42BwylieJ3OVrpp iOyhZE8l6VVtycUtxn2NknWPupGAcYNFclNoR1RZyQHI/ctYytLGGmBDi3ThGb+0vfhuGwTDN17 gqG7J4KcdGxDSfLGVpWH8D40= X-Received: by 127.0.0.2 with SMTP id n4xMYY7687511xdjiGtNAXqw; Thu, 07 Sep 2023 03:12:32 -0700 X-Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web10.9448.1694081551590966042 for ; Thu, 07 Sep 2023 03:12:32 -0700 X-Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8DE25B81D8F for ; Thu, 7 Sep 2023 10:12:29 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D5E6C4936D for ; Thu, 7 Sep 2023 10:12:28 +0000 (UTC) X-Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-500a8b2b73eso1215200e87.0 for ; Thu, 07 Sep 2023 03:12:27 -0700 (PDT) X-Gm-Message-State: XZ9WWIqzA0yuntzkzDYjhIyXx7686176AA= X-Google-Smtp-Source: AGHT+IGyT1W1cR0Qe+gvJfaq2Iq4BxCU3i2Bc42t42y534zfuvGocnRhGab6dp/xtWGFYEvopP+yMbLZ8HIFnsMu094= X-Received: by 2002:a05:6512:12ca:b0:500:a2d0:51b6 with SMTP id p10-20020a05651212ca00b00500a2d051b6mr5649007lfg.37.1694081546034; Thu, 07 Sep 2023 03:12:26 -0700 (PDT) MIME-Version: 1.0 References: <20230906214921.19827-1-osde@linux.microsoft.com> In-Reply-To: <20230906214921.19827-1-osde@linux.microsoft.com> From: "Ard Biesheuvel" Date: Thu, 7 Sep 2023 12:12:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: Enable Early Serial For DxeCore To: Oliver Smith-Denny Cc: devel@edk2.groups.io, Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Gerd Hoffmann 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,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Bs1BLLhF; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (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 On Wed, 6 Sept 2023 at 23:49, Oliver Smith-Denny wrote: > > Currently, ArmVirtPkg does not provide a serial library for DxeCore, > so any early prints are missed. These prints are extremely valuable > for debugging. > > The early serial port lib used by PeiCore and PEIMs is also > applicable to DxeCore and in testing works to print debug prints > from DxeCore throughout its lifecycle. > > This patchset adds the indicated support for DXE_CORE to > EarlyFdtPL011SerialPortLib and adds this as the serial port > instance for DxeCore in ArmVirtPkg. > > Github PR: https://github.com/tianocore/edk2/pull/4793 > > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Sami Mujawar > Cc: Gerd Hoffmann > > Signed-off-by: Oliver Smith-Denny Thanks for the patch. I agree that omitting early DXE core DEBUG output is not great. However, I'd like to understand a bit better why this happens. We have the PlatformPeim that discovers the UART base address and records it in a GUIDed HOB 'gEarlyPL011BaseAddressGuid'. So when DXE core launches, we already have the information we need stored somewhere, and using the 'early' flavor of the PL011 serialportlib that parses the DT for every line (or character?) printed seems unnecessary. Maybe it is a matter of tweaking the logic in ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c (for DEBUG builds only) to take the HOB into account even before the constructor has been called? > --- > ArmVirtPkg/ArmVirt.dsc.inc | 1 + > ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc > index 2443e8351c99..cf352619fd6e 100644 > --- a/ArmVirtPkg/ArmVirt.dsc.inc > +++ b/ArmVirtPkg/ArmVirt.dsc.inc > @@ -225,6 +225,7 @@ [LibraryClasses.common.DXE_CORE] > DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf > PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf > + SerialPortLib|ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf > > [LibraryClasses.common.DXE_DRIVER] > SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf > diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf > index 32b2d337d412..2c22ab088033 100644 > --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf > +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf > @@ -14,7 +14,7 @@ [Defines] > FILE_GUID = 0983616A-49BC-4732-B531-4AF98D2056F0 > MODULE_TYPE = BASE > VERSION_STRING = 1.0 > - LIBRARY_CLASS = SerialPortLib|SEC PEI_CORE PEIM > + LIBRARY_CLASS = SerialPortLib|SEC PEI_CORE PEIM DXE_CORE > > [Sources.common] > EarlyFdtPL011SerialPortLib.c > -- > 2.40.1 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108372): https://edk2.groups.io/g/devel/message/108372 Mute This Topic: https://groups.io/mt/101203427/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-