From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.3562.1648535835036332664 for ; Mon, 28 Mar 2022 23:37:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=alCa4Zjr; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: yu.pu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648535835; x=1680071835; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vdOckn3s46Seswkx6X+X1u+l7sSlM/gpzTYzg7hxbOU=; b=alCa4Zjr5UyNzx5LgbHVNJOfywh0+Ejjlc8HiqE8dGGB7GGG7g1+LYEM k/I/Djag+tNL+f4kuyaZ5W/ZSnQBV6bzprQc53oQhPrXm5qTP8HHIDJoN +NWBbXuWtqnQR6D2NuZoFo9hy/wPrsXYhU2lBj80DD0PveDp6izpQGHr0 asymbSYE7gHu42Y0vZVmFFbKofqROYiWHmbQV/9nUyAgkjugtxfTk0djv X97ro8tofgML8tqlNXneGGn+qCdcfAwLaJ/0Xils3fwHJBbfiGAO579rU 8RPd4wcDyTNEd69J41hnkvl1mWpwTA30WsjTx2Pyai+sklIjicaqDpsok A==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="258003844" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="258003844" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 23:37:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="521316507" Received: from shwdeopenlab704.ccr.corp.intel.com ([10.239.182.50]) by orsmga006.jf.intel.com with ESMTP; 28 Mar 2022 23:37:12 -0700 From: Yu Pu To: devel@edk2.groups.io Cc: Yu Pu Subject: [PATCH v1 00/15] Merge UefiCpuLib to CpuLib Date: Tue, 29 Mar 2022 14:36:48 +0800 Message-Id: <20220329063703.549-1-yu.pu@intel.com> X-Mailer: git-send-email 2.30.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3394=0D =0D Today lots of duplicated code call CPUID and calculates the address =0D mask. Adding an API named GetPhysicalAddressBits in UefiCpuLib can =0D solve this problem, but at the same time cause MdeModulePkg depend =0D on UefiCpuPkg which does not meet the design spec. So merge UefiCpuLib =0D to CpuLib is a good way to sovle these problems. To minimize the impact,=0D this operation is divided into four steps. Yu Pu (15): IntelFsp2Pkg: Add CpuLib to module INFs that depend on UefiCpuLib IntelFsp2WrapperPkg: Add CpuLib to module INFs that depend on UefiCpuLib. MdePkg: Add CpuLib to module INFs that depend on UefiCpuLib. OvmfPkg: Add CpuLib to module INFs that depend on UefiCpuLib. UefiCpuPkg: Add CpuLib to module INFs that depend on UefiCpuLib. UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib. MdePkg: Move API and implementation from UefiCpuLib to CpuLib UefiCpuPkg: Move API and implementation from UefiCpuLib to CpuLib IntelFsp2Pkg: Remove UefiCpuLib from module INFs. OvmfPkg: Remove UefiCpuLib from module INFs. PcAtChipsetPkg: Remove UefiCpuLib from module INFs. SourceLevelDebugPkg: Remove UefiCpuLib from module INFs. UefiCpuPkg: Remove UefiCpuLib from module INFs. UefiPayloadPkg: Remove UefiCpuLib from module INFs. UefiCpuLib: Remove UefiCpuLib. MdePkg/Library/BaseCpuLib/X86BaseCpuLib.c = | 122 ++++++++++++++++++++ OvmfPkg/Sec/SecMain.c = | 2 +- UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c = | 81 ------------- UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c = | 2 +- UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c = | 2 +- IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf = | 2 +- IntelFsp2Pkg/FspSecCore/SecMain.h = | 2 +- IntelFsp2Pkg/IntelFsp2Pkg.dsc = | 1 - IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc = | 1 - IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf = | 2 +- IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf = | 2 +- IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc = | 1 - MdePkg/Include/Library/CpuLib.h = | 65 +++++++++++ MdePkg/Library/BaseCpuLib/BaseCpuLib.inf = | 6 + {UefiCpuPkg/Library/BaseUefiCpuLib =3D> MdePkg/Library/BaseCpuLib}/Ia32/In= itializeFpu.nasm | 0 {UefiCpuPkg/Library/BaseUefiCpuLib =3D> MdePkg/Library/BaseCpuLib}/X64/Ini= tializeFpu.nasm | 0 MdePkg/MdeLibs.dsc.inc = | 1 + OvmfPkg/AmdSev/AmdSevX64.dsc = | 1 - OvmfPkg/Bhyve/BhyveX64.dsc = | 1 - OvmfPkg/CloudHv/CloudHvX64.dsc = | 1 - OvmfPkg/Microvm/MicrovmX64.dsc = | 1 - OvmfPkg/OvmfPkgIa32.dsc = | 1 - OvmfPkg/OvmfPkgIa32X64.dsc = | 1 - OvmfPkg/OvmfPkgX64.dsc = | 1 - OvmfPkg/OvmfXen.dsc = | 1 - OvmfPkg/Sec/SecMain.inf = | 2 +- PcAtChipsetPkg/PcAtChipsetPkg.dsc = | 1 - SourceLevelDebugPkg/SourceLevelDebugPkg.dsc = | 1 - UefiCpuPkg/CpuDxe/CpuDxe.h = | 1 - UefiCpuPkg/CpuDxe/CpuDxe.inf = | 1 - UefiCpuPkg/Include/Library/UefiCpuLib.h = | 65 ----------- UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf = | 41 ------- UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.uni = | 16 --- UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf = | 2 +- UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf = | 2 +- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf = | 1 - UefiCpuPkg/Library/MpInitLib/MpLib.h = | 1 - UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf = | 1 - UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h = | 2 +- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf = | 1 - UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h = | 1 - UefiCpuPkg/SecCore/SecCore.inf = | 2 +- UefiCpuPkg/SecCore/SecCoreNative.inf = | 2 +- UefiCpuPkg/SecCore/SecMain.h = | 2 +- UefiCpuPkg/UefiCpuPkg.dec = | 5 - UefiCpuPkg/UefiCpuPkg.dsc = | 2 - UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h = | 2 +- UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf = | 2 +- UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf = | 2 +- UefiPayloadPkg/UefiPayloadPkg.dsc = | 1 - 50 files changed, 211 insertions(+), 248 deletions(-) create mode 100644 MdePkg/Library/BaseCpuLib/X86BaseCpuLib.c delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c rename {UefiCpuPkg/Library/BaseUefiCpuLib =3D> MdePkg/Library/BaseCpuLib}/= Ia32/InitializeFpu.nasm (100%) rename {UefiCpuPkg/Library/BaseUefiCpuLib =3D> MdePkg/Library/BaseCpuLib}/= X64/InitializeFpu.nasm (100%) delete mode 100644 UefiCpuPkg/Include/Library/UefiCpuLib.h delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.uni --=20 2.30.0.windows.2