From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B36C6209574E9 for ; Mon, 26 Feb 2018 06:44:06 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DFB14036114; Mon, 26 Feb 2018 14:50:10 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-149.rdu2.redhat.com [10.10.120.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id B833B2026DFD; Mon, 26 Feb 2018 14:50:09 +0000 (UTC) To: Ard Biesheuvel , edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org References: <20180224142515.461-1-ard.biesheuvel@linaro.org> From: Laszlo Ersek Message-ID: Date: Mon, 26 Feb 2018 15:50:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180224142515.461-1-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 26 Feb 2018 14:50:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 26 Feb 2018 14:50:10 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: Re: [PATCH edk2-platforms 1/2] Platform, Silicon: use DxeRuntimeDebugLibSerialPort for runtime DXE drivers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 14:44:07 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 02/24/18 15:25, Ard Biesheuvel wrote: > Commit 4bf95a9f361e ("MdeModulePkg/ResetSystemRuntimeDxe: Add more > debug message") broke the DEBUG build for all platforms that rely on > MMIO mapped UART devices, since it introduces a DEBUG() print that > may trigger at runtime, at which such UART devices are usually not > mapped, resulting in an OS crash. > > Given that this mostly only affects ARM and AARCH64, it is not unlikely > that similar inadvertent breakage will occur again in the future, so > let's fix this once and for all by switching affected platforms to the > new DxeRuntimeDebugLibSerialPort DebugLib implementation that takes care > not to touch the UART hardware after ExitBootServices(). > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > --- > Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 3 +++ > Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 3 +++ > Platform/LeMaker/CelloBoard/CelloBoard.dsc | 3 +++ > Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 3 +++ > Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc | 3 +++ > Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc | 3 +++ > Silicon/Hisilicon/Hisilicon.dsc.inc | 3 +++ > Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc | 3 +++ > 8 files changed, 24 insertions(+) > > diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc > index 7d85b78642da..348828e18d44 100644 > --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc > +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc > @@ -227,6 +227,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf > +!if $(TARGET) != RELEASE > + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > +!endif > > [LibraryClasses.common.UEFI_APPLICATION] > UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf > diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc > index b026ce3a420a..7cb47937329e 100644 > --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc > +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc > @@ -227,6 +227,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > !if $(SECURE_BOOT_ENABLE) == TRUE > BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf > !endif > +!if $(TARGET) != RELEASE > + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > +!endif > > [LibraryClasses.ARM, LibraryClasses.AARCH64] > # > diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.dsc b/Platform/LeMaker/CelloBoard/CelloBoard.dsc > index 2468583c0daa..569e444f6b26 100644 > --- a/Platform/LeMaker/CelloBoard/CelloBoard.dsc > +++ b/Platform/LeMaker/CelloBoard/CelloBoard.dsc > @@ -211,6 +211,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf > CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf > +!if $(TARGET) != RELEASE > + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > +!endif > > [LibraryClasses.common.UEFI_APPLICATION] > UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf > diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc > index 8450d7800e43..925ce36d278b 100644 > --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc > +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc > @@ -208,6 +208,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf > ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf > BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf > +!if $(TARGET) != RELEASE > + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > +!endif > > ################################################################################ > # > diff --git a/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc b/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc > index 45ab2afc4069..2d5a94ed1dab 100644 > --- a/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc > +++ b/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc > @@ -203,6 +203,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf > ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf > +!if $(TARGET) != RELEASE > + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > +!endif > > ################################################################################ > # > diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc > index f0a7e9794153..3f4c7c8a3eef 100644 > --- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc > +++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc > @@ -217,6 +217,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf > CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf > +!if $(TARGET) != RELEASE > + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > +!endif > > [LibraryClasses.common.UEFI_APPLICATION] > UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf > diff --git a/Silicon/Hisilicon/Hisilicon.dsc.inc b/Silicon/Hisilicon/Hisilicon.dsc.inc > index 9050f29be381..b196322a20e2 100644 > --- a/Silicon/Hisilicon/Hisilicon.dsc.inc > +++ b/Silicon/Hisilicon/Hisilicon.dsc.inc > @@ -213,6 +213,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > !ifndef CONFIG_NO_DEBUGLIB > DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf > !endif > +!if $(TARGET) != RELEASE > + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > +!endif > > [LibraryClasses.AARCH64] > ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc > index ef70b5216727..535cc3ff4c19 100644 > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc > @@ -184,6 +184,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf > +!if $(TARGET) != RELEASE > + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > +!endif > > [LibraryClasses.ARM, LibraryClasses.AARCH64] > # > I'm not overly familiar with edk2-platforms, but the patches look sane. Series Reviewed-by: Laszlo Ersek Thanks Laszlo