From nobody Tue Feb 10 16:18:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+90077+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+90077+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619460; cv=none; d=zohomail.com; s=zohoarc; b=aVUcEl5p85ZF6cwDJyWdjlYHK1xdpqcTyBLP348axdfg20lk1MrlKyH/nlRYfDasOvjXsEnpuMbOWsWqtfJcRJs88hzXOVIzMgHC4H4Wv1h7MSV3aHUC46D9UAs5skl2h/w/rm/7V+24cX7m/XhF0VbEX6pkR5tzXvWJIPxYSkk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619460; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=fSZEaqnkvxkmBSJc7Q3g4PpBPPe3CxF+J3vuyexjpIk=; b=YS99BXh/U/wlqU1p9TfUJCHc8K39FOhJtX0QYvlimYFwc1CVD0ua/d6Yy+Hln0kboBNjm7ybOOfONtBBHQfzJYTVJmKjYq6nD1/lKZG43ijDCgugcgaSwOnftfcocakrx0kEOuyC3gz0DoLQT9IVL29GFbwbsaILe1EwO4t+8mg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+90077+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1653619460081551.7253275259562; Thu, 26 May 2022 19:44:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cVZ3YY1788612xsXsIyXZAGN; Thu, 26 May 2022 19:44:19 -0700 X-Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) by mx.groups.io with SMTP id smtpd.web12.3186.1653619458856607115 for ; Thu, 26 May 2022 19:44:19 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="207033082" X-Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1d-54a073b7.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP; 27 May 2022 02:44:05 +0000 X-Received: from EX13MTAUWC002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1d-54a073b7.us-east-1.amazon.com (Postfix) with ESMTPS id 12906A2890; Fri, 27 May 2022 02:44:02 +0000 (UTC) X-Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC002.ant.amazon.com (10.43.162.240) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:44:01 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.160.26) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:44:00 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 12/12] OvmfPkg/PlatformDebugLibIoPort: Add Bootlog support Date: Fri, 27 May 2022 04:43:17 +0200 Message-ID: <20220527024317.13476-13-graf@amazon.com> In-Reply-To: <20220527024317.13476-1-graf@amazon.com> References: <20220527024317.13476-1-graf@amazon.com> MIME-Version: 1.0 X-Originating-IP: [10.43.160.26] X-ClientProxiedBy: EX13D38UWB004.ant.amazon.com (10.43.161.30) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,graf@amazon.com X-Gm-Message-State: 9kPiLxHikGGNVcmOLL7eug82x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619459; bh=txSjH21YMCgT4FWiUvAip5ZJp3Wc+xIDxXu1o2XtZ8M=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Qn53n+t6PE3XwH9AVcNuMWlkZw72Xn69Yl5Ew3DlWaj2XNJI7ExIfVcQY3V0FeGznlX BemOqniXkEumyHRa/yYaAre1qH6JhPuBBqwGeISXi61nXD8XOqMZeF8Ekx0QCXgiEMWxI v0gHoTNuiEgX+jKQKGQJCQAc64ueX9Ts5Sk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619460743100001 Content-Type: text/plain; charset="utf-8" Now that we have Bootlog support for serial, let's also add it for the PV Debug Port. The only new platform we touch with this is Xen, where we just disable bootlogs for now. Signed-off-by: Alexander Graf --- .../Library/PlatformDebugLibIoPort/DebugLib.c | 23 +++++++++++++++---- .../PlatformDebugLibIoPort.inf | 1 + .../PlatformRomDebugLibIoPort.inf | 1 + .../PlatformRomDebugLibIoPortNocheck.inf | 1 + OvmfPkg/OvmfXen.dsc | 1 + 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c b/OvmfPkg/Li= brary/PlatformDebugLibIoPort/DebugLib.c index 4e25f198aa..80eb3cce0f 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "DebugLibDetect.h" =20 @@ -86,17 +87,20 @@ DebugPrintMarker ( { CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH]; UINTN Length; + UINT32 DebugPrintLevel, DebugBootlogLevel; =20 // // If Format is NULL, then ASSERT(). // ASSERT (Format !=3D NULL); =20 + DebugPrintLevel =3D GetDebugPrintErrorLevel (); + DebugBootlogLevel =3D GetDebugBootlogErrorLevel (); + // - // Check if the global mask disables this message or the device is inact= ive + // Check if the global mask disables this message // - if (((ErrorLevel & GetDebugPrintErrorLevel ()) =3D=3D 0) || - !PlatformDebugLibIoPortFound ()) + if ((ErrorLevel & (DebugPrintLevel | DebugBootlogLevel)) =3D=3D 0) { return; } @@ -111,9 +115,18 @@ DebugPrintMarker ( } =20 // - // Send the print string to the debug I/O port + // Send the print string to the debug I/O port if it is active // - IoWriteFifo8 (PcdGet16 (PcdDebugIoPort), Length, Buffer); + if (PlatformDebugLibIoPortFound () && (ErrorLevel & DebugPrintLevel)) { + IoWriteFifo8 (PcdGet16 (PcdDebugIoPort), Length, Buffer); + } + + // + // Append the print string to the Boot Log + // + if (ErrorLevel & DebugBootlogLevel) { + DebugBootlogAppend (Buffer, Length, ErrorLevel); + } } =20 /** diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.= inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf index 94ab910507..4a121a3b7b 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf @@ -40,6 +40,7 @@ PrintLib BaseLib DebugPrintErrorLevelLib + DebugBootlogLib =20 [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPo= rt.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.i= nf index 8f721d249d..ba2052f81d 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf @@ -40,6 +40,7 @@ PrintLib BaseLib DebugPrintErrorLevelLib + DebugBootlogLib =20 [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPo= rtNocheck.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibI= oPortNocheck.inf index 6a85b333ee..75cdfafd22 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNoche= ck.inf +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNoche= ck.inf @@ -39,6 +39,7 @@ PrintLib BaseLib DebugPrintErrorLevelLib + DebugBootlogLib =20 [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 6ba4bd729a..6f66d49855 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -226,6 +226,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf --=20 2.28.0.394.ge197136389 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#90077): https://edk2.groups.io/g/devel/message/90077 Mute This Topic: https://groups.io/mt/91368920/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-