From nobody Sun Feb 8 19:03:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+74939+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+74939+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1620717424; cv=none; d=zohomail.com; s=zohoarc; b=MH+ZxXDph6qDGR/aSl+gLiFp+yjLVJxMGrYPI3yqCWgHhwok6UsFyDfflt2LDc+3s8n0uPFy3hfGokTZu2zttLENAnookenueHkaC55K0Sm7lOOAby0HVa9q63I/9aMAUj789dSOPmZikjWOZ+qmrLNQDph/rFWlFHi8u/ZjjYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620717424; 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=7eVUGCT24e/sQyROyNfDEUsloiQn8+9igasEt8hRcvk=; b=Px+SmAMsPPZLOGGv5YZJ9XHomOxvxUYX35Gq0UlqGUKYh8lrZxyEhclwX50bXI7zUVMiac3LZ076B1o98mWyeH1yJ104w2pAVGNvj29a9graZlvk+Cjp8w7uoL9tFyluvp7+bR8NQBNP1P+IgQ8uMQ3E6hrS+0mrPnR0sRCW8ow= 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+74939+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 1620717424471493.3986438297934; Tue, 11 May 2021 00:17:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id y2oWYY1788612xEBYlLUbd4T; Tue, 11 May 2021 00:17:04 -0700 X-Received: from mga09.intel.com (mga09.intel.com []) by mx.groups.io with SMTP id smtpd.web11.9432.1620717422491379209 for ; Tue, 11 May 2021 00:17:03 -0700 IronPort-SDR: DdUTYz0/fULbLM0cOITpDf4veufbRiB3WD6e9jNKEneEAEvr+uSkNG5IxucOPF5i7cDZEYExeS 99Z6nftNZUBQ== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="199443048" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="199443048" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 00:17:01 -0700 IronPort-SDR: 2IYBspOZDxmDQ0z+RXZ2mCPSs2m/xTs26F0eQO62q/4L/29lKdIDEZ1A0Ao9PcNSM/g81OZwSU ZJVPfYCG0HQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="399211169" X-Received: from ikuox-tiger-lake-client-platform.itwn.intel.com ([10.5.215.23]) by fmsmga007.fm.intel.com with ESMTP; 11 May 2021 00:17:00 -0700 From: sofiax.chuang@intel.com To: devel@edk2.groups.io Cc: SofiaX Chuang , Ray Ni , Rangasai V Chaganty Subject: [edk2-devel][PATCH v5 1/7] IntelSiliconPkg/ReportCpuHobLib: Add ReportCpuHobLib Date: Tue, 11 May 2021 03:54:24 +0800 Message-Id: <78432ebda1f57efffe258a6d2999188a83664673.1620675658.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: W92FsPrYXJAcwCOGXZy2EVS2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1620717424; bh=nHF70thFc8zjPPnsLLm6dDM4e6sp364lQ+ZW9Mnudq0=; h=Cc:Date:From:Reply-To:Subject:To; b=FpruiQ6KADjWq+76WttSvnRIkG1oZ7jAVw2pI9gdSojOjfyYRNmwdTv1Esj9HoY9oTw X/8BdSKqVm25+uYFVe8YKIuYMhpM4oEW+MpiAzwyy8s4czbFkiFTWu7w2ZccVkB3ntFo0 oyltMQDZaOaY9uL4GBn5mJZQtfjsJv7H+RM= 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 Reviewed-by: Ray Ni Reviewed-by: Sai Chaganty =20 --- .../Include/Library/ReportCpuHobLib.h | 27 +++++++++++++ .../Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 6 ++- .../Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 1 + .../Library/ReportCpuHobLib/ReportCpuHobLib.c | 39 +++++++++++++++++++ .../ReportCpuHobLib/ReportCpuHobLib.inf | 26 +++++++++++++ 5 files changed, 98 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..106ab3d436 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h @@ -0,0 +1,27 @@ +/** @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 + +/** + Build a HOB for the CPU. +**/ +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/IntelSiliconPkg.dsc b/Silicon/In= tel/IntelSiliconPkg/IntelSiliconPkg.dsc index 5e0de7e19a..1092371d84 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc @@ -93,6 +93,7 @@ IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib= .inf IntelSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf + IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf =20 [BuildOptions] *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES 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..3f67b477d2 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib= .c @@ -0,0 +1,39 @@ +/** @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 + + +/** + Build a HOB for the CPU. +**/ +VOID +EFIAPI +ReportCpuHob ( + VOID + ) +{ + UINT8 PhysicalAddressBits; + CPUID_VIR_PHY_ADDRESS_SIZE_EAX AddressSizeEax; + + AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &AddressSizeEax.Uint32, NULL, NULL= , NULL); + if (AddressSizeEax.Uint32 >=3D CPUID_VIR_PHY_ADDRESS_SIZE) { + AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &AddressSizeEax.Uint32, NULL, NU= LL, NULL); + PhysicalAddressBits =3D AddressSizeEax.Bits.PhysicalAddressBits; + } 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 (#74939): https://edk2.groups.io/g/devel/message/74939 Mute This Topic: https://groups.io/mt/82741014/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-