From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AG47ELvlzgp9/c0VZq8irwPJt1lupxihFp59V/2cA5ZXIHdg/JZ/IqCS/iSbgPGg5/z3EF99Zzp6Tg== 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 Cc: leif.lindholm@linaro.org, lersek@redhat.com, liming.gao@intel.com, michael.d.kinney@intel.com, afish@apple.com, star.zeng@intel.com, ruiyu.ni@intel.com, Ard Biesheuvel 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: [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: , X-List-Received-Date: Thu, 22 Feb 2018 19:51:20 -0000 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