From patchwork Thu Feb 22 18:15:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 129310 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2326930edc; Thu, 22 Feb 2018 10:15:20 -0800 (PST) X-Google-Smtp-Source: AH8x225ya9VPVW6x4QcBY7brh3WFkyHYGQLwoSY4JyrzgTG4rVCz/2lPDQfd/Xe5TWM1XmL1peXE X-Received: by 10.98.138.66 with SMTP id y63mr7772503pfd.12.1519323320511; Thu, 22 Feb 2018 10:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519323320; cv=none; d=google.com; s=arc-20160816; b=Kfu6pwu2/+m5ZQNH16BEG/lQV2/ViJWu1XYnNplh3QOkSYXIcbotu7SAmUMNDku0vi nNZH2kWS6CSdYhay8tqUs+hDcwqtZL1Lz9ctatIJ18SdWunN1OvypKqLtDXXpZ4ApOL6 ewEkJGr62dujFj+DtxwIUBFM3O3pTKNCu8j4ZQqoA6BVOZlgaLRFmdde1blmnn3FI4MY QEDhUgoHaxJdxAF7izXR0jf1YSQFAz4bs6rvh90dKEwC2tUA6SO1yCn4+DYKZ1rAYtDt WyxMw7VZ17pkqSKadz9QyvIA+IgwaUh+egfab9ig0J/V0Vj9gxSrRwYP/p1CMyCaAdV1 eUZw== 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=Zb/NjzXwkhXdlJxw5z4YC6gpboh5fy8kfinE9OIfox4=; b=rapCDAlXrgoCxFT61EvkNK6DK6bN/wm8vndw8cGU1GjKKnHeDTOzmcV3k2Pu9tKR8i RxbGf3weB4NtjdmYj863EkUXR3B+HXx9PeXDWkEKtQkvZZRv0UWNCP81eOiPB9omFDO7 Vt2ZSyacvv5W4+6t4iRJfq+zGVJvCmSxLWzjihjsFVhoTSaN4jqhgBBHoEMrf27yFu9W RQ4CHI9YgVsN3yNVQhiePAguHLzYdayDVIjHOvbmNnibOh8xPnbJp4Jb+ibEjne0lcPS YGH7Kdv6V3iNNZA5SjUqOHvYlxSqAGo+wklSk5yVJhvv4QhRB/gB6JK3txwyvv7Qlnjv z0Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SynhHMm+; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id v22si418104pfd.22.2018.02.22.10.15.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 10:15:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SynhHMm+; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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 D13C42034D8C2; Thu, 22 Feb 2018 10:09:18 -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::241; helo=mail-wr0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (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 3388C2034D8C0 for ; Thu, 22 Feb 2018 10:09:16 -0800 (PST) Received: by mail-wr0-x241.google.com with SMTP id v65so11506658wrc.11 for ; Thu, 22 Feb 2018 10:15:17 -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=nIO/FMtCcqL3AEcJSE9qqXqgG/dq0xTVHC6oieBqYzI=; b=SynhHMm+D5THCAK29S0hoE9i2I1oWwnIWBX1zpJuQV1AkfMHsN7sKj83nziTOTVAkH 4+bk/hQWwd2Stclm6E5c1fsKr5Lyl9+Y0u9mb3d8eaPNHm3WHESybNPBYN+kfR4JrR0Q SSR0ubhTf8jpnbfG+AnIOP54N/WMT9sSKmyto= 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=nIO/FMtCcqL3AEcJSE9qqXqgG/dq0xTVHC6oieBqYzI=; b=Ru348AMVX2sbXD8tMEO0maEEh0Xhm3c3cILFylfv2u5dUMYHmLkeRTrOFrTilK6I2X 3zEct09rp9AoVv+qniHhSwa7sQ4DGPjqNWQZ2MJYwEY91ymfWfQYue8L6sv4bP56BU6e e0/dLxygxn6GV/e70He3wrL9q7ZOdjIQhZAeHUkqXMfVqW4OfARshHzpNsuY2U2w2f05 dSmI3SrrZUg1Beyw9C3nhB7DF5ECzlZgI3kkHumBDbRTpi3vU4KcRiYG4Uytvc5i88c/ lhzGzS3hs/5KYxgVQL6hQ3Yq+GQTqarh/lmANACvLb5FuRlRYQnuUajp08KPZcdEb1A/ wRUQ== X-Gm-Message-State: APf1xPDlz9Kk3W8AQMegI6LivDOaX+v1Nf6UQiYSvlO344Jm+WvOTjPN hqbyLAenwYuWi9gWKfFFeQAZq4Os6LU= X-Received: by 10.223.150.65 with SMTP id c1mr7369853wra.167.1519323315950; Thu, 22 Feb 2018 10:15:15 -0800 (PST) Received: from localhost.localdomain ([196.90.4.100]) by smtp.gmail.com with ESMTPSA id 2sm9004wmk.47.2018.02.22.10.15.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 10:15:14 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Thu, 22 Feb 2018 18:15:03 +0000 Message-Id: <20180222181505.28192-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH v3 0/2] Create UART DebugLib implementation for runtime 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: ruiyu.ni@intel.com, Ard Biesheuvel , afish@apple.com, liming.gao@intel.com, leif.lindholm@linaro.org, michael.d.kinney@intel.com, lersek@redhat.com, star.zeng@intel.com 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 systems using a MMIO mapped UART for DEBUG output. In other words, it broke the build for all ARM and AARCH64 systems, given that port I/O does not exist on those architectures. Instead of patching it up locally, let's fix this issue once and for all, by creating a UART DebugLib implementation for DXE_RUNTIME_DRIVER modules that does the right thing by default. v3: - revert PCD changes, as they are unnecessary for the PCDs in question (since they are fixed or patchable only) - drop redundant mEfiAtRuntime checks around ASSERT()s - revert whitespace cleanup, i.e., move back to BaseDebugLibSerialPort origin for most of the file v2: - incorporate Laszlo's feedback into patch #1 - add Laszlo's R-b to patch #2 - dropped patch #3 that blacklists the original BASE implementation for DXE_RUNTIME_DRIVER modules Note that I retained the deadloop/breakpoint code for ASSERT()s at runtime. I think it is perfectly reasonable behavior for a DEBUG build at runtime, even if other cores may be up and running as well: the purpose of these facilities is to allow a debugger to attach to the CPU to figure out what has happened, and both deadloops and breakpoints can achieve that just fine even at runtime. Ard Biesheuvel (2): MdePkg: introduce DxeRuntimeDebugLibSerialPort ArmVirtPkg: switch to DXE runtime version of DebugLib where appropriate ArmVirtPkg/ArmVirt.dsc.inc | 3 + MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c | 346 ++++++++++++++++++++ MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf | 55 ++++ MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.uni | 21 ++ 4 files changed, 425 insertions(+) create mode 100644 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c create mode 100644 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf create mode 100644 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.uni -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel