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: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-Google-Smtp-Source: AH8x225rVjzg0aHi9IzGJ2nOgh/H6uf2v8D8o4HhE0d4wcOME73mfshzQY9JALWanRB6w6fULEM83Q== 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 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 18:15:03 +0000 Message-Id: <20180222181505.28192-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [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: , X-List-Received-Date: Thu, 22 Feb 2018 18:09:17 -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. 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