From patchwork Sat Feb 24 14:25:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 129511 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1742935lja; Sat, 24 Feb 2018 06:25:31 -0800 (PST) X-Google-Smtp-Source: AG47ELuQHrhRMerw/zjBHbV1CYp6866pFxb95G/jJ6ohOC7HwC9F/d/NjwldfqUMZ+Mywg6vzDKv X-Received: by 10.98.198.146 with SMTP id x18mr1982607pfk.22.1519482331155; Sat, 24 Feb 2018 06:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519482331; cv=none; d=google.com; s=arc-20160816; b=M1NJPIu2bPaCmz1StNGPFgqANEq6eLmGPsu250r5AOHbsidyQJL4l89nB6w+p7916N hTjNSNOvReSkpLdlxmnupphY7YwiWGwzrG+ar2SmVprLTCq8/8mygc8Lp3K5vdiTc2Hr zWmd9drREcWPjy3pcDs9IZnjIr1sg31g6kxY+wGRgzaR6BG0cKHYn7y2GuJnp2eOzolK cGyIWdsVOu9agKO+cHHFy/+9ySnAYsr8+gZcjnPT0IbegLDe9fPIUKBsNRQQGo1ChNEp V2CxL8Kqq89+1YyJdQB9X2QIK5/dm1ZGijmWbZ59tlrw2ImmbbkU5cyXRtF85MoXXymD 09Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=Le4toOceUQ4Twn6R1H+VFEN9YwtF5dz5VToxq6bVGB4=; b=jzh3JbI/6QgfDV5TnSwjObbD1MWyuuxwRRfx9lRU0NNsRK1Y6iU46pejhh102qG1b6 qmzBx8PHUN+pILcKn2u6zmedU494W/SZtyYLj0dUNUPYmlz4smr5iGkrodk+esoMnNTW DztIZ9Eu/gI1d3hRwRPGXzw6pFmBndjHK1zfto/RO0gKVMXkea4+yWsYrNMZ9XfJkiU4 dGgQshUzyfJH4pyrJFddeiQ/92Is3K71+aWMNP9H5JU+53nPqgGZsHdv3joqkME6GqLn k0q0VIB/6awb7oSg4BbDyM8qbp02/S4HUdIznH4Ivgms3VtTg4SufEXppkW/nrbTTTzT 6QaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XllbtEOX; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id h9-v6si3641923pll.554.2018.02.24.06.25.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 06:25:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XllbtEOX; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3A08422436938; Sat, 24 Feb 2018 06:19:27 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (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 5C05221F6A6E6 for ; Sat, 24 Feb 2018 06:19:25 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id p104so16799149wrc.12 for ; Sat, 24 Feb 2018 06:25:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=43JYy7u/zxYCn3dZJ7pC8z8ZuxGqi3xAob4+SGIMoSY=; b=XllbtEOXEAjOaOXfm+N2/KBZrtxE+oj0JtXWkQ1wEBntB20WjXATUlRn293H2ANjd2 MRk/KBU6ATkXE2IW3degk2cbickTQ2nPeStteTSf+JubjxXLJDpIwA/cTTu9ZWCIN0xI nbWhWKPMGgmArPJto3h4FRZyjhK0YWxZodT6I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=43JYy7u/zxYCn3dZJ7pC8z8ZuxGqi3xAob4+SGIMoSY=; b=MlMhuvp0Eb1pnO/flPgZF7vqNgazYy079yEhp29hyVabjHBAYufJ2G25bMY9HXRnRy XAm615Yt5tMICc6w5nAWIR1Iwb0UtdqiiGEOfHs6WxZEEiNlG+AkgDTPUBeEk+82vELI b2HQmtO5sE8QLLZSV34L5HmohVLtc3IOGKwLpuPPYEtNZg6toexKocPWmwoNT/VU8LGr 1DN9pVJqYKOyZyp8liqCJqJqeRO0d8ryGcodwX3lbFczz9xl7NewAXVA7oXxaYzh9CiQ 1qu0wzp9eJ9rS03C+KafxdSHaSauOR2YaS0hkH+DhZi6NDY8N0+GSd7u1bOd5J9tmTlM PZsw== X-Gm-Message-State: APf1xPD37WIZZEwtR0mVxfw0+WRhXI/9x1jCtvuPfNMoFR2ruwnJyb6g 2rJDUKwOSrJxaGV2ciA3I6iaPblbjIA= X-Received: by 10.223.193.14 with SMTP id r14mr4701015wre.56.1519482325994; Sat, 24 Feb 2018 06:25:25 -0800 (PST) Received: from localhost.localdomain ([160.162.31.62]) by smtp.gmail.com with ESMTPSA id a14sm4612944wrf.22.2018.02.24.06.25.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 06:25:24 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sat, 24 Feb 2018 14:25:14 +0000 Message-Id: <20180224142515.461-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [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: , Cc: lersek@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek Reviewed-by: Leif Lindholm 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] #