[edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to MdePkg/CpuLib

Zhiguang Liu posted 9 patches 1 year, 1 month ago
Only 0 patches received!
IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf     |  1 -
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/IntelTdxX64.dsc              |  1 -
OvmfPkg/IntelTdx/Sec/SecMain.c                |  2 +-
OvmfPkg/IntelTdx/Sec/SecMain.inf              |  2 +-
.../PeilessStartupLib/PeilessStartupLib.inf   |  2 +-
OvmfPkg/Library/TdxMailboxLib/TdxMailbox.c    |  2 +-
.../Library/TdxMailboxLib/TdxMailboxLib.inf   |  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 -
55 files changed, 60 insertions(+), 175 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
[edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to MdePkg/CpuLib
Posted by Zhiguang Liu 1 year, 1 month ago
V4:
This patch set has already gotten reviewed-by except OvmfPkg. Also V4 has a little code change for OvmfPkg.
So I only sent pathces about OvmfPkg (patch NO.1 and NO.4) to avoid disturbing other Package Maintainers.
Other patches can check the V3 version or check the PR link https://github.com/tianocore/edk2/pull/4066

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.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>

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/Fsp24SecCoreM.inf     |  1 -
 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/IntelTdxX64.dsc              |  1 -
 OvmfPkg/IntelTdx/Sec/SecMain.c                |  2 +-
 OvmfPkg/IntelTdx/Sec/SecMain.inf              |  2 +-
 .../PeilessStartupLib/PeilessStartupLib.inf   |  2 +-
 OvmfPkg/Library/TdxMailboxLib/TdxMailbox.c    |  2 +-
 .../Library/TdxMailboxLib/TdxMailboxLib.inf   |  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 -
 55 files changed, 60 insertions(+), 175 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100505): https://edk2.groups.io/g/devel/message/100505
Mute This Topic: https://groups.io/mt/97261627/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to MdePkg/CpuLib
Posted by Gerd Hoffmann 1 year, 1 month ago
On Mon, Feb 27, 2023 at 03:23:57PM +0800, Zhiguang Liu wrote:
> V4:
> This patch set has already gotten reviewed-by except OvmfPkg. Also V4 has a little code change for OvmfPkg.
> So I only sent pathces about OvmfPkg (patch NO.1 and NO.4) to avoid disturbing other Package Maintainers.
> Other patches can check the V3 version or check the PR link https://github.com/tianocore/edk2/pull/4066

It is perfectly fine to repost the whole series, especially when v3 was
posted months ago.  It's good to add any review tags to the patches
though to make clear which are reviewed already and which are not.

> 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.

>  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%)

So in essence this series moves the code unmodified (other than some
reaming due to the new location) and updates all references?

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100509): https://edk2.groups.io/g/devel/message/100509
Mute This Topic: https://groups.io/mt/97261627/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to MdePkg/CpuLib
Posted by Zhiguang Liu 1 year ago
Hi Gerd,

Yes, just like you said, no code logic modified, just relocation.

And thanks for your suggestion, but since it is a simple code change, but contains too many patches, if it is ok for you, I don't plan to send the whole patch series this time.

Thanks
Zhiguang

> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Monday, February 27, 2023 5:21 PM
> To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Yao, Jiewen
> <jiewen.yao@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>
> Subject: Re: [edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to
> MdePkg/CpuLib
> 
> On Mon, Feb 27, 2023 at 03:23:57PM +0800, Zhiguang Liu wrote:
> > V4:
> > This patch set has already gotten reviewed-by except OvmfPkg. Also V4
> has a little code change for OvmfPkg.
> > So I only sent pathces about OvmfPkg (patch NO.1 and NO.4) to avoid
> disturbing other Package Maintainers.
> > Other patches can check the V3 version or check the PR link
> > https://github.com/tianocore/edk2/pull/4066
> 
> It is perfectly fine to repost the whole series, especially when v3 was posted
> months ago.  It's good to add any review tags to the patches though to make
> clear which are reviewed already and which are not.
> 
> > 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.
> 
> >  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%)
> 
> So in essence this series moves the code unmodified (other than some
> reaming due to the new location) and updates all references?
> 
> take care,
>   Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100530): https://edk2.groups.io/g/devel/message/100530
Mute This Topic: https://groups.io/mt/97261627/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to MdePkg/CpuLib
Posted by Gerd Hoffmann 1 year ago
On Tue, Feb 28, 2023 at 01:50:12AM +0000, Liu, Zhiguang wrote:
> Hi Gerd,
> 
> Yes, just like you said, no code logic modified, just relocation.
> 
> And thanks for your suggestion, but since it is a simple code change, but contains too many patches, if it is ok for you, I don't plan to send the whole patch series this time.

Series:
Acked-by: Gerd Hoffmann <kraxel@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100781): https://edk2.groups.io/g/devel/message/100781
Mute This Topic: https://groups.io/mt/97261627/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-