From nobody Sat May 18 23:44:04 2024 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+90065+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+90065+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619423; cv=none; d=zohomail.com; s=zohoarc; b=m/QyOCQetIM8kvUk15Cd44H/7L3uVzTMv7j9DCyNYS2R/FUNZf71SaqJ7BTahGoFApjOvlIxwtfE66FJ/IEovfIydSZNTkwhopwynS+OYnWICJOo0QzeYerUTamZMgU7JM8YnAnqmClbA9XuAMwmgJiJo3wnP9NihOztDEdENLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619423; 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=vI99v0IZgK2mIemOwz1Q60nbCCH/cdRYuaciLLFOdhk=; b=dv+BVr4nwpqOuL/IhDImDtYtK38OjhAPdlVSQUMjMWeq7SG0s8YuzVzHxDjZxPNoaog6Uv69IL++WKG+dMLQCI4X01Um6IeRrov9pKQGtd8pBF+0lmIlkc1BwUppt+uyjFeM5etfw2o4KgNZBr7KlbJiTGJJI6zCLcW1aEJihOs= 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+90065+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1653619423883438.85980957618665; Thu, 26 May 2022 19:43:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TpSHYY1788612x9bMMnCV4ca; Thu, 26 May 2022 19:43:43 -0700 X-Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by mx.groups.io with SMTP id smtpd.web09.3211.1653619421905680420 for ; Thu, 26 May 2022 19:43:42 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="202322394" X-Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1e-41c1ef8b.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP; 27 May 2022 02:43:31 +0000 X-Received: from EX13MTAUWC001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1e-41c1ef8b.us-east-1.amazon.com (Postfix) with ESMTPS id 664BC162FAF; Fri, 27 May 2022 02:43:29 +0000 (UTC) X-Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:28 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.162.202) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:26 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 01/12] MdePkg: Add DebugBootlog header Date: Fri, 27 May 2022 04:43:06 +0200 Message-ID: <20220527024317.13476-2-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.162.202] X-ClientProxiedBy: EX13D35UWB003.ant.amazon.com (10.43.161.65) 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: r9krhZGZp33Y4PrXSf9i3CK8x1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619423; bh=vI99v0IZgK2mIemOwz1Q60nbCCH/cdRYuaciLLFOdhk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=jn/4V0344IxEiXDS5hF2m9PK+DmMrpn3GGJi3jiyMuvLH97lQKk+Fp1zHREQm6IfNpo kms8VCwag6owuRldXN2JZCvf8FFI6Lo3fSOBLrTQ/1WoP1i5QD+GPgKC8fjTgco2dEC2t ShUMY/djtQlp2mYDfk8GPvZyD7cc17ndfwA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619424619100001 We will shortly introduce a new bootlog framework. This commit contains the main library header that defines its data structure and public APIs. Signed-off-by: Alexander Graf --- MdePkg/Include/Library/DebugBootlog.h | 141 ++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 MdePkg/Include/Library/DebugBootlog.h diff --git a/MdePkg/Include/Library/DebugBootlog.h b/MdePkg/Include/Library= /DebugBootlog.h new file mode 100644 index 0000000000..5e6b05411c --- /dev/null +++ b/MdePkg/Include/Library/DebugBootlog.h @@ -0,0 +1,141 @@ +/** @file + Base Debug library for a RAM based boot log + It provides functions to store debug messages in RAM and make them avail= able as + Bootlog Configuration Table. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2012, Red Hat, Inc.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +/* + * The bootlog framework is a way to collect all boot logging streams from= the + * system into a single, condensed and time correlated data format. Its pu= rpose + * is to allow extraction and correlation of boot logs from within the Ope= rating + * System. Unlike I/O based logging, it's very cheap to use and can be use= d to + * easily identify duration of boot time code paths. + * + * Its intended use in edk2 is as a print backend for DebugLib, however yo= u can + * use it stand alone as well. To append an edk2 log line, call + * DebugBootlogAppend() with the UTF-8 encoded string to append. The frame= work + * will initialize the boot log and add a configuration table if not exist= ent + * automatically. + * + * The bootlog entry point is the bootlog configuration table. That table + * contains a dynamic number of pointers to bootlog logs. Each of these lo= gs + * belong to one component of the boot flow, such as edk2 or grub and cont= ain a + * dynamic number of log entries, each with a time stamp and optional addi= tional + * data. + * + * All fields are Little Endian. + * + * ___________________________________________________ + * | Bootlog Configuration Table | + * |---------------------------------------------------| + * | UINT32 Signature | "BTLG" | + * | UINT16 MaxLogs | Maximum number of logs this | + * | | configuration table can hold. | + * | | If you need more, create a | + * | | clone and reregister it. | + * | UINT16 NrLogs | Number of occupied Log slots | + * | BOOTLOG *Log[0] | ---+------------, + * | BOOTLOG *Log[..] | ---+------------| + * |___________________________________________________| | + * ___________________________________________________________ / + * | Bootlog | <=C2=B4 + * |-----------------------------------------------------------| + * | UINT32 Signature | "BTLH" | + * | CHAR8[4] Producer | "edk2" for edk2, boot binary | + * | | dependent. | + * | UINT16 ExtraHeaderType | 1 for edk2 | + * | UINT8 ExtraHeaderSize | Bytes for ExtraHeader below | + * | UINT8 MsgExtraHeaderSize | Bytes for Extra header in | + * | | each log line | + * | UINT32 LastByte | Length of the log, starting | + * | | at &Signature | + * | UINT64 TicksPerSecond | Frequency of the timer for | + * | | each log line. Time at system | + * | | reset is 0 for all logs. | + * | ExtraHeader ExtraHeader | Depends on Type above ---+---, + * | BootlogMessage Msgs[] | Log lines ---+---|--, + * |___________________________________________________________| | | + * _________________________________________________________ / | + * | ExtraHeader (edk2) | <-=C2=B4 = | + * |---------------------------------------------------------| | + * | UINT32 AllocatedSize | Size of the allocation for the | | + * | | current bootlog. Used internally | | + * | | to resize on demand. | | + * |_________________________________________________________| | + * _________________________________________________________ / + * | Bootlog Message (edk2) | <----=C2=B4 + * |---------------------------------------------------------| + * | UINT32 ErrorLevel | edk2 defined ErrorLevel | + * | UINT64 Ticks | Ticks since power on | + * | CHAR8 String[] | '\0' terminated UTF-8 message | + * |_________________________________________________________| + */ + + +#define SIG_BOOTLOG_CONFIG_TABLE 0x474c5442 /* BTLG */ +#define SIG_BOOTLOG_HEADER 0x484c5442 /* BTLH */ + +#define BOOTLOG_PRODUCER "edk2" + +enum BOOTLOG_EXTRA_HEADER_TYPE { + BOOTLOG_EXTRA_HEADER_EDK2 =3D 1, +}; + +typedef struct { + UINT32 Signature; + UINT16 MaxLogs; + UINT16 NrLogs; + UINT64 LogAddress[]; +} BOOTLOG_CONFIG_TABLE; + +typedef struct { + UINT32 AllocatedSize; /* Maximum space available for the log */ +} BOOTLOG_EXTRA_HEADER; + +typedef struct { + UINT32 Signature; /* "BTLH" */ + CHAR8 Producer[4]; /* "edk2" */ + UINT16 ExtraHeaderType; /* enum BOOTLOG_EXTRA_HEADER_= TYPE */ + UINT8 ExtraHeaderSize; /* sizeof(ExtraHeader) */ + UINT8 MsgExtraHeaderSize; /* sizeof(BOOTLOG_ENTRY_EDK2)= - + sizeof(BOOTLOG_ENTRY) */ + UINT32 LastByte; /* sizeof(BOOTLOG_HEADER) + + sizeof(Data) */ + UINT64 TicksPerSecond; /* Tick frequency. */ + BOOTLOG_EXTRA_HEADER ExtraHeader; + CHAR8 Data[]; /* Multiple successive + BOOTLOG_ENTRY_EDK2 entries, + ends at LastByte */ +} BOOTLOG_HEADER; + +typedef struct { + UINT64 Ticks; /* Ticks since system start. = */ + CHAR8 String[]; /* NULL terminated UTF-8 */ +} BOOTLOG_ENTRY; + +typedef struct { + UINT32 ErrorLevel; + BOOTLOG_ENTRY Log; +} BOOTLOG_ENTRY_EDK2; + +RETURN_STATUS +EFIAPI +DebugBootlogAppend ( + IN CONST CHAR8 *String, + IN UINTN Length, + IN UINTN ErrorLevel + ); + +UINT32 +EFIAPI +GetDebugBootlogErrorLevel ( + VOID + ); --=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 (#90065): https://edk2.groups.io/g/devel/message/90065 Mute This Topic: https://groups.io/mt/91368899/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- From nobody Sat May 18 23:44:04 2024 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+90066+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+90066+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619426; cv=none; d=zohomail.com; s=zohoarc; b=dRNudE1z4lunUGRSQzOQ2qiH/tO8Wt+jHLAQ7rRxgLndRYAt92EDL7o2y3DLLspMUkdty5GXGmDz0JHywOrThXsO4lvQzQokVwDjCpA3JpScbCsSM81mooSvbnbFkejgP93tvWBOZ2kvk2tGNvro03tRlhV+9EKuwPFjhCIC130= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619426; 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=Kw34xZsG3XM54N2oaLE4fVAeogzA/7SL2iX2i0RZiys=; b=YJOr2Eblr6JZv3R4oOo6FZWJU6ErxsFKq4o7UXnyy2NWSVLRhNSlpavX0EEPPX6LtcAGiF+C5SVXvXFmAw9fff6h8fjUvXmayMzkrwFNXptZEdfJ5lK1grLwXE9g/U32uud8BD3GTg/Jd+uqSeo5bhSwiBNDWEnA0RoqaHUut4A= 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+90066+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165361942684772.50661104198218; Thu, 26 May 2022 19:43:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1gzyYY1788612xPgiMwEqzEv; Thu, 26 May 2022 19:43:46 -0700 X-Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) by mx.groups.io with SMTP id smtpd.web09.3214.1653619425652311278 for ; Thu, 26 May 2022 19:43:46 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="205608160" X-Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1e-8be8ed69.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP; 27 May 2022 02:43:34 +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-1e-8be8ed69.us-east-1.amazon.com (Postfix) with ESMTPS id BCEC8C083E; Fri, 27 May 2022 02:43:32 +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:43:30 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.162.202) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:28 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 02/12] MdePkg: Add Null BaseDebugBootlog Date: Fri, 27 May 2022 04:43:07 +0200 Message-ID: <20220527024317.13476-3-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.162.202] X-ClientProxiedBy: EX13D35UWB003.ant.amazon.com (10.43.161.65) 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: x54vSc1uCDznPgY8oolPGfSyx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619426; bh=24czB8rYsHpUv9522ksM5JVU7wWV31tdHne9s7GGyo8=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=umYDlfBTnJZJsm/qTcaTxecPFMkNvUrM6lza1ms8l40RdzzQ3dprgXvCZd6jGpMP/j+ 3mzM0hfFWUMqOEWsricCFa2UU1jMkaKmVDJejzlTS+GOxV/2T+JGaeDcabXa9w7+/Gsi9 hSgpowTpdo7g53H3HAZaFT1rFk7CKLdob4s= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619428596100007 Content-Type: text/plain; charset="utf-8" In some situations, we may not want to actually emit any boot log. This commit adds a null bootlog handler. We will use this in situations where we can not maintain a boot log, such as during the SEC phase. Signed-off-by: Alexander Graf --- .../BaseDebugBootlogNullLib.inf | 26 +++++++++++++++ .../BaseDebugBootlog/DebugBootlogNull.c | 32 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib= .inf create mode 100644 MdePkg/Library/BaseDebugBootlog/DebugBootlogNull.c diff --git a/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.inf b/= MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.inf new file mode 100644 index 0000000000..0f650f6260 --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.inf @@ -0,0 +1,26 @@ +## @file +# Null Debug library instance for a RAM based boot log. +# It provides function stubs for boot log that do nothing. +# +# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2012, Red Hat, Inc.
+# Copyright (c) 2022, Amazon Development Center Germany GmbH. All rights = reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BaseDebugBootlogNull + FILE_GUID =3D DF934DA3-CD31-49FE-AF50-B3C87C79325F + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D DebugBootlogLib + +[Sources] + DebugBootlogNull.c + +[Packages] + MdePkg/MdePkg.dec diff --git a/MdePkg/Library/BaseDebugBootlog/DebugBootlogNull.c b/MdePkg/Li= brary/BaseDebugBootlog/DebugBootlogNull.c new file mode 100644 index 0000000000..fbb304e6e2 --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/DebugBootlogNull.c @@ -0,0 +1,32 @@ +/** @file + Null Debug library instance for a RAM based boot log. + It provides function stubs for boot log that do nothing. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2012, Red Hat, Inc.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +UINT32 +EFIAPI +GetDebugBootlogErrorLevel ( + VOID + ) +{ + return 0; +} + +RETURN_STATUS +EFIAPI +DebugBootlogAppend ( + IN CONST CHAR8 *String, + IN UINTN Length, + IN UINTN ErrorLevel + ) +{ + return RETURN_SUCCESS; +} --=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 (#90066): https://edk2.groups.io/g/devel/message/90066 Mute This Topic: https://groups.io/mt/91368901/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- From nobody Sat May 18 23:44:04 2024 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+90069+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+90069+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619432; cv=none; d=zohomail.com; s=zohoarc; b=n/Y+gCPiHPW1S8Bov/BEoVz96AOuTCu3xmL6SMbEyfgfzDs6Bw+SgxuTaC/cI6livAKxqJWsrSRoHQWYC6Lk/ut7XfzhrRy4ZWOIm06sP7fYhxvnxRpasuirD0FTfA6K0k2DLRDLoDSD5eZcX3uYiq5pGnoujMqqXX1DFrF/ibU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619432; 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=KOFilWPPrGZez3ufYAf9FO+7gQWvaKYcAPnTfMJ5mjY=; b=E7yfGh79xhdPqYJEUQPcIXjtB49Qk/OnSgH54a4jbIMpPZdEJTDO1H0IuP7m6ylnL1nu366Mq0ql/mKh3htRyS2lzBWU+djvLR7cSXIbvncJNP9ocPKW/vnkU0SvSqYn+WITMoCvqOLo5hChnoU7sCj7ep+lvWqT8xgCN4e5ZK0= 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+90069+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1653619432987153.86905164571135; Thu, 26 May 2022 19:43:52 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Wp2fYY1788612xGINnybReJV; Thu, 26 May 2022 19:43:52 -0700 X-Received: from smtp-fw-80007.amazon.com (smtp-fw-80007.amazon.com [99.78.197.218]) by mx.groups.io with SMTP id smtpd.web09.3215.1653619430953251872 for ; Thu, 26 May 2022 19:43:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="92454024" X-Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-iad-1d-7a21ed79.us-east-1.amazon.com) ([10.25.36.210]) by smtp-border-fw-80007.pdx80.corp.amazon.com with ESMTP; 27 May 2022 02:43:34 +0000 X-Received: from EX13MTAUWC001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1d-7a21ed79.us-east-1.amazon.com (Postfix) with ESMTPS id ED87F220EA5; Fri, 27 May 2022 02:43:32 +0000 (UTC) X-Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:32 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.162.202) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:30 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 03/12] MdePkg: Add Fallback timer support for BaseDebugBootlog Date: Fri, 27 May 2022 04:43:08 +0200 Message-ID: <20220527024317.13476-4-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.162.202] X-ClientProxiedBy: EX13D35UWB003.ant.amazon.com (10.43.161.65) 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: CGmjwefpgOZCtfVbsx2qLFOOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619432; bh=HnZQy/p/vhpUSUOy45DyBwYmoIorFhSCWSXCXdTPZ4o=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=jJAwkfwFor8t7a4bIV77jz/f1K+TuH7YtPkuu+BtjqYUazMbWcgdT8wFSW111fWvc8y i83VgpHruJBBq4UnX1/KaWF7+6xXAeaBa1EL3EC0n3poqKrcji5DB+IzGgwIWxxWZswBJ VgMZxP/HbmSOkrNdUTPm9EAxTFZLZ9ORTdE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619434663100023 Content-Type: text/plain; charset="utf-8" The bootlog infrastructure records time stamps of every message. However, not all platforms have readily available time sources. Add a fallback path to return 0 for every time stamp. Signed-off-by: Alexander Graf --- .../BaseDebugBootlog/DebugBootlogNotime.c | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 MdePkg/Library/BaseDebugBootlog/DebugBootlogNotime.c diff --git a/MdePkg/Library/BaseDebugBootlog/DebugBootlogNotime.c b/MdePkg/= Library/BaseDebugBootlog/DebugBootlogNotime.c new file mode 100644 index 0000000000..e88c949cf2 --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/DebugBootlogNotime.c @@ -0,0 +1,31 @@ +/** @file + Base Debug library instance for a RAM based boot log + It provides functions to store debug messages in RAM and make them avail= able as + Bootlog Configuration Table. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BaseDebugBootlog.h" + +UINT64 +EFIAPI +BaseDebugLibBootlogTicksPerSecond ( + VOID + ) +{ + return 0; +} + +UINT64 +EFIAPI +BaseDebugLibBootlogTicks ( + VOID + ) +{ + return 0; +} + --=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 (#90069): https://edk2.groups.io/g/devel/message/90069 Mute This Topic: https://groups.io/mt/91368909/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- From nobody Sat May 18 23:44:04 2024 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+90072+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+90072+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619434; cv=none; d=zohomail.com; s=zohoarc; b=m6B0bIrI/hCyY5fsLcvXm0nR0BAzJKb7cnCETfv352CfSLTyeOHI+LfuQxK2fM+CWiVfuCTum7AmgyjSI0jUjSNhBYCiaADghlhVbQQIbgwUXveFicjnltW46UwXs8UKzGOUkcQnFAp7AfPXCIBHnh+muUWDB6LT99rD72MpC2Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619434; 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=Dh2fj5fFZJthLkQxiETy76JhWfC7eCSz5NElC7W78pg=; b=JzsTo634EveGzA02u7DAjREZlcD4WNHWUyKNIzovdbwr2+n9Y+HmX2Z5grBetk4XIrOKcEeHiBuM1Cn9Sb0/UL34dEMKIWEu8RjD8Y71bMRFLC6XfyJ4qaafDhbJ9NokQLG73c9JrNTJ6WlrlA89du5whgS6JRLLeaFlwXsHdx8= 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+90072+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1653619434375560.6896457813696; Thu, 26 May 2022 19:43:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 95tEYY1788612xBf1KvNu1r2; Thu, 26 May 2022 19:43:54 -0700 X-Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by mx.groups.io with SMTP id smtpd.web11.3218.1653619433155395947 for ; Thu, 26 May 2022 19:43:53 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="92377777" X-Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1d-ca048aa0.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 27 May 2022 02:43:38 +0000 X-Received: from EX13MTAUWC002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1d-ca048aa0.us-east-1.amazon.com (Postfix) with ESMTPS id 03BA282217; Fri, 27 May 2022 02:43:35 +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:43:33 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.162.202) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:32 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 04/12] MdePkg: Add X86 timer support for BaseDebugBootlog Date: Fri, 27 May 2022 04:43:09 +0200 Message-ID: <20220527024317.13476-5-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.162.202] X-ClientProxiedBy: EX13D35UWB003.ant.amazon.com (10.43.161.65) 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: TuWm65fWcCETxHIKiDkoAJ8tx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619434; bh=XWRfgyYKf160etCXV8EBM2nv45z81K8DokFO6Gn7rH8=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=mOoRIwKdx/UC97+iA9hFqPXAFg6MlPVDrqOYLKYwLJeV/L2U19yJ6KB1ZiDud8jYO6L 0ucllcY2q/dhrlYxZT7FEBPG7PE4Yxkj+UG+rHMF521Jvb9xMQLe90Vmkz/A7fX4+OwVs s19CnTA1q6HtMb/rTmg2Q0l4cc88Dtats+g= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619434663100024 Content-Type: text/plain; charset="utf-8" This patch adds time stamp infrastructure using the TSC. It attempts to determine TSC frequency inside virtual machines, but not on read hardware. Signed-off-by: Alexander Graf --- .../BaseDebugBootlog/DebugBootlogX86.c | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 MdePkg/Library/BaseDebugBootlog/DebugBootlogX86.c diff --git a/MdePkg/Library/BaseDebugBootlog/DebugBootlogX86.c b/MdePkg/Lib= rary/BaseDebugBootlog/DebugBootlogX86.c new file mode 100644 index 0000000000..1b6f677ce8 --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/DebugBootlogX86.c @@ -0,0 +1,50 @@ +/** @file + Base Debug library instance for a RAM based boot log + It provides functions to store debug messages in RAM and make them avail= able as + Bootlog Configuration Table. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BaseDebugBootlog.h" + +UINT64 +EFIAPI +BaseDebugLibBootlogTicksPerSecond ( + VOID + ) +{ + UINT32 MaxLeaf =3D 0; + UINT32 TscKhz =3D 0; + + /* Look up VMware's TSC leaf first */ + AsmCpuid (0x40000000, &MaxLeaf, NULL, NULL, NULL); + if (MaxLeaf >=3D 0x40000010 && MaxLeaf < 0x50000000) { + /* We're in a VM that supports the TSC leaf. */ + AsmCpuid (0x40000010, &TscKhz, NULL, NULL, NULL); + + return (UINT64)TscKhz * 1000; + } + + /* + * The natural fallback path here would be to leverage TimerLib's + * GetPerformanceCounterProperties(), but TimerLib uses DebugLib + * so we can not use it. Let's leave TSC frequency extraction to + * post processing for now. + */ + + return 0; +} + +UINT64 +EFIAPI +BaseDebugLibBootlogTicks ( + VOID + ) +{ + return AsmReadTsc(); +} + --=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 (#90072): https://edk2.groups.io/g/devel/message/90072 Mute This Topic: https://groups.io/mt/91368912/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- From nobody Sat May 18 23:44:04 2024 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+90074+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+90074+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619440; cv=none; d=zohomail.com; s=zohoarc; b=O8WPMbg3AlBmJaDdO7B6sKa5k8RPIzG2pGmi9aQjTuWmxpQzFlC5dh8pizUWNmC4r+T1Suj3/IDSbu9KOq1KFSK5E8RisLXHQBYsaM9+s7izjha+wQzz3lssTmYDwS4L9zyRKZfuV2u4no9MvpouGyWnvK0VhVI0MILSbuv50jM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619440; 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=ld4sMs9U/eVBFKeFW4v7SOo3cZhpn73zrAxXSg7Ijo8=; b=XwADOASoAE/c/Ku/YpMnF8LaoDDIo6Mm9Ew+2G4O7nGKzGqWndGWGLoTOh2sDy7kVxNZy1xWbIWNa0Wyg3j8rtVPKlmPsArl03CgRKJ+dOkDZgpsLIO0A/kCeXsKzW3jKdPqxalVdRsZ3UUHbcFRCup/6Nfalz7TJ568KSkdN8E= 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+90074+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165361944016229.24532927734208; Thu, 26 May 2022 19:44:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mRUKYY1788612xJajO602SEs; Thu, 26 May 2022 19:43:59 -0700 X-Received: from smtp-fw-33001.amazon.com (smtp-fw-33001.amazon.com [207.171.190.10]) by mx.groups.io with SMTP id smtpd.web09.3217.1653619439114423564 for ; Thu, 26 May 2022 19:43:59 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="198036137" X-Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1d-b48bc93b.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-33001.sea14.amazon.com with ESMTP; 27 May 2022 02:43:43 +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-b48bc93b.us-east-1.amazon.com (Postfix) with ESMTPS id C1FFFC092A; Fri, 27 May 2022 02:43:42 +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:43:42 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.161.125) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:40 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 05/12] MdePkg: Add ARM timer support for BaseDebugBootlog Date: Fri, 27 May 2022 04:43:10 +0200 Message-ID: <20220527024317.13476-6-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.161.125] X-ClientProxiedBy: EX13D06UWC001.ant.amazon.com (10.43.162.91) 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: mOvu6W6v3m6z5nVZ5FmtK3VPx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619439; bh=PDYUGrr9Tbq88yksMS2KbobSICNwV2kKLBaBdQrPPWs=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=YLy2WzVMtNgdwuwFe4aS09DGC8kzvQbfXTECm2yOc0Mq4Vvpw+YmCkq0/XE/V564ZEk 9VVo04IaZyRzpJZ/7yOmu4SGPmpWQ5xutK7GuKEuD+3u+4bvi0OpJ+ynf8UiUvcE5lpaL SJguAQLdeTzA46bSrIXInYslyqVvXcv4w1o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619440649100001 Content-Type: text/plain; charset="utf-8" This patch adds bootlog time stamp infrastructure for ARM. It leverages the architected timer which is present on all supported platforms. Signed-off-by: Alexander Graf --- .../BaseDebugBootlog/DebugBootlogArm.c | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 MdePkg/Library/BaseDebugBootlog/DebugBootlogArm.c diff --git a/MdePkg/Library/BaseDebugBootlog/DebugBootlogArm.c b/MdePkg/Lib= rary/BaseDebugBootlog/DebugBootlogArm.c new file mode 100644 index 0000000000..5a2c346844 --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/DebugBootlogArm.c @@ -0,0 +1,32 @@ +/** @file + Base Debug library instance for a RAM based boot log + It provides functions to store debug messages in RAM and make them avail= able as + Bootlog Configuration Table. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BaseDebugBootlog.h" +#include + +UINT64 +EFIAPI +BaseDebugLibBootlogTicksPerSecond ( + VOID + ) +{ + return ArmGenericTimerGetTimerFreq(); +} + +UINT64 +EFIAPI +BaseDebugLibBootlogTicks ( + VOID + ) +{ + return ArmGenericTimerGetSystemCount(); +} + --=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 (#90074): https://edk2.groups.io/g/devel/message/90074 Mute This Topic: https://groups.io/mt/91368915/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- From nobody Sat May 18 23:44:04 2024 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+90068+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+90068+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619431; cv=none; d=zohomail.com; s=zohoarc; b=EsPOd2YrPl7DVRm/aNlN0j8kbt/FSqL8Y8oIKGbukwkxJVy8NjmiO84V1tEGDlaN8/Zf7qMuHZyAiGx3jjDj2AuP0qCt4UVUEqRUPPWWmIDaltspFTlW5nYODKhJ+Uiw49sBtl9ikqfjjj9K4SnetoRtLaK9e9Fsv6edpn7onb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619431; 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=j3Ur7Rvdnehhptbj3dfweZdViYAR+fx+c4PGSHMgkWc=; b=Yucm9Dukw8OqWyKyFNJDBDrIorFVr4laJhzy0EXozSgGCH6jqbdJ2gJs499IvUQx7KJnnyuzfTTQ3mzDBCILtRVwqnl63J0h0Dh489iqMHSk59Zehpr0HNCpwj29yMdsgFXQahkaS3Mm03sBsRPNpyo04QMS3KSiGumWq1a7Xdo= 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+90068+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1653619431973321.821793643348; Thu, 26 May 2022 19:43:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cat1YY1788612xxboZocAohh; Thu, 26 May 2022 19:43:51 -0700 X-Received: from smtp-fw-80007.amazon.com (smtp-fw-80007.amazon.com [99.78.197.218]) by mx.groups.io with SMTP id smtpd.web09.3215.1653619430953251872 for ; Thu, 26 May 2022 19:43:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="92454050" X-Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-iad-1a-b27d4a00.us-east-1.amazon.com) ([10.25.36.210]) by smtp-border-fw-80007.pdx80.corp.amazon.com with ESMTP; 27 May 2022 02:43:46 +0000 X-Received: from EX13MTAUWC001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-b27d4a00.us-east-1.amazon.com (Postfix) with ESMTPS id 468DD80364; Fri, 27 May 2022 02:43:45 +0000 (UTC) X-Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:44 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.161.125) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:42 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 06/12] MdePkg: Add Pei phase BaseDebugBootlog Date: Fri, 27 May 2022 04:43:11 +0200 Message-ID: <20220527024317.13476-7-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.161.125] X-ClientProxiedBy: EX13D06UWC001.ant.amazon.com (10.43.162.91) 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: ddPRY19f6Y8qlYA92WPwgNBEx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619431; bh=IKGcwccq9h5ZL75za3fi+kdTKkZrB7cK8wrDBjFZfHM=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=xEIxernazOqocanPqBadQGsl4RFirJJEnPrym9/FtA1t/sUAIX7ueIDmB4yIVsmBz90 oAH5ZcQtPvZqQBGNkcEDQc6WZ5b1j3OzSE893fkQPdRfS0sFeYiaaIBDrYq5QCrzwcDro qr8SCB85cjgzqkgYlKpZbclMR6/6/MGcfek= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619432634100013 Content-Type: text/plain; charset="utf-8" This patch adds all logic required to collect bootlog data during the PEI phase. During PEI, we create a HOB entry for every log line. Later, when we emit the first DXE bootlog line, we automatically collect all bootlog HOB entries into the actual bootlog. Signed-off-by: Alexander Graf --- .../BaseDebugBootlog/BaseDebugBootlog.h | 43 +++++++++++++ .../BaseDebugBootlogLibPei.inf | 60 +++++++++++++++++++ .../Library/BaseDebugBootlog/DebugBootlog.c | 22 +++++++ .../BaseDebugBootlog/DebugBootlogPei.c | 36 +++++++++++ MdePkg/MdePkg.dec | 29 +++++++++ 5 files changed, 190 insertions(+) create mode 100644 MdePkg/Library/BaseDebugBootlog/BaseDebugBootlog.h create mode 100644 MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.= inf create mode 100644 MdePkg/Library/BaseDebugBootlog/DebugBootlog.c create mode 100644 MdePkg/Library/BaseDebugBootlog/DebugBootlogPei.c diff --git a/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlog.h b/MdePkg/Li= brary/BaseDebugBootlog/BaseDebugBootlog.h new file mode 100644 index 0000000000..6bba4a5c30 --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlog.h @@ -0,0 +1,43 @@ +/** @file + Base Debug library instance for a RAM based boot log + It provides functions to store debug messages in RAM and make them avail= able as + Bootlog Configuration Table. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2012, Red Hat, Inc.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +// Starting size of the log buffer +// +#define BOOTLOG_MIN_SIZE 0x80000 + +// +// Maximum number of parallel boot logs +// +#define MAX_LOGS 16 + +UINT64 +EFIAPI +BaseDebugLibBootlogTicksPerSecond ( + VOID + ); + +UINT64 +EFIAPI +BaseDebugLibBootlogTicks ( + VOID + ); diff --git a/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.inf b/M= dePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.inf new file mode 100644 index 0000000000..abc66a953f --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.inf @@ -0,0 +1,60 @@ +## @file +# Base Debug library instance for a RAM based boot log +# It provides functions to store debug messages in RAM and make them avai= lable as +# Bootlog Configuration Table. +# +# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2012, Red Hat, Inc.
+# Copyright (c) 2022, Amazon Development Center Germany GmbH. All rights = reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BaseDebugBootlog + FILE_GUID =3D DF934DA3-CD31-49FE-AF50-B3C87C79325D + MODULE_TYPE =3D PEI_CORE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D DebugBootlogLib|PEI_CORE PEIM + +[Sources] + DebugBootlog.c + DebugBootlogPei.c + +[Sources.IA32, Sources.X64] + DebugBootlogX86.c + +[Sources.ARM, Sources.AARCH64] + DebugBootlogArm.c + +[Sources.EBC, Sources.RISCV64] + DebugBootlogNotime.c + +[Packages] + MdePkg/MdePkg.dec + +[Packages.AARCH64] + ArmPkg/ArmPkg.dec + +[LibraryClasses] + BaseMemoryLib + PcdLib + PrintLib + BaseLib + DebugPrintErrorLevelLib + PeiServicesLib + +[LibraryClasses.AARCH64] + ArmGenericTimerCounterLib + +[LibraryClasses.ARM] + ArmGenericTimerCounterLib + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdDebugBootlogErrorLevel ## CONSUMES + +[Guids] + gBootlogConfigTableGuid ## CONSUMES diff --git a/MdePkg/Library/BaseDebugBootlog/DebugBootlog.c b/MdePkg/Librar= y/BaseDebugBootlog/DebugBootlog.c new file mode 100644 index 0000000000..bceb1c96da --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/DebugBootlog.c @@ -0,0 +1,22 @@ +/** @file + Base Debug library instance for a RAM based boot log + It provides functions to store debug messages in RAM and make them avail= able as + Bootlog Configuration Table. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2012, Red Hat, Inc.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +UINT32 +EFIAPI +GetDebugBootlogErrorLevel ( + VOID + ) +{ + return PcdGet32 (PcdDebugBootlogErrorLevel); +} diff --git a/MdePkg/Library/BaseDebugBootlog/DebugBootlogPei.c b/MdePkg/Lib= rary/BaseDebugBootlog/DebugBootlogPei.c new file mode 100644 index 0000000000..2106e8190a --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/DebugBootlogPei.c @@ -0,0 +1,36 @@ +/** @file + Base Debug library instance for a RAM based boot log + It provides functions to store debug messages in RAM and make them avail= able as + Bootlog Configuration Table. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2012, Red Hat, Inc.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BaseDebugBootlog.h" +#include + +RETURN_STATUS +EFIAPI +DebugBootlogAppend ( + IN CONST CHAR8 *String, + IN UINTN Length, + IN UINTN ErrorLevel + ) +{ + BOOTLOG_ENTRY_EDK2 *Entry; + + Entry =3D BuildGuidHob (&gBootlogConfigTableGuid, sizeof(*Entry) + Lengt= h + 1); + if (Entry =3D=3D NULL) + return EFI_NOT_FOUND; + + Entry->ErrorLevel =3D ErrorLevel; + Entry->Log.Ticks =3D BaseDebugLibBootlogTicks(); + CopyMem (&Entry->Log.String, String, Length); + Entry->Log.String[Length] =3D '\0'; + + return EFI_SUCCESS; +} diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index f1ebf9e251..8e68324028 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -837,6 +837,11 @@ ## Include/Protocol/CcMeasurement.h gEfiCcFinalEventsTableGuid =3D { 0xdd4a4648, 0x2de7, 0x4665, { 0x96,= 0x4d, 0x21, 0xd9, 0xef, 0x5f, 0xb4, 0x46 }} =20 + # + # GUID to identify Bootlog data + # + gBootlogConfigTableGuid =3D {0xd6128add, 0x85fa, 0x4428, {= 0x96, 0x5b, 0x26, 0xfd, 0xab, 0xad, 0xfb, 0x26}} + [Guids.IA32, Guids.X64] ## Include/Guid/Cper.h gEfiIa32X64ErrorTypeCacheCheckGuid =3D { 0xA55701F5, 0xE3EF, 0x43de, { 0= xAC, 0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C }} @@ -2257,6 +2262,30 @@ # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPrintError= Level & 0x7F84AA00) =3D=3D 0 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000|UINT32|0x000= 00006 =20 + ## This flag is used to control the boot log Debug message.

+ # BIT0 - Initialization message.
+ # BIT1 - Warning message.
+ # BIT2 - Load Event message.
+ # BIT3 - File System message.
+ # BIT4 - Allocate or Free Pool message.
+ # BIT5 - Allocate or Free Page message.
+ # BIT6 - Information message.
+ # BIT7 - Dispatcher message.
+ # BIT8 - Variable message.
+ # BIT10 - Boot Manager message.
+ # BIT12 - BlockIo Driver message.
+ # BIT14 - Network Driver message.
+ # BIT16 - UNDI Driver message.
+ # BIT17 - LoadFile message.
+ # BIT19 - Event message.
+ # BIT20 - Global Coherency Database changes message.
+ # BIT21 - Memory range cachability changes message.
+ # BIT22 - Detailed debug message.
+ # BIT31 - Error message.
+ # @Prompt Debug Message Bootlog Level. + # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugBootlogErr= orLevel & 0x7F84AA00) =3D=3D 0 + gEfiMdePkgTokenSpaceGuid.PcdDebugBootlogErrorLevel|0x8000004F|UINT32|0x0= 0000031 + ## The mask is used to control ReportStatusCodeLib behavior.

# BIT0 - Enable Progress Code.
# BIT1 - Enable Error Code.
--=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 (#90068): https://edk2.groups.io/g/devel/message/90068 Mute This Topic: https://groups.io/mt/91368907/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- From nobody Sat May 18 23:44:04 2024 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+90073+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+90073+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619435; cv=none; d=zohomail.com; s=zohoarc; b=ZLTgwYp0pEJbBAArJhicGkyAg/awra5Bk5N00wW9wBDv4ubZG0Gpk6sNDaf+BbIXVg2pL4mhVqtA/My7Xzt9ktH+/YRDUjQgUCDX88G4QF0UYGqBepD6UtNkY2KreT89h3PHmMzVDR1wLFwDTDUtXhNM7c2xxern6lxUiRfmjb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619435; 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=lvsUggttQWZnm29fJUvQtnJyvZ8LsS5s6mFza2R/Ceg=; b=FV404ZgG7W3oC7RxHiLhktHGR2RAgtIgEVs29MPFBQObvWfeAMjBYJCXmjTUFOJyDtaQZSo8SVtaX+1uHexxtJViMoF7MKrU7C7CBXjoTvRPVPo1gRe02777eicQLHDmU/lYK91gut1xuz8v0Me0fYEqCqm9jkf/rjxrhKrlZxI= 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+90073+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1653619434988436.4549192370383; Thu, 26 May 2022 19:43:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PkzjYY1788612xQU1pY3sSIW; Thu, 26 May 2022 19:43:54 -0700 X-Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by mx.groups.io with SMTP id smtpd.web11.3218.1653619433155395947 for ; Thu, 26 May 2022 19:43:53 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="92377795" X-Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1e-90d70b14.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 27 May 2022 02:43:49 +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-1e-90d70b14.us-east-1.amazon.com (Postfix) with ESMTPS id DEA00C0919; Fri, 27 May 2022 02:43:46 +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:43:46 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.161.125) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:44 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 07/12] MdePkg: Add Dxe phase BaseDebugBootlog Date: Fri, 27 May 2022 04:43:12 +0200 Message-ID: <20220527024317.13476-8-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.161.125] X-ClientProxiedBy: EX13D06UWC001.ant.amazon.com (10.43.162.91) 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: T7A4SAHEVp1rHUiMxam4nZUUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619434; bh=imjCS8gG+5otkxXHQTDTtge5GhzRAI/UnHoeT6JjQGU=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=JoE1mLujXbUCjZYLoesvntOih1Fgn/bQ/GbeppKqgkrosVMvT8MU72mBWV4rYIPzDrr S8fycg29wF3lYlMqVHqhd8BQ2vRpyMxNFKRh8cz8XamMrWOILXqkct50vcu/EwCc/YCLa FxvXOybXHJZ8YheVmEWcqUlwDHCNo/k9Fk0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619436670100035 Content-Type: text/plain; charset="utf-8" This patch adds the main bootlog infrastructure to dynamically create the bootlog configuration table and edk2 bootlog at DXE phase. It attempts to do all this dynamically: The bootlog configuration table may first get created by a UEFI application. This code also collects all PEI phase log entries and assembles them into the final bootlog. Signed-off-by: Alexander Graf --- .../BaseDebugBootlog/BaseDebugBootlogLib.inf | 61 +++ .../BaseDebugBootlog/DebugBootlogDxe.c | 349 ++++++++++++++++++ 2 files changed, 410 insertions(+) create mode 100644 MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf create mode 100644 MdePkg/Library/BaseDebugBootlog/DebugBootlogDxe.c diff --git a/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf b/MdeP= kg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf new file mode 100644 index 0000000000..49cdd3f9ad --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf @@ -0,0 +1,61 @@ +## @file +# Base Debug library instance for a RAM based boot log +# It provides functions to store debug messages in RAM and make them avai= lable as +# Bootlog Configuration Table. +# +# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2012, Red Hat, Inc.
+# Copyright (c) 2022, Amazon Development Center Germany GmbH. All rights = reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BaseDebugBootlog + FILE_GUID =3D DF934DA3-CD31-49FE-AF50-B3C87C79325C + MODULE_TYPE =3D DXE_CORE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D DebugBootlogLib|DXE_CORE DXE_DRIVER U= EFI_DRIVER UEFI_APPLICATION + CONSTRUCTOR =3D BaseDebugBootlogLibConstructor + +[Sources] + DebugBootlog.c + DebugBootlogDxe.c + +[Sources.IA32, Sources.X64] + DebugBootlogX86.c + +[Sources.ARM, Sources.AARCH64] + DebugBootlogArm.c + +[Sources.EBC, Sources.RISCV64] + DebugBootlogNotime.c + +[Packages] + MdePkg/MdePkg.dec + +[Packages.AARCH64] + ArmPkg/ArmPkg.dec + +[LibraryClasses] + BaseMemoryLib + PcdLib + PrintLib + BaseLib + DebugPrintErrorLevelLib + +[LibraryClasses.AARCH64] + ArmGenericTimerCounterLib + +[LibraryClasses.ARM] + ArmGenericTimerCounterLib + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdDebugBootlogErrorLevel ## CONSUMES + +[Guids] + gBootlogConfigTableGuid ## CONSUMES + gEfiHobListGuid ## CONSUMES diff --git a/MdePkg/Library/BaseDebugBootlog/DebugBootlogDxe.c b/MdePkg/Lib= rary/BaseDebugBootlog/DebugBootlogDxe.c new file mode 100644 index 0000000000..b95cb969f1 --- /dev/null +++ b/MdePkg/Library/BaseDebugBootlog/DebugBootlogDxe.c @@ -0,0 +1,349 @@ +/** @file + Base Debug library instance for a RAM based boot log + It provides functions to store debug messages in RAM and make them avail= able as + Bootlog Configuration Table. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2012, Red Hat, Inc.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BaseDebugBootlog.h" + +// +// Cached pointer to the current bootlog structure +// +BOOTLOG_HEADER *gBootlog; + +// +// We can not link against UefiBootServicesTableLib as that itself referen= ces +// DebugLib, so instead we save our own copies of the System Table and Boot +// Services structs. +// +static EFI_SYSTEM_TABLE *mDebugST; + +/** + We can not link against UefiBootServicesTableLib as that itself referenc= es + DebugLib, so instead we save our own copies of the System Table and Boot + Services structs. + + @retval EFI_SUCCESS The constructor always returns RETURN_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +BaseDebugBootlogLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + mDebugST =3D SystemTable; + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +BaseDebugBootlogAppendInternal ( + IN CONST CHAR8 *String, + IN UINTN Length, + IN UINTN ErrorLevel, + IN UINT64 Ticks + ); + +static +EFI_STATUS +EFIAPI +UpdateEdk2Bootlog ( + IN BOOTLOG_CONFIG_TABLE *Table, + IN BOOTLOG_HEADER *OldBootlog, + IN BOOTLOG_HEADER *NewBootlog + ) +{ + UINTN Index; + + for (Index =3D 0; Index < Table->NrLogs; Index++) { + if (Table->LogAddress[Index] =3D=3D (EFI_PHYSICAL_ADDRESS) OldBootlog)= { + Table->LogAddress[Index] =3D (EFI_PHYSICAL_ADDRESS) NewBootlog; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + +static +EFI_STATUS +EFIAPI +FindEdk2Bootlog ( + IN BOOTLOG_CONFIG_TABLE *Table, + OUT BOOTLOG_HEADER **Bootlog + ) +{ + UINTN Index; + BOOTLOG_HEADER *Cur; + + for (Index =3D 0; Index < Table->NrLogs; Index++) { + Cur =3D (BOOTLOG_HEADER *)Table->LogAddress[Index]; + if (Cur->Signature =3D=3D SIG_BOOTLOG_HEADER && + CompareMem(Cur->Producer, BOOTLOG_PRODUCER, sizeof(Cur->Producer))= =3D=3D 0 && + Cur->ExtraHeaderType =3D=3D BOOTLOG_EXTRA_HEADER_EDK2) { + *Bootlog =3D Cur; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + +static +EFI_STATUS +EFIAPI +FindConfigTable ( + IN EFI_GUID *TableGuid, + OUT VOID *Table + ) +{ + EFI_SYSTEM_TABLE *SystemTable; + VOID **_Table =3D Table; + UINTN Index; + + if (TableGuid =3D=3D NULL || Table =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + SystemTable =3D mDebugST; + *_Table =3D NULL; + for (Index =3D 0; Index < SystemTable->NumberOfTableEntries; Index++) { + if (CompareGuid (TableGuid, &(SystemTable->ConfigurationTable[Index].V= endorGuid))) { + *_Table =3D SystemTable->ConfigurationTable[Index].VendorTable; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + +static +EFI_STATUS +EFIAPI +AllocateTable ( + IN EFI_BOOT_SERVICES *BS, + IN BOOTLOG_CONFIG_TABLE **pTable + ) +{ + EFI_STATUS Status; + UINTN TableLength =3D sizeof(BOOTLOG_CONFIG_TABLE) + MAX_LOGS * sizeof(U= INT64); + + Status =3D BS->AllocatePool ( + EfiBootServicesData, + TableLength, + (VOID **)pTable + ); + if (Status !=3D EFI_SUCCESS) + return Status; + + ZeroMem (*pTable, TableLength); + (*pTable)->Signature =3D SIG_BOOTLOG_CONFIG_TABLE; + (*pTable)->MaxLogs =3D MAX_LOGS; + + return Status; +} + +static +EFI_STATUS +EFIAPI +AllocateBootlog ( + IN EFI_BOOT_SERVICES *BS, + IN BOOTLOG_HEADER **NewBootlog, + IN UINTN Size + ) +{ + EFI_STATUS Status; + + Status =3D BS->AllocatePages ( + AllocateAnyPages, + EfiBootServicesData, + EFI_SIZE_TO_PAGES (Size), + (EFI_PHYSICAL_ADDRESS *)NewBootlog + ); + if (Status !=3D EFI_SUCCESS) + return Status; + + ZeroMem (*NewBootlog, Size); + + return Status; +} + +static +VOID +EFIAPI +BaseDebugLibBootlogInitialize ( + IN BOOTLOG_HEADER *Bootlog, + IN UINT64 Size + ) +{ + Bootlog->Signature =3D SIG_BOOTLOG_HEADER; + CopyMem(Bootlog->Producer, BOOTLOG_PRODUCER, sizeof(Bootlog->Producer)); + Bootlog->ExtraHeaderType =3D BOOTLOG_EXTRA_HEADER_EDK2; + Bootlog->ExtraHeaderSize =3D sizeof(Bootlog->ExtraHeader); + Bootlog->MsgExtraHeaderSize =3D sizeof(BOOTLOG_ENTRY_EDK2) - sizeof(BOOT= LOG_ENTRY); + Bootlog->LastByte =3D OFFSET_OF(BOOTLOG_HEADER, Data); + Bootlog->TicksPerSecond =3D BaseDebugLibBootlogTicksPerSecond(); + Bootlog->ExtraHeader.AllocatedSize =3D Size; +} + +static +EFI_STATUS +EFIAPI +BaseDebugLibFindAndExpandBootlog ( + IN BOOTLOG_HEADER **pBootlog, + IN UINTN AppendDataLength + ) +{ + EFI_BOOT_SERVICES *BS; + BOOTLOG_HEADER *Bootlog; + BOOTLOG_HEADER *NewBootlog; + BOOTLOG_CONFIG_TABLE *Table; + EFI_STATUS Status =3D EFI_SUCCESS; + UINTN NewSize; + EFI_PEI_HOB_POINTERS Hob; + + if (!mDebugST || !mDebugST->BootServices) + return EFI_NOT_FOUND; + + BS =3D mDebugST->BootServices; + + if (!gBootlog) { + /* Allocate a new Bootlog Configuration Table if not present */ + if (FindConfigTable (&gBootlogConfigTableGuid, &Table) !=3D EFI_SUCCES= S) { + Status =3D AllocateTable (BS, &Table); + if (Status !=3D EFI_SUCCESS) { + return Status; + } + + Status =3D BS->InstallConfigurationTable ( + &gBootlogConfigTableGuid, + Table + ); + if (Status !=3D EFI_SUCCESS) { + return Status; + } + } + + /* Allocate a Bootlog structure if none is in the table */ + if (FindEdk2Bootlog (Table, &Bootlog) !=3D EFI_SUCCESS) { + /* + * There is a tiny phase right after DXE entry where gEfiHobListGuid= is + * not populated yet. But we need the HobList to carry PEI logs over. + * Let's just drop any line that we get in that period. + */ + Status =3D FindConfigTable (&gEfiHobListGuid, &Hob.Raw); + if (Status !=3D EFI_SUCCESS) { + return Status; + } + + Status =3D AllocateBootlog (BS, &Bootlog, BOOTLOG_MIN_SIZE); + if (Status !=3D EFI_SUCCESS) { + return Status; + } + BaseDebugLibBootlogInitialize(Bootlog, BOOTLOG_MIN_SIZE); + + if (Table->NrLogs >=3D Table->MaxLogs) { + return EFI_NOT_FOUND; + } + Table->LogAddress[Table->NrLogs++] =3D (EFI_PHYSICAL_ADDRESS) Bootlo= g; + + gBootlog =3D Bootlog; + + /* + * This is the first time we go from PEI -> DXE. Copy all PEI log en= tries + * into our full fledged boot log structure + */ + if (Status =3D=3D EFI_SUCCESS) { + while (!END_OF_HOB_LIST (Hob)) { + if (Hob.Header->HobType =3D=3D EFI_HOB_TYPE_GUID_EXTENSION && + CompareGuid (&gBootlogConfigTableGuid, &Hob.Guid->Name) && + GET_HOB_LENGTH (Hob) > sizeof (BOOTLOG_ENTRY_EDK2)) { + BOOTLOG_ENTRY_EDK2 *Entry =3D GET_GUID_HOB_DATA (Hob); + BaseDebugBootlogAppendInternal ( + Entry->Log.String, + AsciiStrLen (Entry->Log.String), + Entry->ErrorLevel, + Entry->Log.Ticks + ); + } + + Hob.Raw =3D GET_NEXT_HOB (Hob); + } + } + } + + gBootlog =3D Bootlog; + } else { + Bootlog =3D gBootlog; + } + + /* Resize if the new string would not fit */ + if ((Bootlog->LastByte + AppendDataLength) > Bootlog->ExtraHeader.Alloca= tedSize) { + NewSize =3D ALIGN_VALUE (Bootlog->LastByte + AppendDataLength + EFI_PA= GE_SIZE * 16, + EFI_PAGE_SIZE); + Status =3D AllocateBootlog (BS, &NewBootlog, NewSize); + if (Status !=3D EFI_SUCCESS) { + return Status; + } + + CopyMem (NewBootlog, Bootlog, Bootlog->LastByte); + NewBootlog->ExtraHeader.AllocatedSize =3D NewSize; + UpdateEdk2Bootlog (Table, Bootlog, NewBootlog); + BS->FreePages ((EFI_PHYSICAL_ADDRESS) Bootlog, + EFI_SIZE_TO_PAGES (Bootlog->ExtraHeader.AllocatedSize)); + Bootlog =3D gBootlog =3D NewBootlog; + } + + *pBootlog =3D Bootlog; + + return Status; +} + +EFI_STATUS +EFIAPI +BaseDebugBootlogAppendInternal ( + IN CONST CHAR8 *String, + IN UINTN Length, + IN UINTN ErrorLevel, + IN UINT64 Ticks + ) +{ + BOOTLOG_HEADER *Bootlog; + BOOTLOG_ENTRY_EDK2 Hdr; + + if (BaseDebugLibFindAndExpandBootlog (&Bootlog, Length + sizeof(Hdr)) != =3D EFI_SUCCESS) + return EFI_SUCCESS; + + Hdr.ErrorLevel =3D ErrorLevel; + Hdr.Log.Ticks =3D Ticks; + + CopyMem (((VOID *)Bootlog) + Bootlog->LastByte, &Hdr, sizeof(Hdr)); + Bootlog->LastByte +=3D sizeof(Hdr); + CopyMem (((VOID *)Bootlog) + Bootlog->LastByte, String, Length); + Bootlog->LastByte +=3D Length; + *((CHAR8 *)Bootlog + Bootlog->LastByte) =3D '\0'; + Bootlog->LastByte +=3D 1; + + return EFI_SUCCESS; +} + +RETURN_STATUS +EFIAPI +DebugBootlogAppend ( + IN CONST CHAR8 *String, + IN UINTN Length, + IN UINTN ErrorLevel + ) +{ + return BaseDebugBootlogAppendInternal(String, Length, ErrorLevel, + BaseDebugLibBootlogTicks ()); +} --=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 (#90073): https://edk2.groups.io/g/devel/message/90073 Mute This Topic: https://groups.io/mt/91368913/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- From nobody Sat May 18 23:44:04 2024 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+90070+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+90070+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619433; cv=none; d=zohomail.com; s=zohoarc; b=d2z/fOFW9o5Q4HRsCxjesjwhYK6ngEd2Cy8KcztbrHofizeJi3TY/pUb39EnFxr5ymWZPUYYi6yGHkrlfD8bG1m7KkDBubQj2KlEWAg2jEwkl8ZuHdjFpwjXOGjCsrz4su/z3cKOZiC5jxwDF9IannKwO510L0/GU/nEUM8EBOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619433; 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=gV2SIy0P0TqsTnp9ho9GhU8r5SeENa4vUxx2tUqlyiY=; b=LbFoCwohmiLe5g5yryTBBk6ehbEg0Li8HfwZNGe4Zqyam92lXpst65E+ncF4AYNIRmMNOD4zwPAxPa/licByj+b6nJZtpI8zVLnHfFLEA9T6GDKIFgkrluw9OEwiof+RAcaY7u4UY9WnxrzvyHFMh+wzhf7ZFg3SihdKu6hWlEk= 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+90070+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1653619433031927.0976321677301; Thu, 26 May 2022 19:43:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bOAOYY1788612xzptFgF7zYw; Thu, 26 May 2022 19:43:52 -0700 X-Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by mx.groups.io with SMTP id smtpd.web10.3205.1653619431365736140 for ; Thu, 26 May 2022 19:43:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="202322438" X-Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1e-0bfdb89e.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP; 27 May 2022 02:43:51 +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-1e-0bfdb89e.us-east-1.amazon.com (Postfix) with ESMTPS id EA174E0023; Fri, 27 May 2022 02:43:48 +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:43:47 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.161.125) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:46 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 08/12] MdePkg: Add BaseDebugLibBootlog Date: Fri, 27 May 2022 04:43:13 +0200 Message-ID: <20220527024317.13476-9-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.161.125] X-ClientProxiedBy: EX13D06UWC001.ant.amazon.com (10.43.162.91) 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: uJG8Do7h9yKig7YaLuYLZWVax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619432; bh=39+jvvHYlNFfiklF8IZwt/BHL/KyYSWxFoD+4YKAEFE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=lkfCrwzH7tq2inpDkTn5IqF+UTyj+rRerB1toJTEX7zvYUTeBnU+VpBsA36VLlNz6I3 OBB/CdEYhPoXefKj3GgW9ClqwfMcG7cwalPz56s4hrIUVzQGuylTkDxzc7/a8r9m9YS4a Wes2RzIppIK/yjl/+os0UDStF9XaDmsNf7w= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619434691100026 Content-Type: text/plain; charset="utf-8" In some situations, we do not want to emit any debug output to serial, but still create a bootlog. In these situations, we can use BaseDebugLibBootlog instead of BaseDebugLibNull. It's a DebugLib that emits exclusively to the bootlog. Signed-off-by: Alexander Graf --- .../BaseDebugLibBootlog.inf | 44 +++ .../BaseDebugLibBootlog.uni | 17 + MdePkg/Library/BaseDebugLibBootlog/DebugLib.c | 338 ++++++++++++++++++ 3 files changed, 399 insertions(+) create mode 100644 MdePkg/Library/BaseDebugLibBootlog/BaseDebugLibBootlog.= inf create mode 100644 MdePkg/Library/BaseDebugLibBootlog/BaseDebugLibBootlog.= uni create mode 100644 MdePkg/Library/BaseDebugLibBootlog/DebugLib.c diff --git a/MdePkg/Library/BaseDebugLibBootlog/BaseDebugLibBootlog.inf b/M= dePkg/Library/BaseDebugLibBootlog/BaseDebugLibBootlog.inf new file mode 100644 index 0000000000..4e524e0859 --- /dev/null +++ b/MdePkg/Library/BaseDebugLibBootlog/BaseDebugLibBootlog.inf @@ -0,0 +1,44 @@ +## @file +# Instance of Debug library that only emits to the boot log +# It uses PrintLib to send debug messages to the boot log. +# +# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2022, Amazon Development Center Germany GmbH.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BaseDebugLibSerialPort + MODULE_UNI_FILE =3D BaseDebugLibSerialPort.uni + FILE_GUID =3D BB83F95F-EDBC-4884-A520-CD42AF388FAE + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D DebugLib + +# +# VALID_ARCHITECTURES =3D IA32 X64 EBC +# + +[Sources] + DebugLib.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseMemoryLib + PcdLib + PrintLib + BaseLib + DebugPrintErrorLevelLib + DebugBootlogLib + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES + diff --git a/MdePkg/Library/BaseDebugLibBootlog/BaseDebugLibBootlog.uni b/M= dePkg/Library/BaseDebugLibBootlog/BaseDebugLibBootlog.uni new file mode 100644 index 0000000000..de131c1292 --- /dev/null +++ b/MdePkg/Library/BaseDebugLibBootlog/BaseDebugLibBootlog.uni @@ -0,0 +1,17 @@ +// /** @file +// Instance of Debug Library that only emits to the boot log. +// +// It uses Print Library to produce formatted output strings to the boot l= og. +// +// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+// Copyright (c) 2022, Amazon Development Center Germany GmbH.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Instance of Debug= Library that only emits to the boot log." + +#string STR_MODULE_DESCRIPTION #language en-US "It uses Print Lib= rary to produce formatted output strings to the boot log configuration tabl= e." + diff --git a/MdePkg/Library/BaseDebugLibBootlog/DebugLib.c b/MdePkg/Library= /BaseDebugLibBootlog/DebugLib.c new file mode 100644 index 0000000000..ad95ba5d22 --- /dev/null +++ b/MdePkg/Library/BaseDebugLibBootlog/DebugLib.c @@ -0,0 +1,338 @@ +/** @file + Base Debug library instance that only emits to the boot log + It uses PrintLib to send debug messages to the boot log. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +// +// Define the maximum debug and assert message length that this library su= pports +// +#define MAX_DEBUG_MESSAGE_LENGTH 0x100 + +// +// VA_LIST can not initialize to NULL for all compiler, so we use this to +// indicate a null VA_LIST +// +VA_LIST mVaListNull; + +/** + Prints a debug message to the debug output device if the specified error= level is enabled. + + If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function + GetDebugPrintErrorLevel (), then print the message specified by Format a= nd the + associated variable argument list to the debug output device. + + If Format is NULL, then ASSERT(). + + @param ErrorLevel The error level of the debug message. + @param Format Format string for the debug message to print. + @param ... Variable argument list whose contents are accessed + based on the format string specified by Format. + +**/ +VOID +EFIAPI +DebugPrint ( + IN UINTN ErrorLevel, + IN CONST CHAR8 *Format, + ... + ) +{ + VA_LIST Marker; + + VA_START (Marker, Format); + DebugVPrint (ErrorLevel, Format, Marker); + VA_END (Marker); +} + +/** + Prints a debug message to the debug output device if the specified + error level is enabled base on Null-terminated format string and a + VA_LIST argument list or a BASE_LIST argument list. + + If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function + GetDebugPrintErrorLevel (), then print the message specified by Format a= nd + the associated variable argument list to the debug output device. + + If Format is NULL, then ASSERT(). + + @param ErrorLevel The error level of the debug message. + @param Format Format string for the debug message to print. + @param VaListMarker VA_LIST marker for the variable argument list. + @param BaseListMarker BASE_LIST marker for the variable argument list. + +**/ +VOID +DebugPrintMarker ( + IN UINTN ErrorLevel, + IN CONST CHAR8 *Format, + IN VA_LIST VaListMarker, + IN BASE_LIST BaseListMarker + ) +{ + CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH]; + UINT32 DebugBootlogLevel, Length; + + // + // If Format is NULL, then ASSERT(). + // + ASSERT (Format !=3D NULL); + + DebugBootlogLevel =3D GetDebugBootlogErrorLevel (); + + // + // Check driver debug mask value and global mask + // + if ((ErrorLevel & DebugBootlogLevel) =3D=3D 0) { + return; + } + + // + // Convert the DEBUG() message to an ASCII String + // + if (BaseListMarker =3D=3D NULL) { + Length =3D AsciiVSPrint (Buffer, sizeof (Buffer), Format, VaListMarker= ); + } else { + Length =3D AsciiBSPrint (Buffer, sizeof (Buffer), Format, BaseListMark= er); + } + + // + // Append the print string to the Boot Log + // + if (ErrorLevel & DebugBootlogLevel) { + DebugBootlogAppend (Buffer, Length, ErrorLevel); + } +} + +/** + Prints a debug message to the debug output device if the specified + error level is enabled. + + If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function + GetDebugPrintErrorLevel (), then print the message specified by Format a= nd + the associated variable argument list to the debug output device. + + If Format is NULL, then ASSERT(). + + @param ErrorLevel The error level of the debug message. + @param Format Format string for the debug message to print. + @param VaListMarker VA_LIST marker for the variable argument list. + +**/ +VOID +EFIAPI +DebugVPrint ( + IN UINTN ErrorLevel, + IN CONST CHAR8 *Format, + IN VA_LIST VaListMarker + ) +{ + DebugPrintMarker (ErrorLevel, Format, VaListMarker, NULL); +} + +/** + Prints a debug message to the debug output device if the specified + error level is enabled. + This function use BASE_LIST which would provide a more compatible + service than VA_LIST. + + If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function + GetDebugPrintErrorLevel (), then print the message specified by Format a= nd + the associated variable argument list to the debug output device. + + If Format is NULL, then ASSERT(). + + @param ErrorLevel The error level of the debug message. + @param Format Format string for the debug message to print. + @param BaseListMarker BASE_LIST marker for the variable argument list. + +**/ +VOID +EFIAPI +DebugBPrint ( + IN UINTN ErrorLevel, + IN CONST CHAR8 *Format, + IN BASE_LIST BaseListMarker + ) +{ + DebugPrintMarker (ErrorLevel, Format, mVaListNull, BaseListMarker); +} + +/** + Prints an assert message containing a filename, line number, and descrip= tion. + This may be followed by a breakpoint or a dead loop. + + Print a message of the form "ASSERT (): \n" + to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED= bit of + PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if + DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set= then + CpuDeadLoop() is called. If neither of these bits are set, then this fu= nction + returns immediately after the message is printed to the debug output dev= ice. + DebugAssert() must actively prevent recursion. If DebugAssert() is call= ed while + processing another DebugAssert(), then DebugAssert() must return immedia= tely. + + If FileName is NULL, then a string of "(NULL) Filename" is pr= inted. + If Description is NULL, then a string of "(NULL) Descripti= on" is printed. + + @param FileName The pointer to the name of the source file that gen= erated the assert condition. + @param LineNumber The line number in the source file that generated t= he assert condition + @param Description The pointer to the description of the assert condit= ion. + +**/ +VOID +EFIAPI +DebugAssert ( + IN CONST CHAR8 *FileName, + IN UINTN LineNumber, + IN CONST CHAR8 *Description + ) +{ + // + // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings + // + if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_E= NABLED) !=3D 0) { + CpuBreakpoint (); + } else if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADL= OOP_ENABLED) !=3D 0) { + CpuDeadLoop (); + } +} + +/** + Fills a target buffer with PcdDebugClearMemoryValue, and returns the tar= get buffer. + + This function fills Length bytes of Buffer with the value specified by + PcdDebugClearMemoryValue, and returns Buffer. + + If Buffer is NULL, then ASSERT(). + If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + + @param Buffer The pointer to the target buffer to be filled with PcdD= ebugClearMemoryValue. + @param Length The number of bytes in Buffer to fill with zeros PcdDeb= ugClearMemoryValue. + + @return Buffer The pointer to the target buffer filled with PcdDebugCl= earMemoryValue. + +**/ +VOID * +EFIAPI +DebugClearMemory ( + OUT VOID *Buffer, + IN UINTN Length + ) +{ + // + // If Buffer is NULL, then ASSERT(). + // + ASSERT (Buffer !=3D NULL); + + // + // SetMem() checks for the the ASSERT() condition on Length and returns = Buffer + // + return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue)); +} + +/** + Returns TRUE if ASSERT() macros are enabled. + + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bi= t of + PcdDebugProperyMask is set. Otherwise FALSE is returned. + + @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= ProperyMask is set. + @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= ProperyMask is clear. + +**/ +BOOLEAN +EFIAPI +DebugAssertEnabled ( + VOID + ) +{ + return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_= ASSERT_ENABLED) !=3D 0); +} + +/** + Returns TRUE if DEBUG() macros are enabled. + + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit= of + PcdDebugProperyMask is set. Otherwise FALSE is returned. + + @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= roperyMask is set. + @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= roperyMask is clear. + +**/ +BOOLEAN +EFIAPI +DebugPrintEnabled ( + VOID + ) +{ + return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_= PRINT_ENABLED) !=3D 0); +} + +/** + Returns TRUE if DEBUG_CODE() macros are enabled. + + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit = of + PcdDebugProperyMask is set. Otherwise FALSE is returned. + + @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= operyMask is set. + @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= operyMask is clear. + +**/ +BOOLEAN +EFIAPI +DebugCodeEnabled ( + VOID + ) +{ + return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_= CODE_ENABLED) !=3D 0); +} + +/** + Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled. + + This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bi= t of + PcdDebugProperyMask is set. Otherwise FALSE is returned. + + @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= ProperyMask is set. + @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= ProperyMask is clear. + +**/ +BOOLEAN +EFIAPI +DebugClearMemoryEnabled ( + VOID + ) +{ + return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_= MEMORY_ENABLED) !=3D 0); +} + +/** + Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixe= dDebugPrintErrorLevel. + + This function compares the bit mask of ErrorLevel and PcdFixedDebugPrint= ErrorLevel. + + @retval TRUE Current ErrorLevel is supported. + @retval FALSE Current ErrorLevel is not supported. + +**/ +BOOLEAN +EFIAPI +DebugPrintLevelEnabled ( + IN CONST UINTN ErrorLevel + ) +{ + return (BOOLEAN)((ErrorLevel & PcdGet32 (PcdFixedDebugPrintErrorLevel)) = !=3D 0); +} --=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 (#90070): https://edk2.groups.io/g/devel/message/90070 Mute This Topic: https://groups.io/mt/91368910/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- From nobody Sat May 18 23:44:04 2024 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+90071+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+90071+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619433; cv=none; d=zohomail.com; s=zohoarc; b=QjBEeNgcUgE+Hp2fh4y3Zj7PnEJB9Kec6rtiRR9xwiZCL5Z9ad56ykZ34LswsS/3AV1ay8EAUMtf2JSRPRyWoDv/AGwRjDLhm/8Q0f9cgk3AKLhL1k8tochCyIKnRnd8hJozjxrsyQpLy4yYpPVcEk8m3e8eeAOTLLUzA4JRCmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619433; 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=r60QiDKcLeeE4IyhG27g+MzHZvqQ79nRx1Jd/ZaAbg8=; b=Xp42QOANW9tQtKnCA7oXqpJhHpAgP6EH/qrhBV04MSIseUOD/RzV3j72rQHMqaLyDTB34qxhinbU3K8IvFNu49pvE5mZRQ54uVKTgGp09qwD4/ID/tCMyVIa4hUxgfPiyZTgJh4MGdKpBGO92HRCPpJi8dUFfjGmLFERa0hJBEU= 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+90071+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165361943384288.37263580996682; Thu, 26 May 2022 19:43:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4KTsYY1788612xKzd2tNcHF0; Thu, 26 May 2022 19:43:53 -0700 X-Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by mx.groups.io with SMTP id smtpd.web10.3205.1653619431365736140 for ; Thu, 26 May 2022 19:43:52 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="202322444" X-Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1a-a31e1d63.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP; 27 May 2022 02:43:52 +0000 X-Received: from EX13MTAUWC001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-a31e1d63.us-east-1.amazon.com (Postfix) with ESMTPS id 738D79169D; Fri, 27 May 2022 02:43:50 +0000 (UTC) X-Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:49 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.161.125) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:47 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 09/12] Scripts: Add bootlog decyphering script Date: Fri, 27 May 2022 04:43:14 +0200 Message-ID: <20220527024317.13476-10-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.161.125] X-ClientProxiedBy: EX13D06UWC001.ant.amazon.com (10.43.162.91) 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: PLxbHa7EjzUZOF9tUt92IyJnx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619433; bh=3tvp6YbEKxMZh3AU+B0ud/C3BCPfSWw+kolAduAIxDw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=jN1ZRvWpEQgQEJsTYexZoZaVbI3uO32heV0jncHQcfTGFqGzb7Jkrq9u2BV3rk5k3xt CSHdJfoV4xqltS4srCqNZXDhHZxlKTfOEoH/C7kcs1dEr0YDSBc/d4442lge0T4RceiMm l/8aUdW3f1XCafQK5IVtLNtcImsAgfO/0X0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619434671100025 Content-Type: text/plain; charset="utf-8" The bootlog itself is a binary data structure that is not immediately human readable. This commit adds a python script to generate a human readable form of it with Linux dmesg like time stamp information. The script can take multiple log sources and collate them into a single output, making it easier to correlate messages. Signed-off-by: Alexander Graf --- BaseTools/Scripts/ShowDebugLog.py | 88 +++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100755 BaseTools/Scripts/ShowDebugLog.py diff --git a/BaseTools/Scripts/ShowDebugLog.py b/BaseTools/Scripts/ShowDebu= gLog.py new file mode 100755 index 0000000000..f99b4b02f7 --- /dev/null +++ b/BaseTools/Scripts/ShowDebugLog.py @@ -0,0 +1,88 @@ +#!/usr/bin/python3 +## @file +# Dump Bootlog files +# +# Copyright (c) 2022, Amazon Development Center Germany GmbH. All rights = reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +from __future__ import print_function + +VersionNumber =3D '0.1' +__copyright__ =3D "Copyright (c) 2022, Amazon Development Center Germany G= mbH. All rights reserved.." + +import argparse +import os +import sys +import struct + +class DebugLog: + """Parses a Bootlog blob and provides a string representation + """ + + def __init__(self, log): + self.entries =3D [] + off =3D 0 + + signature, self.producer, extraheadertype, extraheadersize, msgext= raheadersize, lastbyte, self.tickspersecond =3D struct.unpack_from('<4s4sHB= BLQ', log) + if signature !=3D b'BTLH': + raise Exception("File has incorrect signature. Expected b'BTLH= '. Found %s." % signature) + if len(log) < lastbyte: + raise Exception("File smaller than total log contents (%d < %d= ). It was probably truncated." % (len(log), lastbyte)) + off =3D 4 + 4 + 2 + 1 + 1 + 4 + 8 + extraheadersize + + while off < lastbyte: + off =3D off + msgextraheadersize + time, =3D struct.unpack_from(' X-Received: by 127.0.0.2 with SMTP id yxUUYY1788612xpUnX7PuCz5; Thu, 26 May 2022 19:44:20 -0700 X-Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by mx.groups.io with SMTP id smtpd.web08.3197.1653619443043458813 for ; Thu, 26 May 2022 19:44:03 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="92377821" X-Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1e-b69ea591.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 27 May 2022 02:44:03 +0000 X-Received: from EX13MTAUWC002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1e-b69ea591.us-east-1.amazon.com (Postfix) with ESMTPS id EFD6BC0999; Fri, 27 May 2022 02:44:01 +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:43:58 +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:43:56 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 10/12] BaseDebugLibSerialPort: Include BaseDebugBootlog in all dscs Date: Fri, 27 May 2022 04:43:15 +0200 Message-ID: <20220527024317.13476-11-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: NpaCzkfR4T1tq59XB9FKOudUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619460; bh=K2rHpty0KDkR+ICWZsSSjRY0oU7J23/6pH9VOSaumWA=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=VqgfyHJGZz+NWeuER/wlg5N+hm4DzvdZTFKaGckS+pPzP9MbcpgAlvvSOb/AA4wYblI 7OwcAw+53laRNiFt7Va+1u51crVGRDOOcUFWckLaOIr2tS9uBzBZDA8+xfRVFeLBQknoG skeRvtq48ucRkocOxjRkbEproqKWQjMqrV0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619462891100005 Content-Type: text/plain; charset="utf-8" In the next commit, we will make BaseDebugLibSerialPort call DebugBootlogLib to emit log lines. Make sure that every dsc that links against BaseDebugLibSerialPort also links against a DebugBootlogLib. Signed-off-by: Alexander Graf --- ArmVirtPkg/ArmVirt.dsc.inc | 5 +++++ EmulatorPkg/EmulatorPkg.dsc | 3 +++ IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc | 1 + OvmfPkg/AmdSev/AmdSevX64.dsc | 10 ++++++++++ OvmfPkg/Bhyve/BhyveX64.dsc | 10 ++++++++++ OvmfPkg/CloudHv/CloudHvX64.dsc | 10 ++++++++++ OvmfPkg/IntelTdx/IntelTdxX64.dsc | 8 ++++++++ OvmfPkg/Microvm/MicrovmX64.dsc | 10 ++++++++++ OvmfPkg/OvmfPkgIa32.dsc | 10 ++++++++++ OvmfPkg/OvmfPkgIa32X64.dsc | 10 ++++++++++ OvmfPkg/OvmfPkgX64.dsc | 7 +++++++ SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 1 + UefiPayloadPkg/UefiPayloadPkg.dsc | 1 + 13 files changed, 86 insertions(+) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index f15a3f7f06..c63c441ff4 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -40,6 +40,7 @@ DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf !endif DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf =20 BaseLib|MdePkg/Library/BaseLib/BaseLib.inf SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf @@ -184,6 +185,7 @@ ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf =20 [LibraryClasses.common.SEC] + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf =20 @@ -195,6 +197,7 @@ MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf =20 [LibraryClasses.common.PEI_CORE] + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf @@ -210,6 +213,7 @@ SerialPortLib|ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011Seri= alPortLib.inf =20 [LibraryClasses.common.PEIM] + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf @@ -247,6 +251,7 @@ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf =20 [LibraryClasses.common.DXE_RUNTIME_DRIVER] + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf !if $(TARGET) !=3D RELEASE diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index 4cf886b9ea..b898622625 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -147,6 +147,7 @@ SerialPortLib|EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLi= b.inf PpiListLib|EmulatorPkg/Library/SecPpiListLib/SecPpiListLib.inf DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf TimerLib|EmulatorPkg/Library/PeiTimerLib/PeiTimerLib.inf =20 [LibraryClasses.common.USER_DEFINED, LibraryClasses.common.BASE] @@ -337,6 +338,7 @@ MdeModulePkg/Core/Dxe/DxeMain.inf { DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPor= t.inf + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNull= Lib.inf SerialPortLib|EmulatorPkg/Library/DxeEmuStdErrSerialPortLib/DxeEmuSt= dErrSerialPortLib.inf DxeEmuLib|EmulatorPkg/Library/DxeEmuLib/DxeEmuLib.inf NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32Gu= idedSectionExtractLib.inf @@ -351,6 +353,7 @@ MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRun= timeDxe.inf { DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPor= t.inf + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNull= Lib.inf SerialPortLib|EmulatorPkg/Library/DxeEmuStdErrSerialPortLib/DxeEmuSt= dErrSerialPortLib.inf } =20 diff --git a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc b/IntelFsp2Pkg/Tools/T= ests/QemuFspPkg.dsc index 961576c9a7..db083f8dfb 100644 --- a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc +++ b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc @@ -110,6 +110,7 @@ UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf !if $(TARGET) =3D=3D DEBUG DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPort= Lib16550.inf !else DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index bead9722ea..7bf37460e5 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -221,6 +221,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -252,6 +253,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf =20 [LibraryClasses.common.PEIM] @@ -268,6 +270,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf ResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResou= rcePublicationLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -296,6 +299,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf @@ -316,6 +320,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -335,6 +340,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 @@ -351,6 +357,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLibGrub/Platfo= rmBootManagerLibGrub.inf PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrin= tScLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf @@ -378,6 +385,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] @@ -395,6 +403,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf @@ -417,6 +426,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index f0166e136c..0cf9e3a3ef 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -238,6 +238,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -264,6 +265,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf =20 [LibraryClasses.common.PEIM] @@ -280,6 +282,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf ResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResou= rcePublicationLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -301,6 +304,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf @@ -319,6 +323,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -335,6 +340,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 @@ -349,6 +355,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLibBhyve/Platf= ormBootManagerLibBhyve.inf PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrin= tScLib.inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf @@ -370,6 +377,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] @@ -385,6 +393,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf @@ -405,6 +414,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc index 92664f319b..75b3d06dab 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -249,6 +249,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -280,6 +281,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf =20 [LibraryClasses.common.PEIM] @@ -296,6 +298,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf ResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResou= rcePublicationLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -323,6 +326,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf @@ -343,6 +347,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -364,6 +369,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 @@ -380,6 +386,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrin= tScLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf @@ -411,6 +418,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] @@ -428,6 +436,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf @@ -451,6 +460,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index 00bc1255bc..74e2c07da1 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -216,6 +216,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf @@ -242,6 +243,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -259,6 +261,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -278,6 +281,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 @@ -294,6 +298,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrin= tScLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf @@ -316,6 +321,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] @@ -333,6 +339,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -352,6 +359,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index f8fc977cb2..52a94a1058 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -244,6 +244,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -275,6 +276,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf =20 [LibraryClasses.common.PEIM] @@ -291,6 +293,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf ResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResou= rcePublicationLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -316,6 +319,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf @@ -335,6 +339,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -353,6 +358,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 @@ -368,6 +374,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrin= tScLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf @@ -392,6 +399,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] @@ -408,6 +416,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf @@ -429,6 +438,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index c16a840fff..b16102e53f 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -246,6 +246,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -276,6 +277,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf =20 [LibraryClasses.common.PEIM] @@ -292,6 +294,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf ResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResou= rcePublicationLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -319,6 +322,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf @@ -339,6 +343,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -361,6 +366,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 @@ -377,6 +383,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrin= tScLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf @@ -408,6 +415,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] @@ -425,6 +433,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf @@ -448,6 +457,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index d3a80cb568..2e9f837ba0 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -252,6 +252,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -282,6 +283,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf =20 [LibraryClasses.common.PEIM] @@ -298,6 +300,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf ResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResou= rcePublicationLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -325,6 +328,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf @@ -345,6 +349,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -367,6 +372,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 @@ -383,6 +389,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrin= tScLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf @@ -414,6 +421,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] @@ -431,6 +439,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf @@ -454,6 +463,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index c01355e5c7..563051f0c8 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -257,6 +257,7 @@ VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLib.inf =20 [LibraryClasses.common.SEC] TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf @@ -266,6 +267,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -297,6 +299,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf =20 [LibraryClasses.common.PEIM] @@ -313,6 +316,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogLibPei.i= nf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf ResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResou= rcePublicationLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -360,6 +364,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -446,6 +451,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf @@ -469,6 +475,7 @@ !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### diff --git a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc b/SourceLevelDebug= Pkg/SourceLevelDebugPkg.dsc index eba64a7b78..2b0ea301a1 100644 --- a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc +++ b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc @@ -27,6 +27,7 @@ =20 [LibraryClasses.common] DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index 4d9bbc80c8..311ad2d58d 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -281,6 +281,7 @@ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull= .inf DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + DebugBootlogLib|MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.= inf =20 [LibraryClasses.common.DXE_CORE] DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull= .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 (#90076): https://edk2.groups.io/g/devel/message/90076 Mute This Topic: https://groups.io/mt/91368918/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- From nobody Sat May 18 23:44:04 2024 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+90075+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+90075+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619443; cv=none; d=zohomail.com; s=zohoarc; b=RQrXUY5Dl8ppoc9dSAnUAyru3cTu7KeM8E43cHaIVTknmNB7hHCOpoSBp/Ioc0eXCLighlaWesaL2IHSW5x6C44Nc8QJ6G6IApWx3yIWqMvDwDAIOfMqbsUvIE0J8bgLaQxhYi++44KUDg5/lA3a23/gzGmTjh//DHz5BanYzn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619443; 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=VLltoSEa15iH2WUEY9+Afh0LTIlzoHcLMbEeLb0aJ8E=; b=J1krwOZlxbEaCtOs8mVwapslfqOUhe87pTDf0H5OjZCcxVqQ2T7DQimJliSWe+PYzjowsEEw6657NrNlJURdVEk4xVjGwnDrK+GM6N6wBmkQ1QbEwSH9X6m4ThvQcPdnIGjOkGrBlmyLosCSAlkVRRRvqHGHzOGdOw3NUU86h70= 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+90075+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165361944396637.73706302342043; Thu, 26 May 2022 19:44:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vcQ7YY1788612xFmVgpusUQ5; Thu, 26 May 2022 19:44:03 -0700 X-Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by mx.groups.io with SMTP id smtpd.web08.3197.1653619443043458813 for ; Thu, 26 May 2022 19:44:03 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="92377818" X-Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1e-b69ea591.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 27 May 2022 02:44:02 +0000 X-Received: from EX13MTAUWC001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1e-b69ea591.us-east-1.amazon.com (Postfix) with ESMTPS id 8000FC098D; Fri, 27 May 2022 02:44:01 +0000 (UTC) X-Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:44:00 +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:43:58 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 11/12] BaseDebugLibSerialPort: Emit messages to boot log Date: Fri, 27 May 2022 04:43:16 +0200 Message-ID: <20220527024317.13476-12-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: 2zEZ6AK8ANtq6pFE504NPuphx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619443; bh=qL8OlYRBV48M0loaYD1uDYduR1IOfoTFyUkD0YGyadw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=D/LNytnZcL3dRLjda8kkQPKzkuPpGHnELfOYOdNEnQXEfA16UomYOlppZfY3GJdEvuQ Hk4Gkfvd3aN9atEUV43W8qci4dmnmmzVkxbSzRynQjRrn1wdrOpd06gJICm8Cw6ol8iUi C9htwuEPb80uvlmNQbrIUkuAqoIHd+M+QnA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619444662100007 Content-Type: text/plain; charset="utf-8" Now that we have the bootlog infrastructure in place and link against it with all in tree consumers of BaseDebugLibSerialPort, let's emit log lines to the bootlog in addition to serial. The existing PcdDebugBootlogErrorLevel still defines which messages end up on serial. However, in addition the new PcdDebugBootlogErrorLevel defines which ones go into the bootlog. The latter may be more verbose. Signed-off-by: Alexander Graf --- .../BaseDebugLibSerialPort.inf | 1 + .../Library/BaseDebugLibSerialPort/DebugLib.c | 22 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.i= nf b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf index 7504faee67..dd22fbeb4a 100644 --- a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf +++ b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf @@ -36,6 +36,7 @@ PrintLib BaseLib DebugPrintErrorLevelLib + DebugBootlogLib =20 [Pcd] gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c b/MdePkg/Libr= ary/BaseDebugLibSerialPort/DebugLib.c index bd56869477..ea2611228d 100644 --- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c +++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c @@ -20,6 +20,7 @@ #include #include #include +#include =20 // // Define the maximum debug and assert message length that this library su= pports @@ -103,16 +104,20 @@ DebugPrintMarker ( ) { CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH]; + UINT32 DebugPrintLevel, DebugBootlogLevel, Length; =20 // // If Format is NULL, then ASSERT(). // ASSERT (Format !=3D NULL); =20 + DebugPrintLevel =3D GetDebugPrintErrorLevel (); + DebugBootlogLevel =3D GetDebugBootlogErrorLevel (); + // // Check driver debug mask value and global mask // - if ((ErrorLevel & GetDebugPrintErrorLevel ()) =3D=3D 0) { + if ((ErrorLevel & (DebugPrintLevel | DebugBootlogLevel)) =3D=3D 0) { return; } =20 @@ -120,15 +125,24 @@ DebugPrintMarker ( // Convert the DEBUG() message to an ASCII String // if (BaseListMarker =3D=3D NULL) { - AsciiVSPrint (Buffer, sizeof (Buffer), Format, VaListMarker); + Length =3D AsciiVSPrint (Buffer, sizeof (Buffer), Format, VaListMarker= ); } else { - AsciiBSPrint (Buffer, sizeof (Buffer), Format, BaseListMarker); + Length =3D AsciiBSPrint (Buffer, sizeof (Buffer), Format, BaseListMark= er); } =20 // // Send the print string to a Serial Port // - SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); + if (ErrorLevel & DebugPrintLevel) { + SerialPortWrite ((UINT8 *)Buffer, Length); + } + + // + // Append the print string to the Boot Log + // + if (ErrorLevel & DebugBootlogLevel) { + DebugBootlogAppend (Buffer, Length, ErrorLevel); + } } =20 /** --=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 (#90075): https://edk2.groups.io/g/devel/message/90075 Mute This Topic: https://groups.io/mt/91368917/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- From nobody Sat May 18 23:44:04 2024 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-