From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id BACBAD802B4 for ; Fri, 5 Jan 2024 19:20:28 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7Du/cQPLlv+zaOGBI9kPdL4P7GIfCtvN+qMe+F/1tbE=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1704482427; v=1; b=s7in2knYldCq+d0l7XkMmvgQy369szNXCNOEK7UhsDsETF8wbB65L0T5u5y9eTgWHTKBk7Di bMGW6elwahMlapb+LXYshPpN6oX9d/njWQ6kxWyuX73XfOktK7cLHW66jLslRdeiAZT5ZvtxhqP ZW4V4qnYz49Lr4zV7GqaPCRQ= X-Received: by 127.0.0.2 with SMTP id IVmyYY7687511xoALMil4FNZ; Fri, 05 Jan 2024 11:20:27 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.32262.1704482425725718902 for ; Fri, 05 Jan 2024 11:20:26 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="428747529" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208";a="428747529" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 11:20:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="871301649" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208";a="871301649" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by FMSMGA003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 11:20:09 -0800 X-Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 11:20:08 -0800 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 11:20:08 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 11:20:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=euNOoZGFLwYjW2w/SjWyCGrC9hn3OwSBzdLvMJrjTyYGqZaZWnobBaPo8GWQ6+ga9HFJi8S9Hqfp+0xfHbiCGtq1b/lo9ApqRoorf4qPz7PgXOWFcscuCvkfuUdpYABpj33BZFNYMfJZ56QGzyn0bnjK9kKxCAe9BAk5i6i+Pi6F7VEafm0qIuJZUDKjud8HBEuWoV3VZsiQnYXEySfWC58kPc0tkOzXDygemuHsPwzmACJX93ZwW5xn7C1Hoky9ZYLKYen1XhmQy1yAVdU7rOVnvQvA0h6KDlbnkHC1dxcev5ikvKMmA8xXu5PzpyHSdUion5ZfVax0jHC9533OsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=px7CC8i1hwgIakrFH1+W9Bp+akn9pyaBFLzqGMMKjdA=; b=edWwGQpDhZ4oHr/lZJoneutHYrHD1AiuAbJK0K8Zb84O7wum/ZORIooaiNeeQ5JN+W+q1i3pDDy3+a257u1V3Y4JLrw8Hry0ieaZR+sYK82Po8nWl6cSyHwUJ/lO5rV066d5pwVvJJhlL2ozXn2E1uAZujOFxwMIjF7zKdwMIhtPBnYvBgisG7+kFmuBBguL/QdLIz2oBXnb+1PA+qloZ+c+3JrnEtbFobt7oOs6ZAhAnO9ntLqHZEJDk5i7GQPUh56T45VirKSej1uU/v207JRNfwfX7V+DRVP02xfeIRbZddjUVtUV6hqcEhFXaCxyWF2jn4cUDoXGmltS3T7WWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by BN9PR11MB5321.namprd11.prod.outlook.com (2603:10b6:408:136::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.17; Fri, 5 Jan 2024 19:20:05 +0000 X-Received: from MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::7d4f:b2b0:e284:aeff]) by MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::7d4f:b2b0:e284:aeff%4]) with mapi id 15.20.7159.013; Fri, 5 Jan 2024 19:20:05 +0000 From: "Nate DeSimone" To: "Huang, Li-Xia" , "devel@edk2.groups.io" CC: "Dong, Eric" Subject: Re: [edk2-devel] [PATCH v1 1/1] BoardModulePkg\Library\BiosIdLib: Support Standalone MM Thread-Topic: [PATCH v1 1/1] BoardModulePkg\Library\BiosIdLib: Support Standalone MM Thread-Index: AQHaN9D4TA0r9+1NTUiw89lSkVC1EbDLp9YA Date: Fri, 5 Jan 2024 19:20:05 +0000 Message-ID: References: <20231226075555.3947-1-lisa.huang@intel.com> In-Reply-To: <20231226075555.3947-1-lisa.huang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5821:EE_|BN9PR11MB5321:EE_ x-ms-office365-filtering-correlation-id: 0132d490-917e-47c7-a14f-08dc0e235282 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: D+CZXOW63UuoRAMxnCxcs4CCs9qIHnfSD94NyADf+mcsTJqZEv0SX+n7CL/gWl5LwfUue4D5xS3MjRKkcnc2Oy5oF9CVlcS2tefMakA8aAd+1/HPNY8zXbhfz4n4c/QFvlrZJkRNmn30lXzMgBOXVIlGsmaSF11lZAo4E/xQ9jeOdsXBNqljePyzsCaZm9rdyKs2Xw2N/15s6/2HCJqdSBPEtlA9bsYTZlRJYWhYhdnLUe+ImjXOJfU//CdjXgeki5t3TDq0tSJYlJYdhq2mXUo90XArboHMIw2EHOqrac7gVEygkrl1j34kuOLq2Ehac1UXKpXwMgeCpBQIMiTua1TD00ctvNNEtZTTQMKQWAD4E7BkJqxYYENHjIrta7A5rcheQNxhGYuydnCSGrvEJ1POUWTwzsKtBqwCjfJb2+oH/FpKHZNeICdEDBMZkTxLrXouS0GQkOcBpCmIKC/Yqnyva5pUTHKgMxmD3dXKCHE3XpYDSwpJhkvl8z4jrDlontCqzNYf6qZbC02ImTcIzxPBjBW8IY7SAQaT+eog7nKqImZ+QRXmmGHUHIY0piaC6U/JMYx4KP+QWCJaFz230PEsn5/ZI1Fyq87f6uMSMXgGCfuQIfqcN2F/MQyF9Vvn x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vLAcYV72QQiH/65SzRXLKHu3+6NNCzz+a40VH8d3XEHsS51+7N/F2EbvjxS+?= =?us-ascii?Q?lJVsxXgd4XIxpfZQ4d1LbXWi5TsB9+QhcDW7LvYMbiCmkpxMe84/2eLmOCiU?= =?us-ascii?Q?odbyzfTmb0tltAbTUE0C7eDinfeUpL85HjKUtaIPTCajBP3/O+X2JClMtQ70?= =?us-ascii?Q?k9KuW1py4DKBJtKOCVzosFYNMlx7mzf6Aqh5b0UP1Z+N9atGYgvO1lWoKWJi?= =?us-ascii?Q?IWn8Y1XOB8x9T7//9CCMhc0GUMCt/XapV4s8QXdj+H/MwULTIbsyLhZpK2gp?= =?us-ascii?Q?ErYs+qG9rfnXiMbBfqySIACON94CbednBWvY8UpoXDtkRfKzeQ6dSocbYsVD?= =?us-ascii?Q?QXpnLBIB6AYptRjTBuLFnvTyXeG5VRXeEOAfyb22Ia0nHkEePzzsRoFY9MOB?= =?us-ascii?Q?l7SDw4Phb47XjrEgVB0/dWBLdXoAJPjLmY/eC/bggtThiz3Q8zlOkjqudU/I?= =?us-ascii?Q?kl8rIBA/yK39cG8JYQ0GDP5oSkvHIMAxgNPRMbfX2v5LALAcqUS0W+yTtJcf?= =?us-ascii?Q?lGBBPvqRgMfqLRfWwYwmK8vvwK3eTMyj7ze0NXuqEUZ0wnj9nAO32tB30Oij?= =?us-ascii?Q?crwCh3gpJSzHZS6tlcQHDNixCSLsnnYY5IJD8QgWGwOqEkVYiOZ1YRWXnj/j?= =?us-ascii?Q?UIN++5UTgqyV8IJ71auhH3Yk310YBhjMjYbW8/UYSLRely57Ej5baJIdTMli?= =?us-ascii?Q?uBzjeZ2hdVzsAslBVs94otENVrZOPDvAIt0iOh58kZqQl9e1Jb7lOcrVcLcp?= =?us-ascii?Q?adXyM3xaMcAEKCJqxgL5XGisIBci6WuoeJ4+G2hMnW9Y8ajUpDqbVRgFnpLQ?= =?us-ascii?Q?UoaudWdNtAsBoxJ+j4ourZSTTHWweoEWa4GyAqL1+8fPOJoQSTK+cyvPgtmh?= =?us-ascii?Q?saFhfrOQK24XtXy4jF3SI3KWf+LkAktVtPxGSULgoSsDmubViPvkiDc04Bdf?= =?us-ascii?Q?aSg6FpHHCowWHyAH+5tc2ZAd+03xno6OoXaFCskhGhlvPnZmsTNAdJl/gXTx?= =?us-ascii?Q?uqapf5J6velH6/v96Rf5FhClXv8iEWf3hc3UfSW5bnGjlesZswPEDuH4Wl7H?= =?us-ascii?Q?zZjz85yFdzO9rJOw8XTRduJbuKUwfvwg7dT4PlDxTu3797MYkqlUxAJeKYI0?= =?us-ascii?Q?02R53j+LJg3Wn41CMD9jfDsCBNFlsXGyJLYffYbD/0BsLVH8NWu+4dVi8j5g?= =?us-ascii?Q?bvNIEu5Iiin3lCD5JuGezbdRKNYUYCJOJIq+t53BYZfnqumWvnofxqWJK/rs?= =?us-ascii?Q?ZE5ROvgHAzK5ovbcghSVL3rPQMAaovgOuzpzFdtBAo4UOWgzvW+UsTx8P7EG?= =?us-ascii?Q?AbSEbElLgVNVgJZnOkt+yr2fRzibYdZgMCQMvJpMS3l2MIevSwMr5VUgA+Yj?= =?us-ascii?Q?yvkKraqUFhkjgrsEuI/EosazHGbo07ODFR32gft0H9EwYW8CdIV9FwLZWj7k?= =?us-ascii?Q?jG92r4m1c4WNUMhRAIj78UIYNFuJHlPvTHMX+aWIc10JrhFZFevtqs7f5ywp?= =?us-ascii?Q?cstzEbkBzhVI9AYx8GC6yXxigdAgZ0HmC9WBUSgoUL2tduo5X678pBLdsXz1?= =?us-ascii?Q?e6+2o7UVsZo8QIRWTyAY1sWzIUF5xOhPGzWZn+9g6XjRAZ3RD6rOAoYpWIN+?= =?us-ascii?Q?oQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0132d490-917e-47c7-a14f-08dc0e235282 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2024 19:20:05.0299 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: stvIAkr56D1RnktQ85KMQ3XiSrqhYDFn+E2HdjND8MlhUMv6ig0rHdl8x1v4TbhxmmkBjTP0IE58U4ATYb6HYwos9FaYnBq/BOPcDme1Jf0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5321 X-OriginatorOrg: intel.com Precedence: Bulk 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,nathaniel.l.desimone@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: MSyDvaabqCKKktYWFXPNWsSfx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=s7in2knY; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Hi Li, It looks like the standalone MM version of this library is missing the sear= ch for the BiosId file. I suspect the issue you ran into is that standalone= MM only has support for 1 FV, and it is highly likely that the BiosId file= is not in the standalone MM FV. This is understandable; however, it does h= ighlight yet another deficiency in the architecture of standalone MM. Again= , that is not your fault and is beyond the scope of this patch. Reviewed-by: Nate DeSimone > -----Original Message----- > From: Huang, Li-Xia > Sent: Monday, December 25, 2023 11:56 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Desimone, Nathaniel L > > Subject: [PATCH v1 1/1] BoardModulePkg\Library\BiosIdLib: Support > Standalone MM >=20 > Add Standalone Mm BiosIdLib and format code with Uncrustify. >=20 > Cc: Eric Dong > Cc: Nate DeSimone >=20 > Signed-off-by: Lixia Huang > --- > Platform/Intel/BoardModulePkg/Library/BiosIdLib/BiosIdCommon.c = | > 96 ++++++++++++++++ > Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c = | 111 > +++--------------- > Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c = | 118 > +++----------------- > Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib.c > | 65 +++++++++++ > Platform/Intel/BoardModulePkg/BoardModulePkg.dsc = | 1 + > Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf = | 1 > + > Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf = | 6 > +- >=20 > Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib.i > nf | 42 +++++++ > 8 files changed, 241 insertions(+), 199 deletions(-) >=20 > diff --git > a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/BiosIdCommon.c > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/BiosIdCommon.c > new file mode 100644 > index 000000000000..5735566bfe3a > --- /dev/null > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/BiosIdCommon.c > @@ -0,0 +1,96 @@ > +/** @file > + Boot service common BIOS ID library implementation. > + > + These functions in this file can be called during DXE and cannot be > + called during runtime or in SMM which should use a RT or SMM library. > + > + > +Copyright (c) 2023, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > + > +/** > + This function returns the BIOS Version & Release Date and Time by gett= ing > and converting BIOS ID. > + > + @param[out] BiosVersion The Bios Version out of the conversion. > + @param[out] BiosReleaseDate The Bios Release Date out of the > conversion. > + @param[out] BiosReleaseTime The Bios Release Time out of the > conversion. > + > + @retval EFI_SUCCESS BIOS Version & Release Date and Time= have > been got successfully. > + @retval EFI_NOT_FOUND BIOS ID image is not found, and no > parameter will be modified. > + @retval EFI_INVALID_PARAMETER All the parameters are NULL. > + > +**/ > +EFI_STATUS > +EFIAPI > +GetBiosVersionDateTime ( > + OUT CHAR16 *BiosVersion OPTIONAL, > + OUT CHAR16 *BiosReleaseDate OPTIONAL, > + OUT CHAR16 *BiosReleaseTime OPTIONAL > + ) > +{ > + EFI_STATUS Status; > + BIOS_ID_IMAGE BiosIdImage; > + > + if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && > (BiosReleaseTime =3D=3D NULL)) { > + return EFI_INVALID_PARAMETER; > + } > + > + Status =3D GetBiosId (&BiosIdImage); > + if (EFI_ERROR (Status)) { > + return EFI_NOT_FOUND; > + } > + > + if (BiosVersion !=3D NULL) { > + // > + // Fill the BiosVersion data from the BIOS ID. > + // > + CopyMem (BiosVersion, &(BiosIdImage.BiosIdString), sizeof > + (BIOS_ID_STRING)); } > + > + if (BiosReleaseDate !=3D NULL) { > + // > + // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" > format. > + // > + BiosReleaseDate[0] =3D BiosIdImage.BiosIdString.TimeStamp[2]; > + BiosReleaseDate[1] =3D BiosIdImage.BiosIdString.TimeStamp[3]; > + BiosReleaseDate[2] =3D (CHAR16)((UINT8)('/')); > + > + BiosReleaseDate[3] =3D BiosIdImage.BiosIdString.TimeStamp[4]; > + BiosReleaseDate[4] =3D BiosIdImage.BiosIdString.TimeStamp[5]; > + BiosReleaseDate[5] =3D (CHAR16)((UINT8)('/')); > + > + // > + // Add 20 for SMBIOS table > + // Current Linux kernel will misjudge 09 as year 0, so using 2009 fo= r > SMBIOS table > + // > + BiosReleaseDate[6] =3D '2'; > + BiosReleaseDate[7] =3D '0'; > + BiosReleaseDate[8] =3D BiosIdImage.BiosIdString.TimeStamp[0]; > + BiosReleaseDate[9] =3D BiosIdImage.BiosIdString.TimeStamp[1]; > + > + BiosReleaseDate[10] =3D (CHAR16)((UINT8)('\0')); } > + > + if (BiosReleaseTime !=3D NULL) { > + // > + // Fill the build timestamp time from the BIOS ID in the "HH:MM" for= mat. > + // > + BiosReleaseTime[0] =3D BiosIdImage.BiosIdString.TimeStamp[6]; > + BiosReleaseTime[1] =3D BiosIdImage.BiosIdString.TimeStamp[7]; > + BiosReleaseTime[2] =3D (CHAR16)((UINT8)(':')); > + > + BiosReleaseTime[3] =3D BiosIdImage.BiosIdString.TimeStamp[8]; > + BiosReleaseTime[4] =3D BiosIdImage.BiosIdString.TimeStamp[9]; > + > + BiosReleaseTime[5] =3D (CHAR16)((UINT8)('\0')); } > + > + return EFI_SUCCESS; > +} > diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib= .c > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c > index 3e614d9efc3e..6535bb36f6c9 100644 > --- a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c > @@ -5,7 +5,7 @@ > or in SMM which should use a RT or SMM library. >=20 >=20 > -Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2023, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -15,7 +15,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include > #include #include > -#include #include > #include #include > @@ -36,16 +35,16 @@ SPDX-License-Identifier: BSD-2- > Clause-Patent EFI_STATUS EFIAPI GetBiosId ( > - OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > ) > { > - EFI_STATUS Status; > - BIOS_ID_IMAGE TempBiosIdImage; > - VOID *Address; > - UINTN Size; > + EFI_STATUS Status; > + BIOS_ID_IMAGE TempBiosIdImage; > + VOID *Address; > + UINTN Size; >=20 > Address =3D NULL; > - Size =3D 0; > + Size =3D 0; >=20 > if (BiosIdImage =3D=3D NULL) { > // > @@ -58,10 +57,10 @@ GetBiosId ( > Address =3D GetFirstGuidHob (&gBiosIdGuid); > if (Address !=3D NULL) { > Size =3D sizeof (BIOS_ID_IMAGE); > - CopyMem ((VOID *) BiosIdImage, GET_GUID_HOB_DATA (Address), Size); > + CopyMem ((VOID *)BiosIdImage, GET_GUID_HOB_DATA (Address), Size); >=20 > - DEBUG ((EFI_D_INFO, "DXE get BIOS ID from HOB successfully\n")); > - DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage- > >BiosIdString)))); > + DEBUG ((DEBUG_INFO, "DXE get BIOS ID from HOB successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 > + *)(&(BiosIdImage->BiosIdString)))); > return EFI_SUCCESS; > } >=20 > @@ -77,99 +76,17 @@ GetBiosId ( > // BIOS ID image is present in FV. > // > Size =3D sizeof (BIOS_ID_IMAGE); > - CopyMem ((VOID *) BiosIdImage, Address, Size); > + CopyMem ((VOID *)BiosIdImage, Address, Size); > // > // GetSectionFromAnyFv () allocated buffer for Address, now free it. > // > FreePool (Address); >=20 > - DEBUG ((EFI_D_INFO, "DXE get BIOS ID from FV successfully\n")); > - DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage- > >BiosIdString)))); > + DEBUG ((DEBUG_INFO, "DXE get BIOS ID from FV successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 > + *)(&(BiosIdImage->BiosIdString)))); > return EFI_SUCCESS; > } >=20 > - DEBUG ((EFI_D_ERROR, "DXE get BIOS ID failed: %r\n", EFI_NOT_FOUND)); > + DEBUG ((DEBUG_ERROR, "DXE get BIOS ID failed: %r\n", > EFI_NOT_FOUND)); > return EFI_NOT_FOUND; > } > - > -/** > - This function returns the BIOS Version & Release Date and Time by gett= ing > and converting BIOS ID. > - > - @param[out] BiosVersion The Bios Version out of the conversion. > - @param[out] BiosReleaseDate The Bios Release Date out of the convers= ion. > - @param[out] BiosReleaseTime The Bios Release Time out of the > conversion. > - > - @retval EFI_SUCCESS BIOS Version & Release Date and Time= have > been got successfully. > - @retval EFI_NOT_FOUND BIOS ID image is not found, and no > parameter will be modified. > - @retval EFI_INVALID_PARAMETER All the parameters are NULL. > - > -**/ > -EFI_STATUS > -EFIAPI > -GetBiosVersionDateTime ( > - OUT CHAR16 *BiosVersion, OPTIONAL > - OUT CHAR16 *BiosReleaseDate, OPTIONAL > - OUT CHAR16 *BiosReleaseTime OPTIONAL > - ) > -{ > - EFI_STATUS Status; > - BIOS_ID_IMAGE BiosIdImage; > - > - if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && > (BiosReleaseTime =3D=3D NULL)) { > - return EFI_INVALID_PARAMETER; > - } > - > - Status =3D GetBiosId (&BiosIdImage); > - if (EFI_ERROR (Status)) { > - return EFI_NOT_FOUND; > - } > - > - if (BiosVersion !=3D NULL) { > - // > - // Fill the BiosVersion data from the BIOS ID. > - // > - CopyMem (BiosVersion, &(BiosIdImage.BiosIdString), sizeof > (BIOS_ID_STRING)); > - } > - > - if (BiosReleaseDate !=3D NULL) { > - // > - // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" > format. > - // > - BiosReleaseDate[0] =3D BiosIdImage.BiosIdString.TimeStamp[2]; > - BiosReleaseDate[1] =3D BiosIdImage.BiosIdString.TimeStamp[3]; > - BiosReleaseDate[2] =3D (CHAR16) ((UINT8) ('/')); > - > - BiosReleaseDate[3] =3D BiosIdImage.BiosIdString.TimeStamp[4]; > - BiosReleaseDate[4] =3D BiosIdImage.BiosIdString.TimeStamp[5]; > - BiosReleaseDate[5] =3D (CHAR16) ((UINT8) ('/')); > - > - // > - // Add 20 for SMBIOS table > - // Current Linux kernel will misjudge 09 as year 0, so using 2009 fo= r SMBIOS > table > - // > - BiosReleaseDate[6] =3D '2'; > - BiosReleaseDate[7] =3D '0'; > - BiosReleaseDate[8] =3D BiosIdImage.BiosIdString.TimeStamp[0]; > - BiosReleaseDate[9] =3D BiosIdImage.BiosIdString.TimeStamp[1]; > - > - BiosReleaseDate[10] =3D (CHAR16) ((UINT8) ('\0')); > - } > - > - if (BiosReleaseTime !=3D NULL) { > - > - // > - // Fill the build timestamp time from the BIOS ID in the "HH:MM" for= mat. > - // > - BiosReleaseTime[0] =3D BiosIdImage.BiosIdString.TimeStamp[6]; > - BiosReleaseTime[1] =3D BiosIdImage.BiosIdString.TimeStamp[7]; > - BiosReleaseTime[2] =3D (CHAR16) ((UINT8) (':')); > - > - BiosReleaseTime[3] =3D BiosIdImage.BiosIdString.TimeStamp[8]; > - BiosReleaseTime[4] =3D BiosIdImage.BiosIdString.TimeStamp[9]; > - > - BiosReleaseTime[5] =3D (CHAR16) ((UINT8) ('\0')); > - } > - > - return EFI_SUCCESS; > -} > - > diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib= .c > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c > index b0f15d2cb8d5..c1295a16444d 100644 > --- a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c > @@ -1,7 +1,7 @@ > /** @file > Boot service PEI BIOS ID library implementation. >=20 > -Copyright (c) 2-015 - 2019, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2023, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -30,19 +30,19 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > EFI_STATUS EFIAPI GetBiosId ( > - OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > ) > { > - EFI_STATUS Status; > - BIOS_ID_IMAGE TempBiosIdImage; > - VOID *Address; > - UINTN Size; > - UINTN Instance; > - EFI_PEI_FV_HANDLE VolumeHandle; > - EFI_PEI_FILE_HANDLE FileHandle; > + EFI_STATUS Status; > + BIOS_ID_IMAGE TempBiosIdImage; > + VOID *Address; > + UINTN Size; > + UINTN Instance; > + EFI_PEI_FV_HANDLE VolumeHandle; > + EFI_PEI_FILE_HANDLE FileHandle; >=20 > Address =3D NULL; > - Size =3D 0; > + Size =3D 0; >=20 > if (BiosIdImage =3D=3D NULL) { > // > @@ -55,15 +55,15 @@ GetBiosId ( > Address =3D GetFirstGuidHob (&gBiosIdGuid); > if (Address !=3D NULL) { > Size =3D sizeof (BIOS_ID_IMAGE); > - CopyMem ((VOID *) BiosIdImage, GET_GUID_HOB_DATA (Address), Size); > + CopyMem ((VOID *)BiosIdImage, GET_GUID_HOB_DATA (Address), Size); >=20 > - DEBUG ((EFI_D_INFO, "PEI get BIOS ID from HOB successfully\n")); > - DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage- > >BiosIdString)))); > + DEBUG ((DEBUG_INFO, "PEI get BIOS ID from HOB successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 > + *)(&(BiosIdImage->BiosIdString)))); > return EFI_SUCCESS; > } >=20 > VolumeHandle =3D NULL; > - Instance =3D 0; > + Instance =3D 0; > while (TRUE) { > // > // Traverse all firmware volume instances. > @@ -74,7 +74,7 @@ GetBiosId ( > } >=20 > FileHandle =3D NULL; > - Status =3D PeiServicesFfsFindFileByName (&gBiosIdGuid, VolumeHandle, > &FileHandle); > + Status =3D PeiServicesFfsFindFileByName (&gBiosIdGuid, VolumeHan= dle, > &FileHandle); > if (!EFI_ERROR (Status)) { > // > // Search RAW section. > @@ -85,10 +85,10 @@ GetBiosId ( > // BIOS ID image is present in this FV. > // > Size =3D sizeof (BIOS_ID_IMAGE); > - CopyMem ((VOID *) BiosIdImage, Address, Size); > + CopyMem ((VOID *)BiosIdImage, Address, Size); >=20 > - DEBUG ((EFI_D_INFO, "PEI get BIOS ID from FV successfully\n")); > - DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage- > >BiosIdString)))); > + DEBUG ((DEBUG_INFO, "PEI get BIOS ID from FV successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 > + *)(&(BiosIdImage->BiosIdString)))); >=20 > // > // Build GUID HOB for the BIOS ID image. > @@ -107,85 +107,3 @@ GetBiosId ( > DEBUG ((EFI_D_ERROR, "PEI get BIOS ID failed: %r\n", EFI_NOT_FOUND)); > return EFI_NOT_FOUND; > } > - > -/** > - This function returns the BIOS Version & Release Date and Time by gett= ing > and converting BIOS ID. > - > - @param[out] BiosVersion The Bios Version out of the conversion. > - @param[out] BiosReleaseDate The Bios Release Date out of the convers= ion. > - @param[out] BiosReleaseTime The Bios Release Time out of the > conversion. > - > - @retval EFI_SUCCESS BIOS Version & Release Date and Time= have > been got successfully. > - @retval EFI_NOT_FOUND BIOS ID image is not found, and no > parameter will be modified. > - @retval EFI_INVALID_PARAMETER All the parameters are NULL. > - > -**/ > -EFI_STATUS > -EFIAPI > -GetBiosVersionDateTime ( > - OUT CHAR16 *BiosVersion, OPTIONAL > - OUT CHAR16 *BiosReleaseDate, OPTIONAL > - OUT CHAR16 *BiosReleaseTime OPTIONAL > - ) > -{ > - EFI_STATUS Status; > - BIOS_ID_IMAGE BiosIdImage; > - > - if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && > (BiosReleaseTime =3D=3D NULL)) { > - return EFI_INVALID_PARAMETER; > - } > - > - Status =3D GetBiosId (&BiosIdImage); > - if (EFI_ERROR (Status)) { > - return EFI_NOT_FOUND; > - } > - > - if (BiosVersion !=3D NULL) { > - // > - // Fill the BiosVersion data from the BIOS ID. > - // > - CopyMem (BiosVersion, &(BiosIdImage.BiosIdString), sizeof > (BIOS_ID_STRING)); > - } > - > - if (BiosReleaseDate !=3D NULL) { > - // > - // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" > format. > - // > - BiosReleaseDate[0] =3D BiosIdImage.BiosIdString.TimeStamp[2]; > - BiosReleaseDate[1] =3D BiosIdImage.BiosIdString.TimeStamp[3]; > - BiosReleaseDate[2] =3D (CHAR16) ((UINT8) ('/')); > - > - BiosReleaseDate[3] =3D BiosIdImage.BiosIdString.TimeStamp[4]; > - BiosReleaseDate[4] =3D BiosIdImage.BiosIdString.TimeStamp[5]; > - BiosReleaseDate[5] =3D (CHAR16) ((UINT8) ('/')); > - > - // > - // Add 20 for SMBIOS table > - // Current Linux kernel will misjudge 09 as year 0, so using 2009 fo= r SMBIOS > table > - // > - BiosReleaseDate[6] =3D '2'; > - BiosReleaseDate[7] =3D '0'; > - BiosReleaseDate[8] =3D BiosIdImage.BiosIdString.TimeStamp[0]; > - BiosReleaseDate[9] =3D BiosIdImage.BiosIdString.TimeStamp[1]; > - > - BiosReleaseDate[10] =3D (CHAR16) ((UINT8) ('\0')); > - } > - > - if (BiosReleaseTime !=3D NULL) { > - > - // > - // Fill the build timestamp time from the BIOS ID in the "HH:MM" for= mat. > - // > - BiosReleaseTime[0] =3D BiosIdImage.BiosIdString.TimeStamp[6]; > - BiosReleaseTime[1] =3D BiosIdImage.BiosIdString.TimeStamp[7]; > - BiosReleaseTime[2] =3D (CHAR16) ((UINT8) (':')); > - > - BiosReleaseTime[3] =3D BiosIdImage.BiosIdString.TimeStamp[8]; > - BiosReleaseTime[4] =3D BiosIdImage.BiosIdString.TimeStamp[9]; > - > - BiosReleaseTime[5] =3D (CHAR16) ((UINT8) ('\0')); > - } > - > - return EFI_SUCCESS; > -} > - > diff --git > a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib > .c > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLi > b.c > new file mode 100644 > index 000000000000..af2d47f2b133 > --- /dev/null > +++ > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosId > +++ Lib.c > @@ -0,0 +1,65 @@ > +/** @file > + Boot service StandaloneMm BIOS ID library implementation. > + > + These functions in this file can be called during DXE and cannot be > + called during runtime or in SMM which should use a RT or SMM library. > + > + > +Copyright (c) 2023, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +/** > + This function returns BIOS ID by searching HOB. > + It also debug print the BIOS ID found. > + > + @param[out] BiosIdImage The BIOS ID got from HOB or FV. It is option= al, > + no BIOS ID will be returned if it is NULL as= input. > + > + @retval EFI_SUCCESS BIOS ID has been got successfully. > + @retval EFI_NOT_FOUND BIOS ID image is not found, and no > parameter will be modified. > + > +**/ > +EFI_STATUS > +EFIAPI > +GetBiosId ( > + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > + ) > +{ > + BIOS_ID_IMAGE TempBiosIdImage; > + VOID *Address; > + UINTN Size; > + > + Address =3D NULL; > + Size =3D 0; > + > + if (BiosIdImage =3D=3D NULL) { > + // > + // It is NULL as input, so no BIOS ID will be returned. > + // Use temp buffer to hold the BIOS ID. > + // > + BiosIdImage =3D &TempBiosIdImage; > + } > + > + Address =3D GetFirstGuidHob (&gBiosIdGuid); if (Address !=3D NULL) { > + Size =3D sizeof (BIOS_ID_IMAGE); > + CopyMem ((VOID *)BiosIdImage, GET_GUID_HOB_DATA (Address), Size); > + > + DEBUG ((DEBUG_INFO, "StandaloneMm get BIOS ID from HOB > successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 *)(&(BiosIdImage- > >BiosIdString)))); > + return EFI_SUCCESS; > + } > + > + DEBUG ((DEBUG_ERROR, "StandaloneMm get BIOS ID failed: %r\n", > +EFI_NOT_FOUND)); > + return EFI_NOT_FOUND; > +} > diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > index 9f00592a19c0..44a2abd03f58 100644 > --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > @@ -88,6 +88,7 @@ >=20 > BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf > + BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib.inf >=20 >=20 > BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBootMe > diaInfoLib.inf > BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf > diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib= .inf > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > index 39f42e91a0cc..f73ab1f3b6b6 100644 > --- a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > @@ -22,6 +22,7 @@ >=20 > [Sources.common] > DxeBiosIdLib.c > + BiosIdCommon.c >=20 > [Packages] > MdePkg/MdePkg.dec > diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib= .inf > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf > index e38d17bd9bb1..c197a3f18316 100644 > --- a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf > @@ -1,7 +1,7 @@ > ### @file > # PEI BIOS ID library. > # > -# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) 2015 - 2023, Intel Corporation. All rights > +reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -22,10 +22,12 @@ >=20 > [Sources.common] > PeiBiosIdLib.c > + BiosIdCommon.c >=20 > [Packages] > MdePkg/MdePkg.dec > - BoardModulePkg/BoardModulePkg.dec >=20 > + BoardModulePkg/BoardModulePkg.dec > + >=20 > [LibraryClasses] > BaseLib > diff --git > a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib > .inf > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLi > b.inf > new file mode 100644 > index 000000000000..40f64b8067d1 > --- /dev/null > +++ > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosId > +++ Lib.inf > @@ -0,0 +1,42 @@ > +### @file > +# StandaloneMm BIOS ID library. > +# > +# Copyright (c) 2023, Intel Corporation. All rights reserved.
# # > +SPDX-License-Identifier: BSD-2-Clause-Patent # ### [Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D StandaloneMmBiosIdLib > + FILE_GUID =3D b6304cdf-6d3e-4762-8a88-ff98dcad6b14 > + MODULE_TYPE =3D MM_STANDALONE > + VERSION_STRING =3D 1.0 > + PI_SPECIFICATION_VERSION =3D 0x00010032 > + LIBRARY_CLASS =3D BiosIdLib| MM_CORE_STANDALONE > MM_STANDALONE > + > +# > +# The following information is for reference only and not required by th= e build > tools. > +# > +# VALID_ARCHITECTURES =3D IA32 X64 > +# > + > +[Sources.common] > + StandaloneMmBiosIdLib.c > + BiosIdCommon.c > + > +[Packages] > + MdePkg/MdePkg.dec > + BoardModulePkg/BoardModulePkg.dec > + > +[LibraryClasses] > + BaseLib > + BaseMemoryLib > + HobLib > + DebugLib > + > +[Guids] > + ## SOMETIMES_CONSUMES ## HOB > + ## SOMETIMES_CONSUMES ## GUID > + gBiosIdGuid > + > -- > 2.26.2.windows.1 -=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 (#113316): https://edk2.groups.io/g/devel/message/113316 Mute This Topic: https://groups.io/mt/103367466/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-