From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.3579.1667289557835942096 for ; Tue, 01 Nov 2022 00:59:18 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Vs6bzebh; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: zhiguang.liu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667289557; x=1698825557; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bKATqCCAs19lPTPBLxa+pfNfoWh18xdtMtHrKh3C9Og=; b=Vs6bzebhFgwratQIjMsc66Z7qjhRiqC02wQj3nce9qzGXwVM2Qj5Cob6 zBrMXAoogEgWPI+zSzfeEwNZzWaqEQLnGL00q56dDeeQa0PfU1Fn2hlE+ OLE++6xZ9dQY0Dej6jAEETOuvP9qQa/QEsxVP3/nY8CMckcaEF+9qf4JV Hi8oXN0H/JBiUo7c6OH6eHsgJZ4m1hyaanRdb+uD1QXnpNJM53BkjW+r+ 4jWNAaFnJx0QEd14VUKI6T2a+nj3sh7APJJIR4VWLYGGq6CQKQTxeZHu9 Ba5jBWFGQmBE478C7j3sQNdXcbKpHZqPhWmLRiBlKrPYMZ6ygIy1vwQ6p w==; X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="371170075" X-IronPort-AV: E=Sophos;i="5.95,230,1661842800"; d="scan'208";a="371170075" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2022 00:59:17 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="697324249" X-IronPort-AV: E=Sophos;i="5.95,230,1661842800"; d="scan'208";a="697324249" Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2022 00:59:16 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu Subject: [PATCH v3 0/9] merge UefiCpuPkg/UefiCpuLib to MdePkg/CpuLib Date: Tue, 1 Nov 2022 15:58:33 +0800 Message-Id: <20221101075842.1218-1-zhiguang.liu@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit V3: Months ago, Pu Yu sent this patch serial and get reviewed-by, but some haven't been merged. Because the code base is changed, to merge the remaining patches into latest code base, two patches for OvmfPkg are modified. Please OvmfPkg maintainers and reviewers help review patch #1 and #4. Other patches keep unchanged and don't need review again. V2: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3394 Today lots of duplicated code call CPUID and calculates the address mask. Adding an API named GetPhysicalAddressBits in UefiCpuLib can solve this problem, but at the same time cause MdeModulePkg depend on UefiCpuPkg which does not meet the design spec. So merge UefiCpuLib to CpuLib is a good way to sovle these problems. To minimize the impact,this change is carried out in four steps. Yu Pu (8): MdePkg: 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. Zhiguang Liu (1): OvmfPkg: Add CpuLib to module INFs that depend on UefiCpuLib. IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf | 1 - IntelFsp2Pkg/FspSecCore/SecMain.h | 1 - IntelFsp2Pkg/IntelFsp2Pkg.dsc | 1 - IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc | 1 - .../FspmWrapperPeim/FspmWrapperPeim.inf | 1 - .../FspsWrapperPeim/FspsWrapperPeim.inf | 1 - IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 1 - MdePkg/Include/Library/CpuLib.h | 48 ++++++++++++++ MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 6 ++ .../BaseCpuLib}/Ia32/InitializeFpu.nasm | 0 .../BaseCpuLib}/X64/InitializeFpu.nasm | 0 .../Library/BaseCpuLib/X86BaseCpuLib.c | 2 +- OvmfPkg/AmdSev/AmdSevX64.dsc | 1 - OvmfPkg/Bhyve/BhyveX64.dsc | 1 - OvmfPkg/CloudHv/CloudHvX64.dsc | 1 - OvmfPkg/IntelTdx/Sec/SecMain.c | 2 +- OvmfPkg/Library/TdxMailboxLib/TdxMailbox.c | 2 +- OvmfPkg/Microvm/MicrovmX64.dsc | 1 - OvmfPkg/OvmfPkgIa32.dsc | 1 - OvmfPkg/OvmfPkgIa32X64.dsc | 1 - OvmfPkg/OvmfPkgX64.dsc | 1 - OvmfPkg/OvmfXen.dsc | 1 - OvmfPkg/Sec/SecMain.c | 1 - OvmfPkg/Sec/SecMain.inf | 1 - PcAtChipsetPkg/PcAtChipsetPkg.dsc | 1 - SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 1 - UefiCpuPkg/CpuDxe/CpuDxe.h | 1 - UefiCpuPkg/CpuDxe/CpuDxe.inf | 1 - UefiCpuPkg/Include/Library/UefiCpuLib.h | 65 ------------------- .../Library/BaseUefiCpuLib/BaseUefiCpuLib.inf | 41 ------------ .../Library/BaseUefiCpuLib/BaseUefiCpuLib.uni | 16 ----- .../Library/BaseXApicLib/BaseXApicLib.c | 1 - .../Library/BaseXApicLib/BaseXApicLib.inf | 1 - .../BaseXApicX2ApicLib/BaseXApicX2ApicLib.c | 1 - .../BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf | 1 - UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 1 - UefiCpuPkg/Library/MpInitLib/MpLib.h | 1 - UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 1 - UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 1 - UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 1 - .../PiSmmCpuDxeSmm/SmmProfileInternal.h | 1 - UefiCpuPkg/SecCore/SecCore.inf | 1 - UefiCpuPkg/SecCore/SecCoreNative.inf | 1 - UefiCpuPkg/SecCore/SecMain.h | 1 - UefiCpuPkg/UefiCpuPkg.dec | 5 -- UefiCpuPkg/UefiCpuPkg.dsc | 2 - .../UefiPayloadEntry/UefiPayloadEntry.h | 1 - .../UefiPayloadEntry/UefiPayloadEntry.inf | 1 - .../UniversalPayloadEntry.inf | 1 - UefiPayloadPkg/UefiPayloadPkg.dsc | 1 - 50 files changed, 57 insertions(+), 170 deletions(-) rename {UefiCpuPkg/Library/BaseUefiCpuLib => MdePkg/Library/BaseCpuLib}/Ia32/InitializeFpu.nasm (100%) rename {UefiCpuPkg/Library/BaseUefiCpuLib => MdePkg/Library/BaseCpuLib}/X64/InitializeFpu.nasm (100%) rename UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c => MdePkg/Library/BaseCpuLib/X86BaseCpuLib.c (93%) delete mode 100644 UefiCpuPkg/Include/Library/UefiCpuLib.h delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.uni -- 2.31.1.windows.1