On Wed, 6 Sept 2023 at 23:49, Oliver Smith-Denny
<o...@linux.microsoft.com> 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 <quic_llind...@quicinc.com>
> Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
> Cc: Sami Mujawar <sami.muja...@arm.com>
> Cc: Gerd Hoffmann <kra...@redhat.com>
>
> Signed-off-by: Oliver Smith-Denny <o...@linux.microsoft.com>

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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to