From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.16050.1591951201087230328 for ; Fri, 12 Jun 2020 01:40:01 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A2E6C1F1; Fri, 12 Jun 2020 01:40:00 -0700 (PDT) Received: from [192.168.1.69] (unknown [10.37.8.184]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D7403F73C; Fri, 12 Jun 2020 01:39:59 -0700 (PDT) Subject: Re: [edk2-devel] [edk2-platform][PATCH v1 1/1] Platforms/RaspberryPi: Remove DebugShowUEFIExit To: devel@edk2.groups.io, awarkentin@vmware.com, Samer El-Haj-Mahmoud Cc: Leif Lindholm , Pete Batard References: <20200612042741.26641-1-Samer.El-Haj-Mahmoud@arm.com> From: "Ard Biesheuvel" Message-ID: <6ebf49c5-f3e0-c932-a82e-5b23373bb3f7@arm.com> Date: Fri, 12 Jun 2020 10:39:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/12/20 8:25 AM, Andrei Warkentin via groups.io wrote: > Reviewed-by: Andrei Warkentin >=20 > Thanks for the cleanup, Samer. This debug feature was a gross hack that= =20 > was additionally incompatible with boot loaders changing GOP settings.= =20 > It was definitely time to see it go. >=20 Thanks Pushed as 2d07a49e4532..4c8c8868bbdb > ------------------------------------------------------------------------ > *From:* Samer El-Haj-Mahmoud > *Sent:* Thursday, June 11, 2020 11:27 PM > *To:* devel@edk2.groups.io > *Cc:* Leif Lindholm ; Ard Biesheuvel=20 > ; Pete Batard ; Andrei Warkentin= =20 > > *Subject:* [edk2-platform][PATCH v1 1/1] Platforms/RaspberryPi: Remove= =20 > DebugShowUEFIExit > The "Verbose ExitBootServices" feature was originally added to the RPi > as part of early OS enablement to show that the OS boot loader did > actually call ExitBootServices (back when OS boot used to crash shortly > after that). This is no longer needed, and should be removed as part of > cleaning the RPi PlatformBootManager to be more in-line with the ArmPkg > version. >=20 > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Pete Batard > Cc: Andrei Warkentin > Signed-off-by: Samer El-Haj-Mahmoud > --- > =A0Platform/RaspberryPi/RaspberryPi.dec=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 |=A0 1 - > =A0Platform/RaspberryPi/RPi3/RPi3.dsc=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0 1 - > =A0Platform/RaspberryPi/RPi4/RPi4.dsc=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0 1 - > =A0Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0 1 - > =A0Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootMana= gerLib.inf |=A0 1 - > =A0Platform/RaspberryPi/Include/ConfigVars.h=A0=A0=A0=A0=A0=A0=A0=A0=A0= = =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 |=A0 8 --- > =A0Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 | 13 ----- > =A0Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c=A0=A0=A0=A0=A0=A0= = =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0 8 = --- > =A0Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 | 53 -------------------- > =A0Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0 5 -- > =A010 files changed, 92 deletions(-) >=20 > diff --git a/Platform/RaspberryPi/RaspberryPi.dec=20 > b/Platform/RaspberryPi/RaspberryPi.dec > index 5b4021232cba..c71177a2f762 100644 > --- a/Platform/RaspberryPi/RaspberryPi.dec > +++ b/Platform/RaspberryPi/RaspberryPi.dec > @@ -60,7 +60,6 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic,= = =20 > PcdsDynamicEx] > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdMmcSdHighSpeedMHz|0|UINT32|0x00000= 012 > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdMmcDisableMulti|0|UINT32|0x0000001= 3 > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdDebugEnableJTAG|0|UINT32|0x0000001= 4 > -=A0 gRaspberryPiTokenSpaceGuid.PcdDebugShowUEFIExit|0|UINT32|0x00000015 > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdCustomCpuClock|0|UINT32|0x00000016 > =20 > gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes|0x3F|UINT8|0x000= 00017 > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot|0|UINT32|0x0000= 0018 > diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc=20 > b/Platform/RaspberryPi/RPi3/RPi3.dsc > index 059d16a912ab..4b1a1e763fa9 100644 > --- a/Platform/RaspberryPi/RPi3/RPi3.dsc > +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc > @@ -469,7 +469,6 @@ [PcdsDynamicHii.common.DEFAULT] > =A0=A0 # >=20 > =20 > gRaspberryPiTokenSpaceGuid.PcdDebugEnableJTAG|L"DebugEnableJTAG"|gConfig= DxeFormSetGuid|0x0|0 > - > gRaspberryPiTokenSpaceGuid.PcdDebugShowUEFIExit|L"DebugShowUEFIExit"|gCo= nfigDxeFormSetGuid|0x0|0 >=20 > =A0=A0 # > =A0=A0 # Display-related. > diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc=20 > b/Platform/RaspberryPi/RPi4/RPi4.dsc > index e055f13cdb47..c481c3534263 100644 > --- a/Platform/RaspberryPi/RPi4/RPi4.dsc > +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc > @@ -480,7 +480,6 @@ [PcdsDynamicHii.common.DEFAULT] > =A0=A0 # >=20 > =20 > gRaspberryPiTokenSpaceGuid.PcdDebugEnableJTAG|L"DebugEnableJTAG"|gConfig= DxeFormSetGuid|0x0|0 > - > gRaspberryPiTokenSpaceGuid.PcdDebugShowUEFIExit|L"DebugShowUEFIExit"|gCo= nfigDxeFormSetGuid|0x0|0 >=20 > =A0=A0 # > =A0=A0 # Display-related. > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf=20 > b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf > index 5a9819b54df2..cdce35bc74c8 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf > @@ -84,7 +84,6 @@ [Pcd] > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdMmcSdHighSpeedMHz > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdMmcDisableMulti > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdDebugEnableJTAG > -=A0 gRaspberryPiTokenSpaceGuid.PcdDebugShowUEFIExit > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdSystemTableMode > diff --git=20 > a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManage= rLib.inf=20 > b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManage= rLib.inf > index eb44daa4b7b7..88f6f8fe09ba 100644 > ---=20 > a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManage= rLib.inf > +++=20 > b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManage= rLib.inf > @@ -62,7 +62,6 @@ [FixedPcd] >=20 > =A0[Pcd] > =A0=A0 gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut > -=A0 gRaspberryPiTokenSpaceGuid.PcdDebugShowUEFIExit > =A0=A0 gRaspberryPiTokenSpaceGuid.PcdSdIsArasan >=20 > =A0[Guids] > diff --git a/Platform/RaspberryPi/Include/ConfigVars.h=20 > b/Platform/RaspberryPi/Include/ConfigVars.h > index cefddbafcd8f..fde24cab84af 100644 > --- a/Platform/RaspberryPi/Include/ConfigVars.h > +++ b/Platform/RaspberryPi/Include/ConfigVars.h > @@ -43,14 +43,6 @@ typedef struct { > =A0=A0=A0 UINT32 Enable; > =A0} DEBUG_ENABLE_JTAG_VARSTORE_DATA; >=20 > -typedef struct { > -=A0 /* > -=A0=A0 * 0 - Don't show UEFI exit message. > -=A0=A0 * 1 - Show UEFI exit message. > -=A0=A0 */ > -=A0=A0 UINT32 Show; > -} DEBUG_SHOW_UEFI_EXIT_VARSTORE_DATA; > - > =A0typedef struct { > =A0#define CHIPSET_CPU_CLOCK_LOW=A0=A0=A0=A0 0 > =A0#define CHIPSET_CPU_CLOCK_DEFAULT 1 > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr=20 > b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr > index 72cc90ae0bec..b0b20fd6fb37 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr > @@ -84,11 +84,6 @@ formset > =A0=A0=A0=A0=A0=A0 name=A0 =3D DebugEnableJTAG, > =A0=A0=A0=A0=A0=A0 guid=A0 =3D CONFIGDXE_FORM_SET_GUID; >=20 > -=A0=A0=A0 efivarstore DEBUG_SHOW_UEFI_EXIT_VARSTORE_DATA, > -=A0=A0=A0=A0=A0 attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS |=20 > EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, > -=A0=A0=A0=A0=A0 name=A0 =3D DebugShowUEFIExit, > -=A0=A0=A0=A0=A0 guid=A0 =3D CONFIGDXE_FORM_SET_GUID; > - > =A0=A0=A0=A0 efivarstore DISPLAY_ENABLE_SCALED_VMODES_VARSTORE_DATA, > =A0=A0=A0=A0=A0=A0 attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS |=20 > EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, > =A0=A0=A0=A0=A0=A0 name=A0 =3D DisplayEnableScaledVModes, > @@ -294,13 +289,5 @@ formset > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 option text =3D STRING_TOKEN(STR_D= EBUG_JTAG_ENABLE), value =3D=20 > 1, flags =3D 0; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 option text =3D STRING_TOKEN(STR_D= EBUG_JTAG_DISABLE), value=20 > =3D 0, flags =3D DEFAULT; > =A0=A0=A0=A0=A0=A0=A0=A0 endoneof; > - > -=A0=A0=A0=A0=A0=A0=A0 oneof varid =3D DebugShowUEFIExit.Show, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 prompt=A0=A0=A0=A0=A0 =3D STRING_TOKE= N(STR_DEBUG_EXIT_SHOW_PROMPT), > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 help=A0=A0=A0=A0=A0=A0=A0 =3D STRING_= TOKEN(STR_DEBUG_EXIT_SHOW_HELP), > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 flags=A0=A0=A0=A0=A0=A0 =3D NUMERIC_S= IZE_4 | INTERACTIVE, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 option text =3D STRING_TOKEN(STR_DEBU= G_EXIT_SHOW_NO), value =3D=20 > 0, flags =3D DEFAULT; > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 option text =3D STRING_TOKEN(STR_DEBU= G_EXIT_SHOW_YES), value=20 > =3D 1, flags =3D 0; > -=A0=A0=A0=A0=A0=A0=A0 endoneof; > =A0=A0=A0=A0 endform; > =A0endformset; > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c=20 > b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > index 52e37ba68ffd..81586fd90571 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > @@ -294,14 +294,6 @@ SetupVariables ( > =A0=A0=A0=A0 PcdSet32 (PcdDebugEnableJTAG, PcdGet32 (PcdDebugEnableJTAG= )); > =A0=A0 } >=20 > -=A0 Size =3D sizeof (UINT32); > -=A0 Status =3D gRT->GetVariable (L"DebugShowUEFIExit", > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &gConfigDxeFormSetG= uid, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 NULL, &Size, &Var32= ); > -=A0 if (EFI_ERROR (Status)) { > -=A0=A0=A0 PcdSet32 (PcdDebugShowUEFIExit, PcdGet32 (PcdDebugShowUEFIExi= t)); > -=A0 } > - > =A0=A0 Size =3D sizeof (UINT8); > =A0=A0 Status =3D gRT->GetVariable (L"DisplayEnableScaledVModes", > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &gConfigDxeFormS= etGuid, > diff --git=20 > a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c=20 > b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > index d347c733855d..cb74d65b7f91 100644 > --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > @@ -524,46 +524,6 @@ SerialConPrint ( > =A0=A0 } > =A0} >=20 > -STATIC > -VOID > -EFIAPI > -ExitBootServicesHandler ( > -=A0 IN EFI_EVENT=A0 Event, > -=A0 IN VOID=A0=A0=A0=A0=A0=A0 *Context > -=A0 ) > -{ > -=A0 EFI_STATUS Status; > -=A0 // > -=A0 // Long enough to occlude the string printed > -=A0 // in PlatformBootManagerWaitCallback. > -=A0 // > -=A0 STATIC CHAR16 *OsBootStr =3D L"Exiting UEFI and booting EL2 OS=20 > kernel!\r\n"; > -=A0 EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Green; > -=A0 EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black; > -=A0 EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Yellow; > - > -=A0 if (!PcdGet32 (PcdDebugShowUEFIExit)) { > -=A0=A0=A0 return; > -=A0 } > - > -=A0 Green.Raw =3D 0x00007F00; > -=A0 Black.Raw =3D 0x00000000; > -=A0 Yellow.Raw =3D 0x00FFFF00; > - > -=A0 Status =3D BootLogoUpdateProgress (Yellow.Pixel, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Black.Pixel, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 OsBootStr, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Green.Pixel, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 100, 0); > -=A0 if (Status =3D=3D EFI_SUCCESS) { > -=A0=A0=A0 SerialConPrint (OsBootStr); > -=A0 } else { > -=A0=A0=A0 Print (L"\n"); > -=A0=A0=A0 Print (OsBootStr); > -=A0=A0=A0 Print (L"\n"); > -=A0 } > -} > - > =A0// > =A0// BDS Platform Functions > =A0// > @@ -585,21 +545,8 @@ PlatformBootManagerBeforeConsole ( > =A0=A0 ) > =A0{ > =A0=A0 EFI_STATUS Status; > -=A0 EFI_EVENT ExitBSEvent; > =A0=A0 ESRT_MANAGEMENT_PROTOCOL *EsrtManagement; >=20 > -=A0 Status =3D gBS->CreateEventEx ( > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 EVT_NOTIFY_SIGNAL, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 TPL_NOTIFY, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ExitBootServicesHan= dler, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 NULL, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &gEfiEventExitBootS= ervicesGuid, > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &ExitBSEvent > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ); > -=A0 if (EFI_ERROR (Status)) { > -=A0=A0=A0 DEBUG ((DEBUG_ERROR, "%a: failed to register ExitBootServices= = =20 > handler\n", __FUNCTION__)); > -=A0 } > - > =A0=A0 if (GetBootModeHob () =3D=3D BOOT_ON_FLASH_UPDATE) { > =A0=A0=A0=A0 DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe .....= .\n")); > =A0=A0=A0=A0 Status =3D ProcessCapsules (); > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni=20 > b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni > index 7195e497f986..636de2184f09 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni > @@ -118,8 +118,3 @@ > =A0#string STR_DEBUG_JTAG_HELP=A0=A0=A0=A0=A0=A0=A0=A0 #language en-US = "Signals (nTRST,=20 > TDI, TMS, TCK, RTCK, TDO) -> Header pins (15, 7, 13, 22, 16, 18)" > =A0#string STR_DEBUG_JTAG_ENABLE=A0=A0=A0=A0=A0=A0 #language en-US "Ena= ble JTAG via GPIO" > =A0#string STR_DEBUG_JTAG_DISABLE=A0=A0=A0=A0=A0 #language en-US "Disab= le JTAG" > - > -#string STR_DEBUG_EXIT_SHOW_PROMPT=A0 #language en-US "Verbose=20 > ExitBootServices" > -#string STR_DEBUG_EXIT_SHOW_HELP=A0=A0=A0 #language en-US "Show message= when=20 > UEFI hands off to OS" > -#string STR_DEBUG_EXIT_SHOW_NO=A0=A0=A0=A0=A0 #language en-US "Do nothi= ng" > -#string STR_DEBUG_EXIT_SHOW_YES=A0=A0=A0=A0 #language en-US "Show farew= ell message" > --=20 > 2.17.1 >=20 >=20