From patchwork Thu Feb 22 19:56:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 129317 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp970508lja; Thu, 22 Feb 2018 11:57:22 -0800 (PST) X-Google-Smtp-Source: AH8x224WELZhjmBNKlklI65PGNkf4Z0fkQ+AK9C/0cpsJzPSVECD4gG5ZEPldIy7EpRFm8gMCcme X-Received: by 2002:a17:902:ab84:: with SMTP id f4-v6mr7765505plr.239.1519329442265; Thu, 22 Feb 2018 11:57:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519329442; cv=none; d=google.com; s=arc-20160816; b=Kir8WmSqULTL22dTnh2g5KsiNqmHDVeqMH4citsBhb2GQAL2nihl/c/5+I+V5PyIBk l5p/U7k1tjoNjhZI/UThnEwpHZsKoCnf+lWcWEGX4VrhwgJ2zq2W5yd13Y31dVkXGQxo +PbYpqqZtlU3JcBk7YtE4usYe3zAvqWNsqP/QxZLW8DqEyOvNEe1UeykAALUkcIkbWTU 9f7rF3p63FlFaRaU2pCTVwdSmRslDSit2/BnMAvUBg4O1y8GhKFkw19V/QmiKVjKzWej +8KrwJ2HdOpzM8X99Xk95eM7RQSQgyuKgjWqVGHaT7+CJTWdG4O2qKaL/3RYmCZmOBM0 OpNg== 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=1Ma/pHvlXHzkFpTliF5Yzo//2qbMvVfPTCJExMp4MDw=; b=CAZ3qBcn0Z4A48DEoCpdH6SdGSPzxG13CoBq8tSmSOxWuK27oq1qbqC1DDFTwDv7gl zbouHcGp/veHCxCAAm8mDAE3y8DqAUrh2KNRQathP1gOX558iCuNIHnyBrVY5k87Fwb1 GvYTp7oWlIhLizCoNmPAU6O1RRcgh5DyQGyzKuXRlpLrvkRCXBk7Gs2YOpGcTaWzfqYx stJEWXfn3D0x1yXt8peOI+IO5ndCEfRraq+k+SAhWAiw7tNtE8IlxnX7T7GkJGIkwRy/ QiwrnNkQDsXbZfQPJscSOs7pIva3m4GUhEEB1WyyA50ZFkvqKvAeQuS8VR+Si/Ny4FTM 76Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JJpbU3QH; 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 x123si425382pgb.607.2018.02.22.11.57.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 11:57:22 -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=JJpbU3QH; 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 944222034D8C5; Thu, 22 Feb 2018 11:51:20 -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:c09::242; helo=mail-wm0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::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 78A21222630CF for ; Thu, 22 Feb 2018 11:51:19 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id t3so606604wmc.2 for ; Thu, 22 Feb 2018 11:57:20 -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=Bw66COA7jU/59t4c9bb4nWJguqSqYnCtFCAT5zagUng=; b=JJpbU3QHd321v1Xl+u9J1ddL9nRZy8b8GjI0nM/DwOjpc2xgTjwNTd79mxd9VFepQw bzkCMrL72cEFnA/9zlGHXw+FlNn35pkzrMoAErZSnKfWoqt3toeD8zo2J4cp/kFk3Z9B tJIPSpoXCclR33/dFY33r3R2QFo4KtyGKpdrg= 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=Bw66COA7jU/59t4c9bb4nWJguqSqYnCtFCAT5zagUng=; b=OKvk71nz31UfjkGjJuSyG+6CMjiaP3k5MgoHuszp+sDnWBqPVQJlsI1NRytC1Z+CXE czHmiXIRuVvVUlgBkNcYsnt6lymrOA8/B1xc0nsWtO6MeB/IHDjHEVs4zsP2QnTfBZF0 VYhG2SiKRABRbb436bSsh84TkDjsYXzOxzcL6aaYJcnVjuavxViVseiNZkSq2s7fH2io ccHygrl8An/zByKY160ls1jkE4acXstARjTHSAIr55F706mQmb6HuLTijtSEYAqK0uCf CI8pZ/DavuFz4f1JGZy0UVsS4BOFM/IL48XgT9m3VXpdaEKNBSeD1LQjz8gNOncjImt/ ocrw== X-Gm-Message-State: APf1xPB/6M3GerODzf+CcstcCcrpmZvTBOV8XGCbtWVZ7no6GQqGUJxC MlA59fDZ8xqBfFNMjUtlB1hK8pYlHNM= X-Received: by 10.28.67.65 with SMTP id q62mr252612wma.110.1519329438007; Thu, 22 Feb 2018 11:57:18 -0800 (PST) Received: from localhost.localdomain ([196.90.4.100]) by smtp.gmail.com with ESMTPSA id t14sm252153wmc.23.2018.02.22.11.57.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 11:57:15 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Thu, 22 Feb 2018 19:56:58 +0000 Message-Id: <20180222195700.7279-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH v4 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. v4: - add Laszlo's R-b - keep ASSERT() message in local buffer even it is not printed to the serial port, to allow it to be accessed via the debugger 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 Reviewed-by: Michael D Kinney