From nobody Sun Feb 8 10:04:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+74460+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+74460+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1619529409; cv=none; d=zohomail.com; s=zohoarc; b=YqB5UBwFU5KGoKOCcW6j+kr3rcn46R6qU/XvFTNxT5pN1RTrRALmvaxMy05T0an4RclajwNMaGMuSI5buOanbEhC+7LRqu8YCKp0eay97A9ibSsr/XafDh7emoAeY/YgPab2XVnd3mkby+95u+tJbSKZ0aKBdHzl3UtojfVLlhQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619529409; h=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=B1ferB2SDMoceqhXVCxj6w217uVm5xA4p4u3A88jAaM=; b=Am2Ko1nOET4H3+bFa+148d8R4LDEr453dk8ib4eU+TkICkyJl5q9mViHUsvJf763bIgIz7glr1Gna6RZpVyvuktIRhNgOUkV3OE6o5ivyd1m2l5tp4LnQ2f9/op2qBJxqtJ0WfOEKcM/g6yAGMY7vyD3a30wRjEwNu0yQEjq5Hk= 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+74460+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1619529409347119.11523001727267; Tue, 27 Apr 2021 06:16:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 963tYY1788612xQwM97sq5Bq; Tue, 27 Apr 2021 06:16:48 -0700 X-Received: from mga09.intel.com (mga09.intel.com []) by mx.groups.io with SMTP id smtpd.web11.5997.1619515423082196094 for ; Tue, 27 Apr 2021 02:23:44 -0700 IronPort-SDR: cgRlezjjkDLOsLji9ifp7b99MIPFigBGn5BC1jBajZGzFmJcaqZ/gSTd5g/d/MhZXFxbeJWzxM l3gRYwC9uLRw== X-IronPort-AV: E=McAfee;i="6200,9189,9966"; a="196588874" X-IronPort-AV: E=Sophos;i="5.82,254,1613462400"; d="scan'208";a="196588874" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 02:23:43 -0700 IronPort-SDR: 0Yvd8Z9evsS/+8Ffh8SXWBQcYdjte+VpEwVv5fZcvu6LcA1o0KIoiaBDDxehe9PVRNtU2oEgWI ZyxTBqQ1+zOA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,254,1613462400"; d="scan'208";a="429746311" X-Received: from ikuox-tiger-lake-client-platform.itwn.intel.com ([10.5.215.23]) by orsmga008.jf.intel.com with ESMTP; 27 Apr 2021 02:23:41 -0700 From: sofiax.chuang@intel.com To: devel@edk2.groups.io Cc: SofiaX Chuang , Ray Ni , Rangasai V Chaganty Subject: [edk2-devel][PATCH v3 1/7] IntelSiliconPkg/ReportCpuHobLib: Add ReportCpuHobLib Date: Tue, 27 Apr 2021 06:01:19 +0800 Message-Id: <84de1b2ca444acef98975874f52e3ba2f355f923.1619474343.git.sofiax.chuang@intel.com> In-Reply-To: References: MIME-Version: 1.0 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,sofiax.chuang@intel.com X-Gm-Message-State: sUj8lls8BwpcVMkXxPPdldwxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1619529408; bh=bIq4iL9fPQlnEGxSaeFmWqpfYuR0dx1SqGRuQbv9JC8=; h=Cc:Date:From:Reply-To:Subject:To; b=w6t+x0o7XD/iOgYUVtB0nBBFpraxH9tV+cY3JLlvwhLKE7IM+PucQztf05gV+arua/t 9hhAiLfaCpGkx1kjEQaJ1VOsuQalQx9cR6NWgDUuEfWqFxujxaM+dQ7tL6+JgJHBgLzLB PBOUDImH9Set3zqTyotetwi1Ry+Bt8/ruTg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: SofiaX Chuang REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3298 Add ReportCpuHobLib Signed-off-by: SofiaX Chuang Cc: Ray Ni Cc: Rangasai V Chaganty --- .../Include/Library/ReportCpuHobLib.h | 24 +++++++++++++ .../Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 6 +++- .../Library/ReportCpuHobLib/ReportCpuHobLib.c | 35 +++++++++++++++++++ .../ReportCpuHobLib/ReportCpuHobLib.inf | 26 ++++++++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpu= HobLib.h create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/R= eportCpuHobLib.c create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/R= eportCpuHobLib.inf diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.= h b/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h new file mode 100644 index 0000000000..46f502d616 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h @@ -0,0 +1,24 @@ +/** @file + + Report CPU HOB library + + This library report the CPU HOB with Physical Address bits. + +Copyright (c) 2021, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _REPORT_CPU_HOB_LIB_H_ +#define _REPORT_CPU_HOB_LIB_H_ + +#include +#include + +VOID +EFIAPI +ReportCpuHob ( + VOID + ); + +#endif diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/In= tel/IntelSiliconPkg/IntelSiliconPkg.dec index 4a2cbca5c1..2461ab8e06 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec @@ -3,7 +3,7 @@ # # This package provides common open source Intel silicon modules. # -# Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -42,6 +42,10 @@ # AslUpdateLib|Include/Library/AslUpdateLib.h =20 + ## @libraryclass Provides services to report CPU hob + # + ReportCpuHobLib|Include/Library/ReportCpuHobLib.h + [Guids] ## GUID for Package token space # {A9F8D54E-1107-4F0A-ADD0-4587E7A4A735} diff --git a/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCp= uHobLib.c b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpu= HobLib.c new file mode 100644 index 0000000000..97cacb7110 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib= .c @@ -0,0 +1,35 @@ +/** @file + Source code file for Report CPU HOB library. + +Copyright (c) 2021, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include + +VOID +EFIAPI +ReportCpuHob ( + VOID + ) +{ + UINT8 PhysicalAddressBits; + UINT32 RegEax; + + AsmCpuid (CPUID_EXTENDED_FUNCTION, &RegEax, NULL, NULL, NULL); + if (RegEax >=3D CPUID_VIR_PHY_ADDRESS_SIZE) { + AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &RegEax, NULL, NULL, NULL); + PhysicalAddressBits =3D (UINT8) RegEax; + } else { + PhysicalAddressBits =3D 36; + } + + /// + /// Create a CPU hand-off information + /// + BuildCpuHob (PhysicalAddressBits, 16); +} diff --git a/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCp= uHobLib.inf b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportC= puHobLib.inf new file mode 100644 index 0000000000..1d2d6b4151 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib= .inf @@ -0,0 +1,26 @@ +### @file +# Component information file for the Report CPU HOB library. +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D ReportCpuHobLib + FILE_GUID =3D 0A1C9D6B-44BE-4FD7-A4A2-D0E68D436848 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D PEIM + LIBRARY_CLASS =3D ReportCpuHobLib + +[LibraryClasses] + BaseLib + HobLib + +[Packages] + MdePkg/MdePkg.dec + +[Sources] + ReportCpuHobLib.c --=20 2.27.0 -=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 (#74460): https://edk2.groups.io/g/devel/message/74460 Mute This Topic: https://groups.io/mt/82403553/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-