From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A93B32095A6C9 for ; Wed, 5 Jul 2017 06:44:25 -0700 (PDT) Received: by mail-io0-x230.google.com with SMTP id h64so85918391iod.0 for ; Wed, 05 Jul 2017 06:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rcc6TInU926O4QDbFURbRxLDDK4rTYD2NfNzkDCulPQ=; b=MIiSXnfJ8BIrJkHQeWsVsgfd5hk1oOwYHn3emS6VCPcWpfQpAJ2epd9AYNmH84MF7V IXNvTHHCOdnlOqsOD3cw3I4TunNugf1JBcdgkubICS4hG8ekOFzE1SfUSqeQEI+o5hPN UM9AftiFjBpkQPZtG9X6ehf0InUYx0YPGgh1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rcc6TInU926O4QDbFURbRxLDDK4rTYD2NfNzkDCulPQ=; b=Y8cnzba8FIaUjHusRQ66TTYVldZ9MRF78WWShm+jQQIjEcd2P4hcvhIqzFAYxrcJ+o WQAlIxTWeG8IOKg7nUTUq7ddCqj33O3XQFvPnR3UV2FoonvlDuvA0jhnAEE71EyoaNxR fkFnG2hMhuYyjWqNUjRapjMHx6uXgHTJBA00cbPl4p2CbSOrKFU9zcLyRgelQdeidG/X EORSL86tidNJuRrAs1fmBbhgz9IJYsEYpwetfe4XZUSizmLuxbRMYRRl8Z0Vb9SK2bbI znz82jUudP/XdKPkZuafhFXujb7oP6RMMPhFx3fLzzqYc4Y2YX+5r1uUUOClJ0gUFbmK Lm5A== X-Gm-Message-State: AKS2vOw7EM+SdaG5xVu2wNIXOzKLfQvbsh7C/4ev3v2WHLM9rtCMuM59 +Pca+6lDK5szlxaFNd/sUTLxq3NPoIZz X-Received: by 10.107.63.214 with SMTP id m205mr46638007ioa.87.1499262364213; Wed, 05 Jul 2017 06:46:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.134.134 with HTTP; Wed, 5 Jul 2017 06:46:03 -0700 (PDT) In-Reply-To: <3c6585d6-fe8b-3805-7040-ca4decc9c004@redhat.com> References: <20170705130434.4525-1-ard.biesheuvel@linaro.org> <3c6585d6-fe8b-3805-7040-ca4decc9c004@redhat.com> From: Ard Biesheuvel Date: Wed, 5 Jul 2017 14:46:03 +0100 Message-ID: To: Laszlo Ersek Cc: "edk2-devel@lists.01.org" , Leif Lindholm , Marcin Wojtas Subject: Re: [PATCH] ArmVirtPkg: remove status code support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jul 2017 13:44:26 -0000 Content-Type: text/plain; charset="UTF-8" On 5 July 2017 at 14:43, Laszlo Ersek wrote: > On 07/05/17 15:04, Ard Biesheuvel wrote: >> Commit 7b1dc6c569a 'ArmVirtPkg: switch to generic ResetSystemRuntimeDxe' >> replaced all references in ArmVirtPkg to the deprecated ResetRuntimeDxe >> from EmbeddedPkg with the well maintained generic alternative that lives >> in MdeModulePkg. >> >> However, as it turns out, the generic driver has a dependency on the >> library class ReportStatusCodeLib, whose default resolution is an >> implementation that is not safe for use at runtime, resulting in crashes >> when trying to invoke it from the OS. >> >> Since we have no use for status codes in any of the ArmVirtPkg >> platforms, let's replace all resolutions with a common one to the NULL >> implementation. >> >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Ard Biesheuvel >> --- >> ArmVirtPkg/ArmVirt.dsc.inc | 11 ++--------- >> 1 file changed, 2 insertions(+), 9 deletions(-) > > Alternative approach (if we wish to follow what OVMF does): > > (1) Copy the library resolutions (as appropriate) from OvmfPkg: > > - SEC, PEI_CORE, PEIM: > MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf > > - DXE_CORE, DXE_DRIVER, UEFI_DRIVER, UEFI_APPLICATION: > MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > > - DXE_RUNTIME_DRIVER: > MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf > > (2) Port commit a6d594c5fabd ("OvmfPkg: use StatusCode Router and Handler from MdeModulePkg", 2016-08-03) to ArmVirtPkg. > > This should result in status code reporting and handling that is functional at runtime as well. > > What do you prefer? > > Thanks > Laszlo > >> >> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc >> index 0b9b457b5619..bfc40286d7ab 100644 >> --- a/ArmVirtPkg/ArmVirt.dsc.inc >> +++ b/ArmVirtPkg/ArmVirt.dsc.inc >> @@ -154,6 +154,8 @@ [LibraryClasses.common] >> VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf >> UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf >> >> + ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf >> + >> [LibraryClasses.common.SEC] >> PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf >> BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf >> @@ -174,7 +176,6 @@ [LibraryClasses.common.PEI_CORE] >> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf >> PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf >> PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf >> - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf >> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf >> PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf >> UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf >> @@ -191,7 +192,6 @@ [LibraryClasses.common.PEIM] >> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf >> PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf >> PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf >> - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf >> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf >> PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf >> PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf >> @@ -205,13 +205,11 @@ [LibraryClasses.common.DXE_CORE] >> HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf >> MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf >> DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf >> - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf >> ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf >> UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf >> PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf >> >> [LibraryClasses.common.DXE_DRIVER] >> - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf >> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf >> PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf >> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf >> @@ -223,10 +221,8 @@ [LibraryClasses.common.UEFI_APPLICATION] >> HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf >> ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf >> FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf >> - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf >> >> [LibraryClasses.common.UEFI_DRIVER] >> - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf >> UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf >> ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf >> PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf >> @@ -234,7 +230,6 @@ [LibraryClasses.common.UEFI_DRIVER] >> >> [LibraryClasses.common.DXE_RUNTIME_DRIVER] >> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf >> - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf >> CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf >> >> !if $(SECURE_BOOT_ENABLE) == TRUE >> @@ -334,8 +329,6 @@ [PcdsFixedAtBuild.common] >> # DEBUG_ERROR 0x80000000 // Error >> gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|$(DEBUG_PRINT_ERROR_LEVEL) >> >> - gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 >> - >> # >> # Optional feature to help prevent EFI memory map fragments >> # Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob >> >