[PATCH v2 00/16] Un-siloing Arm common code


Bret Barkelew
 

This series of patch commits moves a number of modules and libraries around in order
to better un-silo the Arm-specific code. Unnecessary abstractions were removed, some
duplicate code was abstracted, and generally things were cleaned up so that common
code (e.g. MdePkg, MdeModulePkg, StandaloneMmPkg) does not require ArmPkg or
ArmPlatformPkg.

Also, some things that were previously hidden away under ArmPkg are now located
with the core functionality or build tooling that makes sense for it.

Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Bob Feng <bob.c.feng@...>
Cc: Jiaxin Wu <jiaxin.wu@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Leif Lindholm <leif@...>
Cc: Liming Gao <gaoliming@...>
Cc: Maciej Rabeda <maciej.rabeda@...>
Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Ray Ni <ray.ni@...>
Cc: Sami Mujawar <sami.mujawar@...>
Cc: Sean Brogan <sean.brogan@...>
Cc: Siyuan Fu <siyuan.fu@...>
Cc: Supreeth Venkatesh <supreeth.venkatesh@...>
Cc: Yuwei Chen <yuwei.chen@...>
Cc: Zhichao Gao <zhichao.gao@...>
Cc: Zhiguang Liu <zhiguang.liu@...>
Signed-off-by: Bret Barkelew <bret.barkelew@...>

Bret Barkelew (15):
ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM
ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib
ArmPkg/StandaloneMmCoreEntryPoint: Swap to ArmMmuLib
ArmPkg: Disavow StandaloneMmMmuLib. It's just ArmMmuLib
ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg
ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to
BaseTools
ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg
MdePkg: Create the MMU access lib to abstract memory protection
settings
MdeModulePkg: Swap to MmuLib instead of Arm-specific lib
StandaloneMmPkg: Switch to the MmuLib abstraction
ArmPkg: Move the StandaloneMmCpu driver to ArmPkg
ArmPkg: Move the StandaloneMmCoreEntryPoint lib to ArmPkg
ArmPkg/Library: Convert StandaloneMmCoreEntryPoint to Arm-only
ArmPkg/ArmPkg.dsc: Resolve build errors resulting from package moves
ArmPlatformPkg: Resolve build errors resulting from package moves

Sean Brogan (1):
ArmPkg: Add Basic MMU Lib for Arm silicon

{StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/EventHandle.c | 0
{StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 0
ArmPkg/Library/MmuLib/MmuLib.c | 120 ++++++++++++++++++++
{StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c | 0
{StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c | 0
{StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c | 0
ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c | 37 ++++++
MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c | 4 +-
MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.c | 86 ++++++++++++++
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcmp_ms.c | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcpy.c | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcpy_ms.c | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memmove_ms.c | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memset.c | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memset_ms.c | 0
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c | 71 ------------
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c | 50 +++++++-
ArmPkg/ArmPkg.ci.yaml | 3 +-
ArmPkg/ArmPkg.dec | 4 -
ArmPkg/ArmPkg.dsc | 15 ++-
{StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.h | 0
{StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf | 0
ArmPkg/Include/Library/StandaloneMmMmuLib.h | 36 ------
ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf | 2 +-
ArmPkg/Library/MmuLib/BaseMmuLib.inf | 30 +++++
{StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf | 8 +-
ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf | 2 +-
ArmPlatformPkg/ArmPlatformPkg.dsc | 4 +-
{ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-aarch64.a | Bin
{ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-aarch64.s | 0
{ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-arm.a | Bin
{ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-arm.s | 0
BaseTools/Conf/tools_def.template | 19 ++--
CryptoPkg/CryptoPkg.dsc | 2 +-
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 4 +-
MdeModulePkg/MdeModulePkg.dsc | 5 +-
{ArmPkg/Include => MdePkg/Include/AArch64}/AsmMacroIoLibV8.h | 0
{ArmPkg/Include => MdePkg/Include/Arm}/AsmMacroIoLib.h | 0
MdePkg/Include/Library/MmuLib.h | 75 ++++++++++++
MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf | 28 +++++
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/AArch64/Atomics.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ashldi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/clzsi2.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/div.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/div.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/divdi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/divsi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lasr.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lasr.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ldivmod.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsl.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsl.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsr.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsr.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/memmove.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/memmove.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/moddi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/modsi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/muldi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/mullu.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/mullu.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/sourcery.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch16.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch32.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch8.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switchu8.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivdi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivsi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uldiv.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uldiv.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/umoddi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/umodsi3.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uread.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uread.asm | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uwrite.S | 0
{ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uwrite.asm | 0
ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf => MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf | 3 +-
MdePkg/MdePkg.dec | 5 +
MdePkg/MdePkg.dsc | 3 +
NetworkPkg/NetworkPkg.dsc | 2 +-
ShellPkg/ShellPkg.dsc | 2 +-
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf | 3 +-
StandaloneMmPkg/StandaloneMmPkg.dsc | 3 +-
UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 2 +-
91 files changed, 475 insertions(+), 153 deletions(-)
rename {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/EventHandle.c (100%)
rename {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.c (100%)
create mode 100644 ArmPkg/Library/MmuLib/MmuLib.c
rename {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c (100%)
rename {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c (100%)
rename {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c (100%)
create mode 100644 MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.c
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcmp_ms.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcpy.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memcpy_ms.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memmove_ms.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memset.c (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/memset_ms.c (100%)
delete mode 100644 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
rename {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.h (100%)
rename {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf (100%)
delete mode 100644 ArmPkg/Include/Library/StandaloneMmMmuLib.h
create mode 100644 ArmPkg/Library/MmuLib/BaseMmuLib.inf
rename {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf (84%)
rename {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-aarch64.a (100%)
rename {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-aarch64.s (100%)
rename {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-arm.a (100%)
rename {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-arm.s (100%)
rename {ArmPkg/Include => MdePkg/Include/AArch64}/AsmMacroIoLibV8.h (100%)
rename {ArmPkg/Include => MdePkg/Include/Arm}/AsmMacroIoLib.h (100%)
create mode 100644 MdePkg/Include/Library/MmuLib.h
create mode 100644 MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/AArch64/Atomics.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ashldi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/clzsi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/div.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/div.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/divdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/divsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lasr.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lasr.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ldivmod.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsl.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsl.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsr.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/llsr.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/memmove.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/memmove.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/moddi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/modsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/muldi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/mullu.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/mullu.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/sourcery.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch16.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch32.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switch8.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/switchu8.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivdi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/udivsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uldiv.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uldiv.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/umoddi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/umodsi3.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uread.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uread.asm (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uwrite.S (100%)
rename {ArmPkg => MdePkg}/Library/CompilerIntrinsicsLib/Arm/uwrite.asm (100%)
rename ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf => MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf (93%)

--
2.31.1.windows.1

Join devel@edk2.groups.io to automatically receive all group messages.