From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.8453.1658850628357234615 for ; Tue, 26 Jul 2022 08:50:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GzZpH9b6; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: osteffen@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658850627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1UCmze3Ja+OQbNoDgMegYWNypAVTGbRWz0qV37a4QCE=; b=GzZpH9b61gK8gHAhR8t5TDbrvLkbClh6VDVFh31JsQxeau0iPbs73gxdVwbhcOvhuU/ehx KgemtxdWYm3Twzs5mEpq6EfeACfMRCN0ASsZBlDSY4u1frvfUbdY+D6oqrfADy0R0R8l7X CeEP8c3v34rVF8hDiV5pEmKENNHOWcg= Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-142-Slw13VjZPMqrBarRWHMIvQ-1; Tue, 26 Jul 2022 11:50:25 -0400 X-MC-Unique: Slw13VjZPMqrBarRWHMIvQ-1 Received: by mail-vk1-f199.google.com with SMTP id s201-20020a1f2cd2000000b0037436d1f722so2830081vks.11 for ; Tue, 26 Jul 2022 08:50:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1UCmze3Ja+OQbNoDgMegYWNypAVTGbRWz0qV37a4QCE=; b=zxzPm2+0YtP0IX097d+eOTTRy9N8Bi0t2cTg9uSemO3m2D8dOx28h2HnKhxeeatwiK nM86YszDwIO+7lOaLb/Jv0uii8cX76uVBFcjE0kPVGkJIqPd8uxu0ifK/d0HOZLqpm9J /uXTdqJ1K664T8DCbu3KC48jT5vUv7W2SpXxcUZqxa2bl93nVzCEFz5PoXb+e4SxOvFj eAN1L/+OR9oLLFsa328AmKsTYH2L/eCTmiIqavDTdK9CkGveY6S78ZGB7o7f2N5B8HEi P/nw2uktZq5H4RL05s2m9yQdXOMeIeyQxWNRSNgLK3E8XntJo+qtzqpnepJAszdJsIYf lhHA== X-Gm-Message-State: AJIora+yGn6oeTfVhsPIKeO0jAfi56S8cW0b/I/bwcsbYSvj3fqBsfe+ 5cO46JoLk9RNWMLsmiyPzEzgFs0HCsy6lWAvDP8HfM26+HxEQirSDby2Cj2vBh6Ptf7pC22xlQW rVUyc17YFccMRIVvcd9bjbUJrbIyIsQ== X-Received: by 2002:a67:c894:0:b0:324:c5da:a9b5 with SMTP id v20-20020a67c894000000b00324c5daa9b5mr5173328vsk.33.1658850625157; Tue, 26 Jul 2022 08:50:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uK2K5KHtdlmwwnQQ5n3qSZUxHodmkK4hQUw89/PCQkz6AaGagNiF/Fq2spSG4vu6GYVxFIr/QQ71VKcbTeEnQ= X-Received: by 2002:a67:c894:0:b0:324:c5da:a9b5 with SMTP id v20-20020a67c894000000b00324c5daa9b5mr5173313vsk.33.1658850624899; Tue, 26 Jul 2022 08:50:24 -0700 (PDT) MIME-Version: 1.0 References: <20220726072848.640026-1-osteffen@redhat.com> <20220726072848.640026-3-osteffen@redhat.com> In-Reply-To: From: "Oliver Steffen" Date: Tue, 26 Jul 2022 17:50:13 +0200 Message-ID: Subject: Re: [PATCH 2/3] ArmPlatformPkg: PrePeiCore: write early hello message to the serial port To: Sami Mujawar Cc: "devel@edk2.groups.io" , Rebecca Cran , "quic_rcran@quicinc.com" , Ard Biesheuvel , Chasel Chiu , Gerd Hoffmann , Leif Lindholm , Nate DeSimone , Star Zeng , Andrew Fish , Laszlo Ersek Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=osteffen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000003ba42705e4b74233" --0000000000003ba42705e4b74233 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Sami, Thank you for pointing to that patch. It pretty much does the same thing and I would be OK with using it instead of these changes here. Except that the message only shows up in debug mode and seems to depend on the debug mask. It would be nice if it would show up all the time. We are building ArmVirt in debug, but with DEBUG_PRINT_ERROR_LEVEL=3D0x80000000, aka a "silent" debug build, and need the message there too. What was proposed in this series prints the message independently of the debug mask. Regards, Oliver On Tue, Jul 26, 2022 at 12:42 PM Sami Mujawar wrote: > Hi Oliver, > > There is a patch for review at > https://edk2.groups.io/g/devel/message/88884 which prints the firmware > version string. I believe with Ard's comments addressed that patch can be > merged. > Would that patch solve your purpose to print an early message for debug > purpose? > > Regards, > > Sami Mujawar > > =EF=BB=BFOn 26/07/2022, 08:29, "Oliver Steffen" wro= te: > > From: Laszlo Ersek > > Print the early hello message to the serial port. > > The FixedPcdGetSize() macro expands to an integer constant, therefore > an > optimizing compiler can eliminate the new code, if the platform DSC > doesn't override the empty string (size=3D1) default of > PcdEarlyHelloMessage. > > Signed-off-by: Laszlo Ersek > Signed-off-by: Oliver Steffen > --- > ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf | 2 ++ > ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 2 ++ > ArmPlatformPkg/PrePeiCore/PrePeiCore.h | 1 + > ArmPlatformPkg/PrePeiCore/MainMPCore.c | 7 +++++++ > ArmPlatformPkg/PrePeiCore/MainUniCore.c | 7 +++++++ > 5 files changed, 19 insertions(+) > > diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf > b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf > index a5b4722459d1..ea7b220bc831 100644 > --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf > +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf > @@ -66,6 +66,8 @@ [FixedPcd] > gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize > gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize > > + gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage > + > gArmTokenSpaceGuid.PcdGicDistributorBase > gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase > gArmTokenSpaceGuid.PcdGicSgiIntId > diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf > b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf > index 466a2b01c384..29fb8737cb2f 100644 > --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf > +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf > @@ -64,4 +64,6 @@ [FixedPcd] > gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize > gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize > > + gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage > + > gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack > diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h > b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h > index 0345dd7bdd2a..ae8302becda2 100644 > --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h > +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > > #include > #include > diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c > b/ArmPlatformPkg/PrePeiCore/MainMPCore.c > index b5d0d3a6442f..21c9d5f6da8f 100644 > --- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c > +++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c > @@ -116,6 +116,13 @@ PrimaryMain ( > UINTN TemporaryRamBase; > UINTN TemporaryRamSize; > > + if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) { > + SerialPortWrite ( > + FixedPcdGetPtr (PcdEarlyHelloMessage), > + FixedPcdGetSize (PcdEarlyHelloMessage) - 1 > + ); > + } > + > CreatePpiList (&PpiListSize, &PpiList); > > // Enable the GIC Distributor > diff --git a/ArmPlatformPkg/PrePeiCore/MainUniCore.c > b/ArmPlatformPkg/PrePeiCore/MainUniCore.c > index 1c2580eb923b..37560540e14f 100644 > --- a/ArmPlatformPkg/PrePeiCore/MainUniCore.c > +++ b/ArmPlatformPkg/PrePeiCore/MainUniCore.c > @@ -29,6 +29,13 @@ PrimaryMain ( > UINTN TemporaryRamBase; > UINTN TemporaryRamSize; > > + if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) { > + SerialPortWrite ( > + FixedPcdGetPtr (PcdEarlyHelloMessage), > + FixedPcdGetSize (PcdEarlyHelloMessage) - 1 > + ); > + } > + > CreatePpiList (&PpiListSize, &PpiList); > > // Adjust the Temporary Ram as the new Ppi List (Common + Platform > Ppi Lists) is created at > -- > 2.37.1 > > > IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended > recipient, please notify the sender immediately and do not disclose the > contents to any other person, use it for any purpose, or store or copy th= e > information in any medium. Thank you. > --0000000000003ba42705e4b74233 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Sami,

Thank you for pointing to= that patch. It pretty much does the same thing
and I would be OK with u= sing it instead of these changes here. Except
that the message only show= s up in debug mode and seems to depend on the
debug mask. It would be ni= ce if it would show up all the time.

We are building ArmVirt in debu= g, but with
DEBUG_PRINT_ERROR_LEVEL=3D0x80000000, aka a "silent&quo= t; debug build, and need
the message there too.

What was proposed= in this series prints the message independently of the
debug mask.
<= div style=3D"font-size:small" class=3D"gmail_default">

Regards,=C2=A0Oliver

On Tue, Jul 26, 2022 at 12:42 PM Sami Mujawar <Sami.Mujawar@arm.com> wrote:
Hi Oliver,

There is a patch for review at https://edk2.groups.io/g/= devel/message/88884 which prints the firmware version string. I believe= with Ard's comments addressed that patch can be merged.
Would that patch solve your purpose to print an early message for debug pur= pose?

Regards,

Sami Mujawar

=EF=BB=BFOn 26/07/2022, 08:29, "Oliver Steffen" <osteffen@redhat.com> wro= te:

=C2=A0 =C2=A0 From: Laszlo Ersek <lersek@redhat.com>

=C2=A0 =C2=A0 Print the early hello message to the serial port.

=C2=A0 =C2=A0 The FixedPcdGetSize() macro expands to an integer constant, t= herefore an
=C2=A0 =C2=A0 optimizing compiler can eliminate the new code, if the platfo= rm DSC
=C2=A0 =C2=A0 doesn't override the empty string (size=3D1) default of =C2=A0 =C2=A0 PcdEarlyHelloMessage.

=C2=A0 =C2=A0 Signed-off-by: Laszlo Ersek <lersek@redhat.com>
=C2=A0 =C2=A0 Signed-off-by: Oliver Steffen <osteffen@redhat.com>
=C2=A0 =C2=A0 ---
=C2=A0 =C2=A0 =C2=A0ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf=C2=A0 | = 2 ++
=C2=A0 =C2=A0 =C2=A0ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 2 ++<= br> =C2=A0 =C2=A0 =C2=A0ArmPlatformPkg/PrePeiCore/PrePeiCore.h=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 | 1 +
=C2=A0 =C2=A0 =C2=A0ArmPlatformPkg/PrePeiCore/MainMPCore.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 | 7 +++++++
=C2=A0 =C2=A0 =C2=A0ArmPlatformPkg/PrePeiCore/MainUniCore.c=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0| 7 +++++++
=C2=A0 =C2=A0 =C2=A05 files changed, 19 insertions(+)

=C2=A0 =C2=A0 diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b= /ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
=C2=A0 =C2=A0 index a5b4722459d1..ea7b220bc831 100644
=C2=A0 =C2=A0 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
=C2=A0 =C2=A0 +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
=C2=A0 =C2=A0 @@ -66,6 +66,8 @@ [FixedPcd]
=C2=A0 =C2=A0 =C2=A0 =C2=A0gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStac= kSize
=C2=A0 =C2=A0 =C2=A0 =C2=A0gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondarySt= ackSize

=C2=A0 =C2=A0 +=C2=A0 gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 =C2=A0gArmTokenSpaceGuid.PcdGicDistributorBase
=C2=A0 =C2=A0 =C2=A0 =C2=A0gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0gArmTokenSpaceGuid.PcdGicSgiIntId
=C2=A0 =C2=A0 diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf = b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
=C2=A0 =C2=A0 index 466a2b01c384..29fb8737cb2f 100644
=C2=A0 =C2=A0 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
=C2=A0 =C2=A0 +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
=C2=A0 =C2=A0 @@ -64,4 +64,6 @@ [FixedPcd]
=C2=A0 =C2=A0 =C2=A0 =C2=A0gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStac= kSize
=C2=A0 =C2=A0 =C2=A0 =C2=A0gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondarySt= ackSize

=C2=A0 =C2=A0 +=C2=A0 gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 =C2=A0gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTem= pStack
=C2=A0 =C2=A0 diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h b/ArmPlat= formPkg/PrePeiCore/PrePeiCore.h
=C2=A0 =C2=A0 index 0345dd7bdd2a..ae8302becda2 100644
=C2=A0 =C2=A0 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
=C2=A0 =C2=A0 +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
=C2=A0 =C2=A0 @@ -16,6 +16,7 @@
=C2=A0 =C2=A0 =C2=A0#include <Library/DebugLib.h>
=C2=A0 =C2=A0 =C2=A0#include <Library/IoLib.h>
=C2=A0 =C2=A0 =C2=A0#include <Library/PcdLib.h>
=C2=A0 =C2=A0 +#include <Library/SerialPortLib.h>

=C2=A0 =C2=A0 =C2=A0#include <PiPei.h>
=C2=A0 =C2=A0 =C2=A0#include <Ppi/TemporaryRamSupport.h>
=C2=A0 =C2=A0 diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c b/ArmPlat= formPkg/PrePeiCore/MainMPCore.c
=C2=A0 =C2=A0 index b5d0d3a6442f..21c9d5f6da8f 100644
=C2=A0 =C2=A0 --- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c
=C2=A0 =C2=A0 +++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
=C2=A0 =C2=A0 @@ -116,6 +116,13 @@ PrimaryMain (
=C2=A0 =C2=A0 =C2=A0 =C2=A0UINTN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0TemporaryRamBase;
=C2=A0 =C2=A0 =C2=A0 =C2=A0UINTN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0TemporaryRamSize;

=C2=A0 =C2=A0 +=C2=A0 if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) {<= br> =C2=A0 =C2=A0 +=C2=A0 =C2=A0 SerialPortWrite (
=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 FixedPcdGetPtr (PcdEarlyHelloMessage),<= br> =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 FixedPcdGetSize (PcdEarlyHelloMessage) = - 1
=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 );
=C2=A0 =C2=A0 +=C2=A0 }
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 =C2=A0CreatePpiList (&PpiListSize, &PpiList);<= br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0// Enable the GIC Distributor
=C2=A0 =C2=A0 diff --git a/ArmPlatformPkg/PrePeiCore/MainUniCore.c b/ArmPla= tformPkg/PrePeiCore/MainUniCore.c
=C2=A0 =C2=A0 index 1c2580eb923b..37560540e14f 100644
=C2=A0 =C2=A0 --- a/ArmPlatformPkg/PrePeiCore/MainUniCore.c
=C2=A0 =C2=A0 +++ b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
=C2=A0 =C2=A0 @@ -29,6 +29,13 @@ PrimaryMain (
=C2=A0 =C2=A0 =C2=A0 =C2=A0UINTN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0TemporaryRamBase;
=C2=A0 =C2=A0 =C2=A0 =C2=A0UINTN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0TemporaryRamSize;

=C2=A0 =C2=A0 +=C2=A0 if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) {<= br> =C2=A0 =C2=A0 +=C2=A0 =C2=A0 SerialPortWrite (
=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 FixedPcdGetPtr (PcdEarlyHelloMessage),<= br> =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 FixedPcdGetSize (PcdEarlyHelloMessage) = - 1
=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 );
=C2=A0 =C2=A0 +=C2=A0 }
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 =C2=A0CreatePpiList (&PpiListSize, &PpiList);<= br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0// Adjust the Temporary Ram as the new Ppi List = (Common + Platform Ppi Lists) is created at
=C2=A0 =C2=A0 --
=C2=A0 =C2=A0 2.37.1


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.
--0000000000003ba42705e4b74233--