public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 00/16] Un-siloing Arm common code
@ 2021-11-01 19:56 Bret Barkelew
  2021-11-01 19:56 ` [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM Bret Barkelew
                   ` (16 more replies)
  0 siblings, 17 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel

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.

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/ArmPlatformPkg.dsc: 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 => MdePkg}/Include/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 +-
 90 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 => MdePkg}/Include/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


^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  8:43   ` Leif Lindholm
  2021-11-02  9:26   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 02/16] ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib Bret Barkelew
                   ` (15 subsequent siblings)
  16 siblings, 2 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

Not sure what all module types this HAS been validated against, but it
doesn't work with STANDALONE_MM or STANDALONE_MM_CORE.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
index 2a7e7147958c..d0988b27d582 100644
--- a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
+++ b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
@@ -13,7 +13,7 @@ [Defines]
   FILE_GUID                      = da8f0232-fb14-42f0-922c-63104d2c70bd
   MODULE_TYPE                    = BASE
   VERSION_STRING                 = 1.0
-  LIBRARY_CLASS                  = ArmMmuLib
+  LIBRARY_CLASS                  = ArmMmuLib | DXE_DRIVER PEIM PEI_CORE DXE_CORE DXE_RUNTIME_DRIVER SEC
 
 [Defines.AARCH64]
   CONSTRUCTOR                    = ArmMmuBaseLibConstructor
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 02/16] ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
  2021-11-01 19:56 ` [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  9:34   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 03/16] ArmPkg/StandaloneMmCoreEntryPoint: Swap to ArmMmuLib Bret Barkelew
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c   | 37 ++++++++++++++++++++
 ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf |  2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
index 20f873e6802c..42216bf40ac7 100644
--- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
+++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
@@ -325,3 +325,40 @@ ArmClearMemoryRegionReadOnly (
   }
   return Status;
 }
+
+EFI_STATUS
+EFIAPI
+ArmConfigureMmu (
+  IN  ARM_MEMORY_REGION_DESCRIPTOR  *MemoryTable,
+  OUT VOID                          **TranslationTableBase OPTIONAL,
+  OUT UINTN                         *TranslationTableSize  OPTIONAL
+  )
+{
+  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
+  ASSERT (FALSE);
+  return EFI_UNSUPPORTED;
+}
+
+VOID
+EFIAPI
+ArmReplaceLiveTranslationEntry (
+  IN  UINT64  *Entry,
+  IN  UINT64  Value,
+  IN  UINT64  RegionStart
+  )
+{
+  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
+  ASSERT (FALSE);
+}
+
+EFI_STATUS
+ArmSetMemoryAttributes (
+  IN EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN UINT64                    Length,
+  IN UINT64                    Attributes
+  )
+{
+  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
+  ASSERT (FALSE);
+  return EFI_UNSUPPORTED;
+}
diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
index ff20e5898051..d34086853d32 100644
--- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
+++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
@@ -13,7 +13,7 @@ [Defines]
   FILE_GUID                      = 44a741c2-655f-41fc-b066-179f5a9aa78a
   MODULE_TYPE                    = MM_CORE_STANDALONE
   VERSION_STRING                 = 1.0
-  LIBRARY_CLASS                  = StandaloneMmMmuLib
+  LIBRARY_CLASS                  = ArmMmuLib | MM_CORE_STANDALONE MM_STANDALONE
   PI_SPECIFICATION_VERSION       = 0x00010032
 
 [Sources]
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 03/16] ArmPkg/StandaloneMmCoreEntryPoint: Swap to ArmMmuLib
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
  2021-11-01 19:56 ` [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM Bret Barkelew
  2021-11-01 19:56 ` [PATCH v1 02/16] ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-01 19:56 ` [PATCH v1 04/16] ArmPkg: Disavow StandaloneMmMmuLib. It's just ArmMmuLib Bret Barkelew
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Sami Mujawar, Jiewen Yao, Supreeth Venkatesh,
	Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

StandaloneMmMmuLib has been turned into an implementation of the
ArmMmuLib class.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
index 75cfb98c0e75..a0629cbc1a6f 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
@@ -42,7 +42,7 @@ [LibraryClasses]
   DebugLib
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
-  StandaloneMmMmuLib
+  ArmMmuLib
   ArmSvcLib
 
 [Guids]
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 04/16] ArmPkg: Disavow StandaloneMmMmuLib. It's just ArmMmuLib
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (2 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 03/16] ArmPkg/StandaloneMmCoreEntryPoint: Swap to ArmMmuLib Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  9:39   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg Bret Barkelew
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

This extra interface is redundant and unnecessary. Dropping it is
more EDK2-ish.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 ArmPkg/ArmPkg.dec                           |  4 ---
 ArmPkg/Include/Library/StandaloneMmMmuLib.h | 36 --------------------
 2 files changed, 40 deletions(-)

diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
index 9da1bbc9f216..f5c235ecc11b 100644
--- a/ArmPkg/ArmPkg.dec
+++ b/ArmPkg/ArmPkg.dec
@@ -88,10 +88,6 @@ [LibraryClasses.common]
   #
   SemihostLib|Include/Library/SemihostLib.h
 
-  ##  @libraryclass  Provides an interface for a StandaloneMm Mmu.
-  #
-  StandaloneMmMmuLib|Include/Library/StandaloneMmMmuLib.h
-
 [Guids.common]
   gArmTokenSpaceGuid       = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }
 
diff --git a/ArmPkg/Include/Library/StandaloneMmMmuLib.h b/ArmPkg/Include/Library/StandaloneMmMmuLib.h
deleted file mode 100644
index ccc016d0350a..000000000000
--- a/ArmPkg/Include/Library/StandaloneMmMmuLib.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
-
-  Copyright (c) 2018, ARM Ltd. All rights reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef STANDALONE_MM_MMU_LIB_
-#define STANDALONE_MM_MMU_LIB_
-
-EFI_STATUS
-ArmSetMemoryRegionNoExec (
-  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
-  IN  UINT64                    Length
-  );
-
-EFI_STATUS
-ArmClearMemoryRegionNoExec (
-  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
-  IN  UINT64                    Length
-  );
-
-EFI_STATUS
-ArmSetMemoryRegionReadOnly (
-  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
-  IN  UINT64                    Length
-  );
-
-EFI_STATUS
-ArmClearMemoryRegionReadOnly (
-  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
-  IN  UINT64                    Length
-  );
-
-#endif /* STANDALONE_MM_MMU_LIB_ */
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (3 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 04/16] ArmPkg: Disavow StandaloneMmMmuLib. It's just ArmMmuLib Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  9:50   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools Bret Barkelew
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel
  Cc: Leif Lindholm, Ard Biesheuvel, Michael D Kinney, Liming Gao,
	Zhiguang Liu, Sami Mujawar, Jiewen Yao, Supreeth Venkatesh,
	Maciej Rabeda, Jiaxin Wu, Siyuan Fu, Ray Ni, Zhichao Gao,
	Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

This aligns better with Mu's philosophy around dependency structuring
and is one of the steps to enable Basecore to have zero CI dependencies
on other Mu repos.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3649

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 {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
 ArmPkg/ArmPkg.dsc                                                                                                                   | 3 +--
 CryptoPkg/CryptoPkg.dsc                                                                                                             | 2 +-
 MdeModulePkg/MdeModulePkg.dsc                                                                                                       | 2 +-
 {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.dsc                                                                                                                   | 1 +
 NetworkPkg/NetworkPkg.dsc                                                                                                           | 2 +-
 ShellPkg/ShellPkg.dsc                                                                                                               | 2 +-
 StandaloneMmPkg/StandaloneMmPkg.dsc                                                                                                 | 2 +-
 UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc                                                                             | 2 +-
 58 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcmp_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memcmp_ms.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c b/MdePkg/Library/CompilerIntrinsicsLib/memcpy.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memcpy.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memmove_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memmove_ms.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c b/MdePkg/Library/CompilerIntrinsicsLib/memset.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memset.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memset.c
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c
rename to MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 59fd8f295d4f..06ede068f99d 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -101,7 +101,7 @@ [LibraryClasses.common.PEIM]
   PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
-  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
 
   # Add support for GCC stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
@@ -109,7 +109,6 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
 [Components.common]
   ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
   ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
-  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
   ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf
   ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
   ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 0aa72ed87846..eab46e4b4fbc 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -74,7 +74,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
   # into all ARM and AARCH64 images.
   #
-  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
 
   # Add support for stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index b1d83461865e..ab505f5bb2c6 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -183,7 +183,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   # This library provides the instrinsic functions generated by a given compiler.
   # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
   #
-  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
 
   #
   # Since software stack checking may be heuristically enabled by the compiler
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S b/MdePkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S
rename to MdePkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/div.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/div.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/div.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/div.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/lasr.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/lasr.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/llsl.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/llsl.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/llsr.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/llsr.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/memmove.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/memmove.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/mullu.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/mullu.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switch.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switch.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switch16.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switch16.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switch32.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switch32.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switch8.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switch8.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uread.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uread.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uread.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uread.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm b/MdePkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm
similarity index 100%
rename from ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm
rename to MdePkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
similarity index 93%
rename from ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
rename to MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
index fcf48c678119..46224f79ea85 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+++ b/MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
@@ -11,7 +11,7 @@
 
 [Defines]
   INF_VERSION                    = 0x00010005
-  BASE_NAME                      = CompilerIntrinsicsLib
+  BASE_NAME                      = ArmCompilerIntrinsicsLib
   FILE_GUID                      = 855274FA-3575-4C20-9709-C031DC5589FA
   MODULE_TYPE                    = BASE
   VERSION_STRING                 = 1.0
@@ -84,7 +84,6 @@ [Sources.AARCH64]
 
 [Packages]
   MdePkg/MdePkg.dec
-  ArmPkg/ArmPkg.dec
 
 [BuildOptions]
   MSFT:*_*_*_CC_FLAGS = /GL-
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index a94959169b2f..cb3907c88b4e 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -183,5 +183,6 @@ [Components.EBC]
 [Components.ARM, Components.AARCH64]
   MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf
   MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+  MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
 
 [BuildOptions]
diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index cf2164aefe25..1c727a9a4bf1 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -75,7 +75,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   # This library provides the instrinsic functions generated by a given compiler.
   # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
   #
-  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
 
diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index 6f0d0929319d..25e8831bf36e 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -69,7 +69,7 @@ [LibraryClasses.ARM,LibraryClasses.AARCH64]
   # This library provides the instrinsic functions generate by a given compiler.
   # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
   #
-  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
 
   # Add support for GCC stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 8012f93b7dcc..2c0c9396d633 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -67,7 +67,7 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM]
   CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
   PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
 
-  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
 
 [LibraryClasses.common.MM_CORE_STANDALONE]
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
index 8adf690098ae..2bbf2398b7e9 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
@@ -37,7 +37,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   # This library provides the instrinsic functions generated by a given compiler.
   # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
   #
-  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
 
   #
   # Since software stack checking may be heuristically enabled by the compiler
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (4 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  9:55   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg Bret Barkelew
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel
  Cc: Leif Lindholm, Ard Biesheuvel, Bob Feng, Liming Gao, Yuwei Chen,
	Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

This aligns better with Mu's philosophy around dependency structuring
and is one of the steps to enable Basecore to have zero CI dependencies
on other Mu repos.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3650

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 {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 ++++++++++---------
 5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.a b/BaseTools/Bin/GccLto/liblto-aarch64.a
similarity index 100%
rename from ArmPkg/Library/GccLto/liblto-aarch64.a
rename to BaseTools/Bin/GccLto/liblto-aarch64.a
diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.s b/BaseTools/Bin/GccLto/liblto-aarch64.s
similarity index 100%
rename from ArmPkg/Library/GccLto/liblto-aarch64.s
rename to BaseTools/Bin/GccLto/liblto-aarch64.s
diff --git a/ArmPkg/Library/GccLto/liblto-arm.a b/BaseTools/Bin/GccLto/liblto-arm.a
similarity index 100%
rename from ArmPkg/Library/GccLto/liblto-arm.a
rename to BaseTools/Bin/GccLto/liblto-arm.a
diff --git a/ArmPkg/Library/GccLto/liblto-arm.s b/BaseTools/Bin/GccLto/liblto-arm.s
similarity index 100%
rename from ArmPkg/Library/GccLto/liblto-arm.s
rename to BaseTools/Bin/GccLto/liblto-arm.s
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 2e6b382ab623..cd8899d24d4a 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -15,7 +15,8 @@
 # 2.00 - Initial version with changes for CI
 #      - Change RC path to use plugin
 #
-#!VERSION=2.00
+# 2.10 - Move GccLto files to a tools path to be more repository layout agnostic
+#!VERSION=2.10
 
 IDENTIFIER = Default TOOL_CHAIN_CONF
 
@@ -2386,10 +2387,10 @@ RELEASE_GCC5_X64_DLINK_FLAGS     = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
 *_GCC5_ARM_CC_XIPFLAGS           = DEF(GCC5_ARM_CC_XIPFLAGS)
 
   DEBUG_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
-  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
+  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
 
 RELEASE_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
-RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
+RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
 
   NOOPT_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -O0
   NOOPT_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -O0
@@ -2420,11 +2421,11 @@ RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
 *_GCC5_AARCH64_CC_XIPFLAGS       = DEF(GCC5_AARCH64_CC_XIPFLAGS)
 
   DEBUG_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
-  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
+  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
   DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
 
 RELEASE_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
-RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
+RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
 RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
 
   NOOPT_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -O0
@@ -2681,11 +2682,11 @@ DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLA
 *_CLANG38_ARM_CC_XIPFLAGS        = DEF(GCC_ARM_CC_XIPFLAGS)
 
   DEBUG_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
-  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
+  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
   NOOPT_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
   NOOPT_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS)
 RELEASE_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
-RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
+RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
 
 ##################
 # CLANG38 AARCH64 definitions
@@ -2727,11 +2728,11 @@ DEFINE CLANG38_AARCH64_DLINK_FLAGS  = DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH6
 *_CLANG38_AARCH64_CC_XIPFLAGS    = DEF(GCC_AARCH64_CC_XIPFLAGS)
 
   DEBUG_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
-  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
+  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
   NOOPT_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
   NOOPT_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS)
 RELEASE_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
-RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
+RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
 
 ####################################################################################
 #
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (5 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  1:52   ` 回复: " gaoliming
  2021-11-02  9:24   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 08/16] MdePkg: Create the MMU access lib to abstract memory protection settings Bret Barkelew
                   ` (9 subsequent siblings)
  16 siblings, 2 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel
  Cc: Leif Lindholm, Ard Biesheuvel, Michael D Kinney, Liming Gao,
	Zhiguang Liu, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 {ArmPkg => MdePkg}/Include/AsmMacroIoLib.h | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/ArmPkg/Include/AsmMacroIoLib.h b/MdePkg/Include/AsmMacroIoLib.h
similarity index 100%
rename from ArmPkg/Include/AsmMacroIoLib.h
rename to MdePkg/Include/AsmMacroIoLib.h
-- 
2.31.1.windows.1


^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH v1 08/16] MdePkg: Create the MMU access lib to abstract memory protection settings
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (6 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-01 19:56 ` [PATCH v1 09/16] MdeModulePkg: Swap to MmuLib instead of Arm-specific lib Bret Barkelew
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

There are a number of Arm-specific accesses that are abstracted
behind this. It may need to be refactored to work better across
architectures.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.c   | 86 ++++++++++++++++++++
 MdePkg/Include/Library/MmuLib.h                  | 75 +++++++++++++++++
 MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf | 28 +++++++
 MdePkg/MdePkg.dec                                |  5 ++
 MdePkg/MdePkg.dsc                                |  2 +
 5 files changed, 196 insertions(+)

diff --git a/MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.c b/MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.c
new file mode 100644
index 000000000000..0398bc03f8f7
--- /dev/null
+++ b/MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.c
@@ -0,0 +1,86 @@
+/** @file
+This lib abstracts some of the MMU accesses currently hardcoded against
+an Arm lib. It's likely that this will need to be refactored at some point.
+
+Copyright (c) Microsoft Corporation.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Uefi.h>
+#include <Library/DebugLib.h>
+
+/**
+  Bitwise sets the memory attributes on a range of memory based on an attributes mask.
+
+  @param  BaseAddress           The start of the range for which to set attributes.
+  @param  Length                The length of the range.
+  @param  Attributes            A bitmask of the attributes to set. See "Physical memory
+                                protection attributes" in UefiSpec.h
+
+  @return EFI_SUCCESS
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuSetAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length,
+  IN  UINT64                    Attributes
+  )
+{
+  DEBUG ((DEBUG_ERROR, "%a() NULL implementation used!\n", __FUNCTION__));
+  ASSERT (FALSE);
+  return EFI_UNSUPPORTED;
+}
+
+
+/**
+  Bitwise clears the memory attributes on a range of memory based on an attributes mask.
+
+  @param  BaseAddress           The start of the range for which to clear attributes.
+  @param  Length                The length of the range.
+  @param  Attributes            A bitmask of the attributes to clear. See "Physical memory
+                                protection attributes" in UefiSpec.h
+
+  @return EFI_SUCCESS
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuClearAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length,
+  IN  UINT64                    Attributes
+  )
+{
+  DEBUG ((DEBUG_ERROR, "%a() NULL implementation used!\n", __FUNCTION__));
+  ASSERT (FALSE);
+  return EFI_UNSUPPORTED;
+}
+
+
+/**
+  Returns the memory attributes on a range of memory.
+
+  @param  BaseAddress           The start of the range for which to set attributes.
+  @param  Attributes            A return pointer for the attributes.
+
+  @return EFI_SUCCESS
+  @return EFI_INVALID_PARAMETER   A return pointer is NULL.
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuGetAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  OUT UINT64                    *Attributes
+  )
+{
+  DEBUG ((DEBUG_ERROR, "%a() NULL implementation used!\n", __FUNCTION__));
+  ASSERT (FALSE);
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdePkg/Include/Library/MmuLib.h b/MdePkg/Include/Library/MmuLib.h
new file mode 100644
index 000000000000..170670f7d52a
--- /dev/null
+++ b/MdePkg/Include/Library/MmuLib.h
@@ -0,0 +1,75 @@
+/** @file
+This lib abstracts some of the MMU accesses currently hardcoded against
+an Arm lib. It's likely that this will need to be refactored at some point.
+
+Copyright (c) Microsoft Corporation.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _MMU_LIB_H_
+#define _MMU_LIB_H_
+
+#include <Uefi.h>
+
+/**
+  Bitwise sets the memory attributes on a range of memory based on an attributes mask.
+
+  @param  BaseAddress           The start of the range for which to set attributes.
+  @param  Length                The length of the range.
+  @param  Attributes            A bitmask of the attributes to set. See "Physical memory
+                                protection attributes" in UefiSpec.h
+
+  @return EFI_SUCCESS
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuSetAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length,
+  IN  UINT64                    Attributes
+  );
+
+
+/**
+  Bitwise clears the memory attributes on a range of memory based on an attributes mask.
+
+  @param  BaseAddress           The start of the range for which to clear attributes.
+  @param  Length                The length of the range.
+  @param  Attributes            A bitmask of the attributes to clear. See "Physical memory
+                                protection attributes" in UefiSpec.h
+
+  @return EFI_SUCCESS
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuClearAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length,
+  IN  UINT64                    Attributes
+  );
+
+
+/**
+  Returns the memory attributes on a range of memory.
+
+  @param  BaseAddress           The start of the range for which to set attributes.
+  @param  Attributes            A return pointer for the attributes.
+
+  @return EFI_SUCCESS
+  @return EFI_INVALID_PARAMETER   A return pointer is NULL.
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuGetAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  OUT UINT64                    *Attributes
+  );
+
+#endif // _MMU_LIB_H_
diff --git a/MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf b/MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
new file mode 100644
index 000000000000..9f1b4422cc04
--- /dev/null
+++ b/MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
@@ -0,0 +1,28 @@
+## @file
+# This lib abstracts some of the MMU accesses currently hardcoded against
+# an Arm lib. It's likely that this will need to be refactored at some point.
+#
+# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+
+[Defines]
+  INF_VERSION         = 0x00010017
+  BASE_NAME           = BaseMmuLibNull
+  FILE_GUID           = 97196A48-00C0-4487-802A-CC5540583EEB
+  VERSION_STRING      = 1.0
+  MODULE_TYPE         = BASE
+  LIBRARY_CLASS       = MmuLib
+
+
+[Sources]
+  BaseMmuLibNull.c
+
+
+[LibraryClasses]
+  DebugLib
+
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 8b18415b107a..43ad9726bf7f 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -267,6 +267,11 @@ [LibraryClasses]
   #
   RegisterFilterLib|Include/Library/RegisterFilterLib.h
 
+  ##  @libraryclass This lib abstracts some of the MMU accesses currently hardcoded against
+  #                 an Arm lib. It's likely that this will need to be refactored at some point.
+  #
+  MmuLib|Include/Library/MmuLib.h
+
 [LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64]
   ##  @libraryclass  Provides services to generate random number.
   #
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index cb3907c88b4e..a9c67b72e4e0 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -131,6 +131,8 @@ [Components]
 
   MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
 
+  MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
+
 [Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
   #
   # Add UEFI Target Based Unit Tests
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 09/16] MdeModulePkg: Swap to MmuLib instead of Arm-specific lib
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (7 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 08/16] MdePkg: Create the MMU access lib to abstract memory protection settings Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-01 19:56 ` [PATCH v1 10/16] StandaloneMmPkg: Switch to the MmuLib abstraction Bret Barkelew
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Liming Gao, Dandan Bi, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c | 4 ++--
 MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf        | 4 +---
 MdeModulePkg/MdeModulePkg.dsc                  | 3 +--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
index 6619a650661b..16c20930a662 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
@@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include "DxeIpl.h"
 
-#include <Library/ArmMmuLib.h>
+#include <Library/MmuLib.h>
 
 /**
    Transfers control to DxeCore.
@@ -40,7 +40,7 @@ HandOffToDxeCore (
   ASSERT (BaseOfStack != NULL);
 
   if (PcdGetBool (PcdSetNxForStack)) {
-    Status = ArmSetMemoryRegionNoExec ((UINTN)BaseOfStack, STACK_SIZE);
+    Status = MmuSetAttributes ((UINTN)BaseOfStack, STACK_SIZE, EFI_MEMORY_XP);
     ASSERT_EFI_ERROR (Status);
   }
 
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index 19b8a4c8aefa..3634d836548f 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -57,8 +57,6 @@ [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
 
-[Packages.ARM, Packages.AARCH64]
-  ArmPkg/ArmPkg.dec
 
 [LibraryClasses]
   PcdLib
@@ -77,7 +75,7 @@ [LibraryClasses]
   PerformanceLib
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
-  ArmMmuLib
+  MmuLib
 
 [Ppis]
   gEfiDxeIplPpiGuid                      ## PRODUCES
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index ab505f5bb2c6..20790145d5bf 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -103,6 +103,7 @@ [LibraryClasses]
   DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.inf
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
+  MmuLib|MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
 
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
@@ -174,8 +175,6 @@ [LibraryClasses.common.MM_STANDALONE]
   MemLib|StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
-  ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
-  ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
   LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
 
   #
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 10/16] StandaloneMmPkg: Switch to the MmuLib abstraction
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (8 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 09/16] MdeModulePkg: Swap to MmuLib instead of Arm-specific lib Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  0:25   ` [edk2-devel] " Yao, Jiewen
  2021-11-01 19:56 ` [PATCH v1 11/16] ArmPkg: Add Basic MMU Lib for Arm silicon Bret Barkelew
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Sami Mujawar, Jiewen Yao, Supreeth Venkatesh,
	Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c | 50 ++++++++++++++++++--
 StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf       |  3 +-
 StandaloneMmPkg/StandaloneMmPkg.dsc                                                                 |  1 +
 3 files changed, 47 insertions(+), 7 deletions(-)

diff --git a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
index ca8b1244a313..ca3b9de26a6f 100644
--- a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
+++ b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
@@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include <PiDxe.h>
 
-#include <Library/ArmMmuLib.h>
+#include <Library/MmuLib.h>
 #include <Library/BaseLib.h>
 #include <Library/BaseMemoryLib.h>
 #include <Library/DebugLib.h>
@@ -163,6 +163,46 @@ UpdatePeCoffPermissions (
   return RETURN_SUCCESS;
 }
 
+STATIC
+EFI_STATUS
+ArmPeSetMemoryRegionNoExec (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length
+  )
+{
+  return MmuSetAttributes (BaseAddress, Length, EFI_MEMORY_XP);
+}
+
+STATIC
+EFI_STATUS
+ArmPeClearMemoryRegionNoExec (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length
+  )
+{
+  return MmuClearAttributes (BaseAddress, Length, EFI_MEMORY_XP);
+}
+
+STATIC
+EFI_STATUS
+ArmPeSetMemoryRegionReadOnly (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length
+  )
+{
+  return MmuSetAttributes (BaseAddress, Length, EFI_MEMORY_RO);
+}
+
+STATIC
+EFI_STATUS
+ArmPeClearMemoryRegionReadOnly (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length
+  )
+{
+  return MmuClearAttributes (BaseAddress, Length, EFI_MEMORY_RO);
+}
+
 /**
   Performs additional actions after a PE/COFF image has been loaded and relocated.
 
@@ -180,8 +220,8 @@ PeCoffLoaderRelocateImageExtraAction (
 {
   UpdatePeCoffPermissions (
     ImageContext,
-    ArmClearMemoryRegionNoExec,
-    ArmSetMemoryRegionReadOnly
+    ArmPeClearMemoryRegionNoExec,
+    ArmPeSetMemoryRegionReadOnly
     );
 }
 
@@ -205,7 +245,7 @@ PeCoffLoaderUnloadImageExtraAction (
 {
   UpdatePeCoffPermissions (
     ImageContext,
-    ArmSetMemoryRegionNoExec,
-    ArmClearMemoryRegionReadOnly
+    ArmPeSetMemoryRegionNoExec,
+    ArmPeClearMemoryRegionReadOnly
     );
 }
diff --git a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
index 89083df679a1..25306dd3e707 100644
--- a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
+++ b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
@@ -27,10 +27,9 @@ [Sources.common]
   AArch64/StandaloneMmPeCoffExtraActionLib.c
 
 [Packages]
-  ArmPkg/ArmPkg.dec
   MdePkg/MdePkg.dec
   StandaloneMmPkg/StandaloneMmPkg.dec
 
 [LibraryClasses]
-  StandaloneMmMmuLib
+  MmuLib
   PcdLib
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 2c0c9396d633..d3e8d250d972 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -59,6 +59,7 @@ [LibraryClasses]
   StandaloneMmCoreEntryPoint|StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
   StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
   VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
+  MmuLib|MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
 
 [LibraryClasses.AARCH64, LibraryClasses.ARM]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 11/16] ArmPkg: Add Basic MMU Lib for Arm silicon
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (9 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 10/16] StandaloneMmPkg: Switch to the MmuLib abstraction Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  9:57   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 12/16] ArmPkg: Move the StandaloneMmCpu driver to ArmPkg Bret Barkelew
                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Sean Brogan

From: Sean Brogan <sean.brogan@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 ArmPkg/Library/MmuLib/MmuLib.c       | 120 ++++++++++++++++++++
 ArmPkg/ArmPkg.dsc                    |   1 +
 ArmPkg/Library/MmuLib/BaseMmuLib.inf |  30 +++++
 3 files changed, 151 insertions(+)

diff --git a/ArmPkg/Library/MmuLib/MmuLib.c b/ArmPkg/Library/MmuLib/MmuLib.c
new file mode 100644
index 000000000000..7a6ba1f81819
--- /dev/null
+++ b/ArmPkg/Library/MmuLib/MmuLib.c
@@ -0,0 +1,120 @@
+/** @file
+This library instance implements a very limited MMU Lib instance
+for the ARM/AARCH64 architectures.  This library shims a common library
+interface to the ArmPkg defined ArmMmuLib.ib.
+
+Copyright (c) Microsoft Corporation.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/MmuLib.h>
+#include <Library/ArmMmuLib.h>
+#include <Library/DebugLib.h>
+
+/**
+  Bitwise sets the memory attributes on a range of memory based on an attributes mask.
+
+  @param  BaseAddress           The start of the range for which to set attributes.
+  @param  Length                The length of the range.
+  @param  Attributes            A bitmask of the attributes to set. See "Physical memory
+                                protection attributes" in UefiSpec.h
+
+  @return EFI_SUCCESS
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuSetAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length,
+  IN  UINT64                    Attributes
+  )
+  {
+    EFI_STATUS Status;
+
+    Status = EFI_UNSUPPORTED;
+
+    if (Attributes & EFI_MEMORY_XP) {
+      Status = ArmSetMemoryRegionNoExec (BaseAddress, Length);
+      if (EFI_ERROR(Status)) {
+        DEBUG((DEBUG_ERROR, "%a - Failed to set NX.  Status = %r\n", __FUNCTION__, Status));
+      }
+    }
+
+    ASSERT_EFI_ERROR(Status);
+    return Status;
+  }
+
+
+/**
+  Bitwise clears the memory attributes on a range of memory based on an attributes mask.
+
+  @param  BaseAddress           The start of the range for which to clear attributes.
+  @param  Length                The length of the range.
+  @param  Attributes            A bitmask of the attributes to clear. See "Physical memory
+                                protection attributes" in UefiSpec.h
+
+  @return EFI_SUCCESS
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuClearAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  IN  UINT64                    Length,
+  IN  UINT64                    Attributes
+  )
+  {
+    EFI_STATUS Status;
+
+    Status = EFI_UNSUPPORTED;
+
+    if (Attributes & EFI_MEMORY_XP) {
+      Status = ArmClearMemoryRegionNoExec (BaseAddress, Length);
+      if (EFI_ERROR(Status)) {
+        DEBUG((DEBUG_ERROR, "%a - Failed to clear NX.  Status = %r\n", __FUNCTION__, Status));
+      }
+    }
+
+    if (Attributes & EFI_MEMORY_RO) {
+      Status = ArmClearMemoryRegionReadOnly(BaseAddress, Length);
+      if (EFI_ERROR(Status)) {
+        DEBUG((DEBUG_ERROR, "%a - Failed to clear RO.  Status = %r\n", __FUNCTION__, Status));
+      }
+    }
+
+    ASSERT_EFI_ERROR(Status);
+    return Status;
+  }
+
+
+/**
+  Returns the memory attributes on a range of memory.
+
+  @param  BaseAddress           The start of the range for which to set attributes.
+  @param  Attributes            A return pointer for the attributes.
+
+  @return EFI_SUCCESS
+  @return EFI_INVALID_PARAMETER   A return pointer is NULL.
+  @return Others
+
+**/
+EFI_STATUS
+EFIAPI
+MmuGetAttributes (
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
+  OUT UINT64                    *Attributes
+  )
+  {
+    EFI_STATUS Status;
+
+    Status = EFI_UNSUPPORTED;
+
+    DEBUG ((DEBUG_ERROR, "%a() API not implemented\n", __FUNCTION__));
+
+    ASSERT_EFI_ERROR(Status);
+    return Status;
+  }
diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 06ede068f99d..cbc67daa7696 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -165,3 +165,4 @@ [Components.AARCH64]
 
 [Components.AARCH64, Components.ARM]
   ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
+  ArmPkg/Library/MmuLib/BaseMmuLib.inf
diff --git a/ArmPkg/Library/MmuLib/BaseMmuLib.inf b/ArmPkg/Library/MmuLib/BaseMmuLib.inf
new file mode 100644
index 000000000000..15095abee9c3
--- /dev/null
+++ b/ArmPkg/Library/MmuLib/BaseMmuLib.inf
@@ -0,0 +1,30 @@
+## @file
+# This library instance implements a very limited MMU Lib instance
+# for the ARM/AARCH64 architectures.  This library shims a common library
+# interface to the ArmPkg defined ArmMmuLib.
+#
+# Copyright (c) Microsoft Corporation.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = MmuLib
+  FILE_GUID                      = 6f2ee9a4-79b3-4b77-9a47-e2bd4b917b75
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = MmuLib
+
+[Sources]
+  MmuLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  ArmPkg/ArmPkg.dec
+
+[LibraryClasses]
+  DebugLib
+  ArmMmuLib
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 12/16] ArmPkg: Move the StandaloneMmCpu driver to ArmPkg
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (10 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 11/16] ArmPkg: Add Basic MMU Lib for Arm silicon Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02 10:00   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 13/16] ArmPkg: Move the StandaloneMmCoreEntryPoint lib " Bret Barkelew
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel
  Cc: Leif Lindholm, Ard Biesheuvel, Sami Mujawar, Jiewen Yao,
	Supreeth Venkatesh, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

This aligns better with Mu's philosophy around dependency structuring
and is one of the steps to enable Basecore to have zero CI dependencies
on other Mu repos.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/EventHandle.c       | 0
 {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.c   | 0
 {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.h   | 0
 {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf | 0
 4 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c b/ArmPkg/Drivers/StandaloneMmCpu/EventHandle.c
similarity index 100%
rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
rename to ArmPkg/Drivers/StandaloneMmCpu/EventHandle.c
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
similarity index 100%
rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
similarity index 100%
rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
similarity index 100%
rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
-- 
2.31.1.windows.1


^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH v1 13/16] ArmPkg: Move the StandaloneMmCoreEntryPoint lib to ArmPkg
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (11 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 12/16] ArmPkg: Move the StandaloneMmCpu driver to ArmPkg Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02 10:00   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 14/16] ArmPkg/Library: Convert StandaloneMmCoreEntryPoint to Arm-only Bret Barkelew
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel
  Cc: Leif Lindholm, Ard Biesheuvel, Sami Mujawar, Jiewen Yao,
	Supreeth Venkatesh, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

This aligns better with Mu's philosophy around dependency structuring
and is one of the steps to enable Basecore to have zero CI dependencies
on other Mu repos.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c              | 0
 {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c             | 0
 {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c | 0
 {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c | 0
 ArmPkg/ArmPkg.ci.yaml                                                                           | 3 ++-
 ArmPkg/ArmPkg.dsc                                                                               | 3 +++
 {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf   | 0
 7 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
similarity index 100%
rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
similarity index 100%
rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
similarity index 100%
rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
similarity index 100%
rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
diff --git a/ArmPkg/ArmPkg.ci.yaml b/ArmPkg/ArmPkg.ci.yaml
index a0d6a75fe881..de6926c82e67 100644
--- a/ArmPkg/ArmPkg.ci.yaml
+++ b/ArmPkg/ArmPkg.ci.yaml
@@ -46,7 +46,8 @@
             "EmbeddedPkg/EmbeddedPkg.dec",
             "MdeModulePkg/MdeModulePkg.dec",
             "MdePkg/MdePkg.dec",
-            "ShellPkg/ShellPkg.dec"
+            "ShellPkg/ShellPkg.dec",
+            "StandaloneMmPkg/StandaloneMmPkg.dec"
         ],
         # For host based unit tests
         "AcceptableDependencies-HOST_APPLICATION":[
diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index cbc67daa7696..4741a93f609a 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -159,6 +159,9 @@ [Components.common]
   ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
   ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
 
+  ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
+  ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+
 [Components.AARCH64]
   ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
   ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
similarity index 100%
rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 14/16] ArmPkg/Library: Convert StandaloneMmCoreEntryPoint to Arm-only
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (12 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 13/16] ArmPkg: Move the StandaloneMmCoreEntryPoint lib " Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02 10:05   ` Leif Lindholm
  2021-11-01 19:56 ` [PATCH v1 15/16] ArmPkg/ArmPkg.dsc: Resolve build errors resulting from package moves Bret Barkelew
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

Drop X64 references. Update GUID.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c | 71 --------------------
 ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf   |  6 +-
 2 files changed, 2 insertions(+), 75 deletions(-)

diff --git a/ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
deleted file mode 100644
index dffa965b8425..000000000000
--- a/ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/** @file
-  Entry point to the Standalone Mm Core.
-
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
-Copyright (c) Microsoft Corporation.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-
-#include <PiMm.h>
-
-#include <Library/StandaloneMmCoreEntryPoint.h>
-#include <Library/DebugLib.h>
-#include <Library/BaseLib.h>
-
-//
-// Cache copy of HobList pointer.
-//
-VOID *gHobList = NULL;
-
-/**
-  The entry point of PE/COFF Image for the STANDALONE MM Core.
-
-  This function is the entry point for the STANDALONE MM Core. This function is required to call
-  ProcessModuleEntryPointList() and ProcessModuleEntryPointList() is never expected to return.
-  The STANDALONE MM Core is responsible for calling ProcessLibraryConstructorList() as soon as the EFI
-  System Table and the image handle for the STANDALONE MM Core itself have been established.
-  If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.
-
-  @param  HobStart  Pointer to the beginning of the HOB List passed in from the PEI Phase.
-
-**/
-VOID
-EFIAPI
-_ModuleEntryPoint (
-  IN VOID  *HobStart
-  )
-{
-  //
-  // Cache a pointer to the HobList
-  //
-  gHobList = HobStart;
-
-  //
-  // Call the Standalone MM Core entry point
-  //
-  ProcessModuleEntryPointList (HobStart);
-
-  //
-  // TODO: Set page table here?? AARCH64 has this step for some reason
-  //
-}
-
-
-/**
-  Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
-
-  This function is required to call _ModuleEntryPoint() passing in HobStart.
-
-  @param  HobStart  Pointer to the beginning of the HOB List passed in from the PEI Phase.
-
-**/
-VOID
-EFIAPI
-EfiMain (
-  IN VOID  *HobStart
-  )
-{
-  _ModuleEntryPoint (HobStart);
-}
diff --git a/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
index a0629cbc1a6f..c6b283653882 100644
--- a/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+++ b/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
@@ -10,8 +10,8 @@
 
 [Defines]
   INF_VERSION                    = 0x0001001A
-  BASE_NAME                      = StandaloneMmCoreEntryPoint
-  FILE_GUID                      = C97AC593-109A-4C63-905C-675FDE2689E8
+  BASE_NAME                      = ArmStandaloneMmCoreEntryPoint
+  FILE_GUID                      = 0D7C6883-E1A8-4A7A-A35C-E0C200775B43
   MODULE_TYPE                    = MM_CORE_STANDALONE
   VERSION_STRING                 = 1.0
   PI_SPECIFICATION_VERSION       = 0x00010032
@@ -26,8 +26,6 @@ [Sources.AARCH64, Sources.ARM]
   Arm/SetPermissions.c
   Arm/CreateHobList.c
 
-[Sources.X64]
-  X64/StandaloneMmCoreEntryPoint.c
 
 [Packages]
   MdePkg/MdePkg.dec
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 15/16] ArmPkg/ArmPkg.dsc: Resolve build errors resulting from package moves
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (13 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 14/16] ArmPkg/Library: Convert StandaloneMmCoreEntryPoint to Arm-only Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-01 19:56 ` [PATCH v1 16/16] ArmPlatformPkg/ArmPlatformPkg.dsc: " Bret Barkelew
  2021-11-02  0:26 ` [edk2-devel] [PATCH v1 00/16] Un-siloing Arm common code Yao, Jiewen
  16 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 ArmPkg/ArmPkg.dsc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 4741a93f609a..add19f7db163 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -93,6 +93,8 @@ [LibraryClasses.common]
 
   OemMiscLib|ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
 
+  ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
+
 [LibraryClasses.common.PEIM]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
@@ -106,6 +108,12 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   # Add support for GCC stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
 
+[LibraryClasses.common.MM_STANDALONE]
+  HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
+  MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
+  MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
+  StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
+
 [Components.common]
   ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
   ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v1 16/16] ArmPlatformPkg/ArmPlatformPkg.dsc: Resolve build errors resulting from package moves
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (14 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 15/16] ArmPkg/ArmPkg.dsc: Resolve build errors resulting from package moves Bret Barkelew
@ 2021-11-01 19:56 ` Bret Barkelew
  2021-11-02  0:26 ` [edk2-devel] [PATCH v1 00/16] Un-siloing Arm common code Yao, Jiewen
  16 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-01 19:56 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Sean Brogan

From: Bret Barkelew <brbarkel@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 ArmPlatformPkg/ArmPlatformPkg.dsc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc
index 661a4cea220d..3ed0bae87c41 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dsc
+++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
@@ -79,6 +79,8 @@ [LibraryClasses.common]
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
 
+  ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
+
 [LibraryClasses.common.PEIM]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
@@ -92,7 +94,7 @@ [LibraryClasses.common.SEC]
   MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf
   PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
 
-[LibraryClasses.AARCH64.MM_STANDALONE]
+[LibraryClasses.common.MM_STANDALONE]
   HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
   MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
   MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [edk2-devel] [PATCH v1 10/16] StandaloneMmPkg: Switch to the MmuLib abstraction
  2021-11-01 19:56 ` [PATCH v1 10/16] StandaloneMmPkg: Switch to the MmuLib abstraction Bret Barkelew
@ 2021-11-02  0:25   ` Yao, Jiewen
  0 siblings, 0 replies; 46+ messages in thread
From: Yao, Jiewen @ 2021-11-02  0:25 UTC (permalink / raw)
  To: devel@edk2.groups.io, bret@corthon.com
  Cc: Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh, Sean Brogan

Acked-by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bret
> Barkelew
> Sent: Tuesday, November 2, 2021 3:57 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Supreeth
> Venkatesh <supreeth.venkatesh@arm.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Subject: [edk2-devel] [PATCH v1 10/16] StandaloneMmPkg: Switch to the
> MmuLib abstraction
> 
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651
> 
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
> 
> StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Stand
> aloneMmPeCoffExtraActionLib.c | 50 ++++++++++++++++++--
> 
> StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMm
> PeCoffExtraActionLib.inf       |  3 +-
>  StandaloneMmPkg/StandaloneMmPkg.dsc                                                                 |
> 1 +
>  3 files changed, 47 insertions(+), 7 deletions(-)
> 
> diff --git
> a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Sta
> ndaloneMmPeCoffExtraActionLib.c
> b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Sta
> ndaloneMmPeCoffExtraActionLib.c
> index ca8b1244a313..ca3b9de26a6f 100644
> ---
> a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Sta
> ndaloneMmPeCoffExtraActionLib.c
> +++
> b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Sta
> ndaloneMmPeCoffExtraActionLib.c
> @@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
>  #include <PiDxe.h>
> 
> 
> 
> -#include <Library/ArmMmuLib.h>
> 
> +#include <Library/MmuLib.h>
> 
>  #include <Library/BaseLib.h>
> 
>  #include <Library/BaseMemoryLib.h>
> 
>  #include <Library/DebugLib.h>
> 
> @@ -163,6 +163,46 @@ UpdatePeCoffPermissions (
>    return RETURN_SUCCESS;
> 
>  }
> 
> 
> 
> +STATIC
> 
> +EFI_STATUS
> 
> +ArmPeSetMemoryRegionNoExec (
> 
> +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> 
> +  IN  UINT64                    Length
> 
> +  )
> 
> +{
> 
> +  return MmuSetAttributes (BaseAddress, Length, EFI_MEMORY_XP);
> 
> +}
> 
> +
> 
> +STATIC
> 
> +EFI_STATUS
> 
> +ArmPeClearMemoryRegionNoExec (
> 
> +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> 
> +  IN  UINT64                    Length
> 
> +  )
> 
> +{
> 
> +  return MmuClearAttributes (BaseAddress, Length, EFI_MEMORY_XP);
> 
> +}
> 
> +
> 
> +STATIC
> 
> +EFI_STATUS
> 
> +ArmPeSetMemoryRegionReadOnly (
> 
> +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> 
> +  IN  UINT64                    Length
> 
> +  )
> 
> +{
> 
> +  return MmuSetAttributes (BaseAddress, Length, EFI_MEMORY_RO);
> 
> +}
> 
> +
> 
> +STATIC
> 
> +EFI_STATUS
> 
> +ArmPeClearMemoryRegionReadOnly (
> 
> +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> 
> +  IN  UINT64                    Length
> 
> +  )
> 
> +{
> 
> +  return MmuClearAttributes (BaseAddress, Length, EFI_MEMORY_RO);
> 
> +}
> 
> +
> 
>  /**
> 
>    Performs additional actions after a PE/COFF image has been loaded and
> relocated.
> 
> 
> 
> @@ -180,8 +220,8 @@ PeCoffLoaderRelocateImageExtraAction (
>  {
> 
>    UpdatePeCoffPermissions (
> 
>      ImageContext,
> 
> -    ArmClearMemoryRegionNoExec,
> 
> -    ArmSetMemoryRegionReadOnly
> 
> +    ArmPeClearMemoryRegionNoExec,
> 
> +    ArmPeSetMemoryRegionReadOnly
> 
>      );
> 
>  }
> 
> 
> 
> @@ -205,7 +245,7 @@ PeCoffLoaderUnloadImageExtraAction (
>  {
> 
>    UpdatePeCoffPermissions (
> 
>      ImageContext,
> 
> -    ArmSetMemoryRegionNoExec,
> 
> -    ArmClearMemoryRegionReadOnly
> 
> +    ArmPeSetMemoryRegionNoExec,
> 
> +    ArmPeClearMemoryRegionReadOnly
> 
>      );
> 
>  }
> 
> diff --git
> a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneM
> mPeCoffExtraActionLib.inf
> b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneM
> mPeCoffExtraActionLib.inf
> index 89083df679a1..25306dd3e707 100644
> ---
> a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneM
> mPeCoffExtraActionLib.inf
> +++
> b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneM
> mPeCoffExtraActionLib.inf
> @@ -27,10 +27,9 @@ [Sources.common]
>    AArch64/StandaloneMmPeCoffExtraActionLib.c
> 
> 
> 
>  [Packages]
> 
> -  ArmPkg/ArmPkg.dec
> 
>    MdePkg/MdePkg.dec
> 
>    StandaloneMmPkg/StandaloneMmPkg.dec
> 
> 
> 
>  [LibraryClasses]
> 
> -  StandaloneMmMmuLib
> 
> +  MmuLib
> 
>    PcdLib
> 
> diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc
> b/StandaloneMmPkg/StandaloneMmPkg.dsc
> index 2c0c9396d633..d3e8d250d972 100644
> --- a/StandaloneMmPkg/StandaloneMmPkg.dsc
> +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
> @@ -59,6 +59,7 @@ [LibraryClasses]
> 
> StandaloneMmCoreEntryPoint|StandaloneMmPkg/Library/StandaloneMmCoreE
> ntryPoint/StandaloneMmCoreEntryPoint.inf
> 
> 
> StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoin
> t/StandaloneMmDriverEntryPoint.inf
> 
> 
> VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependency/V
> ariableMmDependency.inf
> 
> +  MmuLib|MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
> 
> 
> 
>  [LibraryClasses.AARCH64, LibraryClasses.ARM]
> 
>    ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
> 
> --
> 2.31.1.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#83040): https://edk2.groups.io/g/devel/message/83040
> Mute This Topic: https://groups.io/mt/86750657/1772286
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [jiewen.yao@intel.com]
> -=-=-=-=-=-=
> 


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [edk2-devel] [PATCH v1 00/16] Un-siloing Arm common code
  2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
                   ` (15 preceding siblings ...)
  2021-11-01 19:56 ` [PATCH v1 16/16] ArmPlatformPkg/ArmPlatformPkg.dsc: " Bret Barkelew
@ 2021-11-02  0:26 ` Yao, Jiewen
  16 siblings, 0 replies; 46+ messages in thread
From: Yao, Jiewen @ 2021-11-02  0:26 UTC (permalink / raw)
  To: devel@edk2.groups.io, bret@corthon.com

Series: Acked-by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bret
> Barkelew
> Sent: Tuesday, November 2, 2021 3:57 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v1 00/16] Un-siloing Arm common code
> 
> 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.
> 
> 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/ArmPlatformPkg.dsc: 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/StandaloneMmCoreEntryP
> oint.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/StandaloneMmC
> oreEntryPoint.c                                                 |  71 ------------
> 
> StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Stand
> aloneMmPeCoffExtraActionLib.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.i
> nf                                       |   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 => MdePkg}/Include/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/StandaloneMm
> PeCoffExtraActionLib.inf                                       |   3 +-
>  StandaloneMmPkg/StandaloneMmPkg.dsc
> |   3 +-
>  UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
> |   2 +-
>  90 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/StandaloneMmCoreEntryP
> oint.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/StandaloneMmC
> oreEntryPoint.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.i
> nf (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 => MdePkg}/Include/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
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 46+ messages in thread

* 回复: [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg
  2021-11-01 19:56 ` [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg Bret Barkelew
@ 2021-11-02  1:52   ` gaoliming
  2021-11-02  9:24   ` Leif Lindholm
  1 sibling, 0 replies; 46+ messages in thread
From: gaoliming @ 2021-11-02  1:52 UTC (permalink / raw)
  To: 'brbarkel@microsoft.com', devel
  Cc: 'Leif Lindholm', 'Ard Biesheuvel',
	'Michael D Kinney', 'Zhiguang Liu',
	'Sean Brogan'

Bret:
  What modules depend on this header file? Why need to move it from ArmPkg
to MdePkg?

Thanks
Liming
> -----邮件原件-----
> 发件人: brbarkel@microsoft.com <bret@corthon.com>
> 发送时间: 2021年11月2日 3:57
> 收件人: devel@edk2.groups.io
> 抄送: Leif Lindholm <leif@nuviainc.com>; Ard Biesheuvel
> <ardb+tianocore@kernel.org>; Michael D Kinney
> <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>;
> Zhiguang Liu <zhiguang.liu@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> 主题: [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from
> ArmPkg to MdePkg
> 
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  {ArmPkg => MdePkg}/Include/AsmMacroIoLib.h | 0
>  1 file changed, 0 insertions(+), 0 deletions(-)
> 
> diff --git a/ArmPkg/Include/AsmMacroIoLib.h
> b/MdePkg/Include/AsmMacroIoLib.h
> similarity index 100%
> rename from ArmPkg/Include/AsmMacroIoLib.h
> rename to MdePkg/Include/AsmMacroIoLib.h
> --
> 2.31.1.windows.1




^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM
  2021-11-01 19:56 ` [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM Bret Barkelew
@ 2021-11-02  8:43   ` Leif Lindholm
  2021-11-02  8:50     ` [edk2-devel] " ryan.harkin
  2021-11-02  9:26   ` Leif Lindholm
  1 sibling, 1 reply; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  8:43 UTC (permalink / raw)
  To: brbarkel@microsoft.com; +Cc: devel, Ard Biesheuvel, Sean Brogan

Hi Bret,

Is there some overall scope this set is aiming towards, or are these
16 unrelated patches to ArmPkg? Could you send out a cover-letter
separately to clarify?

Best Regards,

Leif

On Mon, Nov 01, 2021 at 12:56:33 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> Not sure what all module types this HAS been validated against, but it
> doesn't work with STANDALONE_MM or STANDALONE_MM_CORE.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> index 2a7e7147958c..d0988b27d582 100644
> --- a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> +++ b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> @@ -13,7 +13,7 @@ [Defines]
>    FILE_GUID                      = da8f0232-fb14-42f0-922c-63104d2c70bd
>    MODULE_TYPE                    = BASE
>    VERSION_STRING                 = 1.0
> -  LIBRARY_CLASS                  = ArmMmuLib
> +  LIBRARY_CLASS                  = ArmMmuLib | DXE_DRIVER PEIM PEI_CORE DXE_CORE DXE_RUNTIME_DRIVER SEC
>  
>  [Defines.AARCH64]
>    CONSTRUCTOR                    = ArmMmuBaseLibConstructor
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [edk2-devel] [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM
  2021-11-02  8:43   ` Leif Lindholm
@ 2021-11-02  8:50     ` ryan.harkin
  2021-11-02  9:03       ` Leif Lindholm
  0 siblings, 1 reply; 46+ messages in thread
From: ryan.harkin @ 2021-11-02  8:50 UTC (permalink / raw)
  To: brbarkel@microsoft.com, devel@edk2.groups.io, leif@nuviainc.com
  Cc: Ard Biesheuvel, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 2964 bytes --]

Hi Leif,

There's a 00/16 in the series with a brief explanation that I'll paste here:

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

Cheers,
Ryan

________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Leif Lindholm via groups.io <leif=nuviainc.com@groups.io>
Sent: 02 November 2021 08:43
To: brbarkel@microsoft.com <bret@corthon.com>
Cc: devel@edk2.groups.io <devel@edk2.groups.io>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Sean Brogan <sean.brogan@microsoft.com>
Subject: Re: [edk2-devel] [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM

Hi Bret,

Is there some overall scope this set is aiming towards, or are these
16 unrelated patches to ArmPkg? Could you send out a cover-letter
separately to clarify?

Best Regards,

Leif

On Mon, Nov 01, 2021 at 12:56:33 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
>
> Not sure what all module types this HAS been validated against, but it
> doesn't work with STANDALONE_MM or STANDALONE_MM_CORE.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> index 2a7e7147958c..d0988b27d582 100644
> --- a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> +++ b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> @@ -13,7 +13,7 @@ [Defines]
>    FILE_GUID                      = da8f0232-fb14-42f0-922c-63104d2c70bd
>    MODULE_TYPE                    = BASE
>    VERSION_STRING                 = 1.0
> -  LIBRARY_CLASS                  = ArmMmuLib
> +  LIBRARY_CLASS                  = ArmMmuLib | DXE_DRIVER PEIM PEI_CORE DXE_CORE DXE_RUNTIME_DRIVER SEC
>
>  [Defines.AARCH64]
>    CONSTRUCTOR                    = ArmMmuBaseLibConstructor
> --
> 2.31.1.windows.1
>





IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 10470 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [edk2-devel] [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM
  2021-11-02  8:50     ` [edk2-devel] " ryan.harkin
@ 2021-11-02  9:03       ` Leif Lindholm
  0 siblings, 0 replies; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:03 UTC (permalink / raw)
  To: Ryan Harkin
  Cc: brbarkel@microsoft.com, devel@edk2.groups.io, Ard Biesheuvel,
	Sean Brogan

On Tue, Nov 02, 2021 at 08:50:05 +0000, Ryan Harkin wrote:
> Hi Leif,
> 
> There's a 00/16 in the series with a brief explanation that I'll paste here:

Ah, I see.
I was cc:d on all the patches, but no one was cc:d on the
cover-letter. Thanks for forwarding!

Probably still for the best if Bret resubmits the cover letter with
all the affected maintainers on cc.

> "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."
> 
> Cheers,
> Ryan
> 
> ________________________________
> From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Leif Lindholm via groups.io <leif=nuviainc.com@groups.io>
> Sent: 02 November 2021 08:43
> To: brbarkel@microsoft.com <bret@corthon.com>
> Cc: devel@edk2.groups.io <devel@edk2.groups.io>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Sean Brogan <sean.brogan@microsoft.com>
> Subject: Re: [edk2-devel] [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM
> 
> Hi Bret,
> 
> Is there some overall scope this set is aiming towards, or are these
> 16 unrelated patches to ArmPkg? Could you send out a cover-letter
> separately to clarify?
> 
> Best Regards,
> 
> Leif
> 
> On Mon, Nov 01, 2021 at 12:56:33 -0700, brbarkel@microsoft.com wrote:
> > From: Bret Barkelew <brbarkel@microsoft.com>
> >
> > Not sure what all module types this HAS been validated against, but it
> > doesn't work with STANDALONE_MM or STANDALONE_MM_CORE.
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647
> >
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> > ---
> >  ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> > index 2a7e7147958c..d0988b27d582 100644
> > --- a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> > +++ b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> > @@ -13,7 +13,7 @@ [Defines]
> >    FILE_GUID                      = da8f0232-fb14-42f0-922c-63104d2c70bd
> >    MODULE_TYPE                    = BASE
> >    VERSION_STRING                 = 1.0
> > -  LIBRARY_CLASS                  = ArmMmuLib
> > +  LIBRARY_CLASS                  = ArmMmuLib | DXE_DRIVER PEIM PEI_CORE DXE_CORE DXE_RUNTIME_DRIVER SEC
> >
> >  [Defines.AARCH64]
> >    CONSTRUCTOR                    = ArmMmuBaseLibConstructor
> > --
> > 2.31.1.windows.1
> >
> 
> 
> 
> 
> 
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg
  2021-11-01 19:56 ` [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg Bret Barkelew
  2021-11-02  1:52   ` 回复: " gaoliming
@ 2021-11-02  9:24   ` Leif Lindholm
  2021-11-02 19:48     ` Bret Barkelew
  1 sibling, 1 reply; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:24 UTC (permalink / raw)
  To: brbarkel@microsoft.com
  Cc: devel, Ard Biesheuvel, Michael D Kinney, Liming Gao, Zhiguang Liu,
	Sean Brogan

On Mon, Nov 01, 2021 at 12:56:39 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  {ArmPkg => MdePkg}/Include/AsmMacroIoLib.h | 0

I approve of this move, but if it goes into MdePkg, it needs some form
of arch-specific handling (like ProcessorBind.h, and indeed for x86,
Nasm.inc).

I also note that the AArch64 version is not moved at the same time.
That seems counterintuituve.

So could you:
Move
ArmPkg/Include/AsmMacroIoLib.h => MdePkg/Include/ARM/AsmMacroIoLib.h
ArmPkg/Include/AsmMacroIoLibV8.h => MdePkg/Include/AArch64/AsmMacroIoLibV8.h
?

Ideally, the AArch64 version should also lose its spectacularly
incorrect suffix, but that can wait for another day due to the
resulting fallout.

Ideally2, the VS .inc files ought to move with the ARM header, but that
feels like a bit much of a can of worms to ask for.

/
    Leif

>  1 file changed, 0 insertions(+), 0 deletions(-)
> 
> diff --git a/ArmPkg/Include/AsmMacroIoLib.h b/MdePkg/Include/AsmMacroIoLib.h
> similarity index 100%
> rename from ArmPkg/Include/AsmMacroIoLib.h
> rename to MdePkg/Include/AsmMacroIoLib.h
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM
  2021-11-01 19:56 ` [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM Bret Barkelew
  2021-11-02  8:43   ` Leif Lindholm
@ 2021-11-02  9:26   ` Leif Lindholm
  1 sibling, 0 replies; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:26 UTC (permalink / raw)
  To: brbarkel@microsoft.com; +Cc: devel, Ard Biesheuvel, Sean Brogan

On Mon, Nov 01, 2021 at 12:56:33 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> Not sure what all module types this HAS been validated against, but it
> doesn't work with STANDALONE_MM or STANDALONE_MM_CORE.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>

Reviewed-by: Leif Lindholm <leif@nuviainc.com>

> ---
>  ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> index 2a7e7147958c..d0988b27d582 100644
> --- a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> +++ b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> @@ -13,7 +13,7 @@ [Defines]
>    FILE_GUID                      = da8f0232-fb14-42f0-922c-63104d2c70bd
>    MODULE_TYPE                    = BASE
>    VERSION_STRING                 = 1.0
> -  LIBRARY_CLASS                  = ArmMmuLib
> +  LIBRARY_CLASS                  = ArmMmuLib | DXE_DRIVER PEIM PEI_CORE DXE_CORE DXE_RUNTIME_DRIVER SEC
>  
>  [Defines.AARCH64]
>    CONSTRUCTOR                    = ArmMmuBaseLibConstructor
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 02/16] ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib
  2021-11-01 19:56 ` [PATCH v1 02/16] ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib Bret Barkelew
@ 2021-11-02  9:34   ` Leif Lindholm
  2021-11-02  9:39     ` Leif Lindholm
  0 siblings, 1 reply; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:34 UTC (permalink / raw)
  To: brbarkel@microsoft.com; +Cc: devel, Ard Biesheuvel, Sean Brogan

On Mon, Nov 01, 2021 at 12:56:34 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647

The reference is good, but please still have a summary in the commit
message.

> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c   | 37 ++++++++++++++++++++
>  ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf |  2 +-
>  2 files changed, 38 insertions(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
> index 20f873e6802c..42216bf40ac7 100644
> --- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
> +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
> @@ -325,3 +325,40 @@ ArmClearMemoryRegionReadOnly (
>    }
>    return Status;
>  }
> +
> +EFI_STATUS
> +EFIAPI
> +ArmConfigureMmu (
> +  IN  ARM_MEMORY_REGION_DESCRIPTOR  *MemoryTable,
> +  OUT VOID                          **TranslationTableBase OPTIONAL,
> +  OUT UINTN                         *TranslationTableSize  OPTIONAL
> +  )
> +{
> +  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
> +  ASSERT (FALSE);
> +  return EFI_UNSUPPORTED;
> +}
> +
> +VOID
> +EFIAPI
> +ArmReplaceLiveTranslationEntry (
> +  IN  UINT64  *Entry,
> +  IN  UINT64  Value,
> +  IN  UINT64  RegionStart
> +  )
> +{
> +  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
> +  ASSERT (FALSE);
> +}
> +
> +EFI_STATUS
> +ArmSetMemoryAttributes (
> +  IN EFI_PHYSICAL_ADDRESS      BaseAddress,
> +  IN UINT64                    Length,
> +  IN UINT64                    Attributes
> +  )
> +{
> +  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
> +  ASSERT (FALSE);
> +  return EFI_UNSUPPORTED;
> +}
> diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> index ff20e5898051..d34086853d32 100644
> --- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> @@ -13,7 +13,7 @@ [Defines]
>    FILE_GUID                      = 44a741c2-655f-41fc-b066-179f5a9aa78a
>    MODULE_TYPE                    = MM_CORE_STANDALONE
>    VERSION_STRING                 = 1.0
> -  LIBRARY_CLASS                  = StandaloneMmMmuLib
> +  LIBRARY_CLASS                  = ArmMmuLib | MM_CORE_STANDALONE MM_STANDALONE

Although clearly an improvement, this hunk does not form part of the
described change. Can you move it to  1/16?
Indeed, if there are more "properly restrict modules to where they
actually work" changes in the set, I'd rather see them all rolled up
into one patch than sprinkled throughout.

/
    Leif

>    PI_SPECIFICATION_VERSION       = 0x00010032
>  
>  [Sources]
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 02/16] ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib
  2021-11-02  9:34   ` Leif Lindholm
@ 2021-11-02  9:39     ` Leif Lindholm
  0 siblings, 0 replies; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:39 UTC (permalink / raw)
  To: brbarkel@microsoft.com; +Cc: devel, Ard Biesheuvel, Sean Brogan

On Tue, Nov 02, 2021 at 09:34:27 +0000, Leif Lindholm wrote:
> On Mon, Nov 01, 2021 at 12:56:34 -0700, brbarkel@microsoft.com wrote:
> > From: Bret Barkelew <brbarkel@microsoft.com>
> > 
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647
> 
> The reference is good, but please still have a summary in the commit
> message.
> 
> > 
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> > ---
> >  ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c   | 37 ++++++++++++++++++++
> >  ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf |  2 +-
> >  2 files changed, 38 insertions(+), 1 deletion(-)
> > 
> > diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
> > index 20f873e6802c..42216bf40ac7 100644
> > --- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
> > +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
> > @@ -325,3 +325,40 @@ ArmClearMemoryRegionReadOnly (
> >    }
> >    return Status;
> >  }
> > +
> > +EFI_STATUS
> > +EFIAPI
> > +ArmConfigureMmu (
> > +  IN  ARM_MEMORY_REGION_DESCRIPTOR  *MemoryTable,
> > +  OUT VOID                          **TranslationTableBase OPTIONAL,
> > +  OUT UINTN                         *TranslationTableSize  OPTIONAL
> > +  )
> > +{
> > +  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
> > +  ASSERT (FALSE);
> > +  return EFI_UNSUPPORTED;
> > +}
> > +
> > +VOID
> > +EFIAPI
> > +ArmReplaceLiveTranslationEntry (
> > +  IN  UINT64  *Entry,
> > +  IN  UINT64  Value,
> > +  IN  UINT64  RegionStart
> > +  )
> > +{
> > +  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
> > +  ASSERT (FALSE);
> > +}
> > +
> > +EFI_STATUS
> > +ArmSetMemoryAttributes (
> > +  IN EFI_PHYSICAL_ADDRESS      BaseAddress,
> > +  IN UINT64                    Length,
> > +  IN UINT64                    Attributes
> > +  )
> > +{
> > +  DEBUG ((DEBUG_ERROR, "%a() interface not implemented!\n", __FUNCTION__));
> > +  ASSERT (FALSE);
> > +  return EFI_UNSUPPORTED;
> > +}
> > diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> > index ff20e5898051..d34086853d32 100644
> > --- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> > +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> > @@ -13,7 +13,7 @@ [Defines]
> >    FILE_GUID                      = 44a741c2-655f-41fc-b066-179f5a9aa78a
> >    MODULE_TYPE                    = MM_CORE_STANDALONE
> >    VERSION_STRING                 = 1.0
> > -  LIBRARY_CLASS                  = StandaloneMmMmuLib
> > +  LIBRARY_CLASS                  = ArmMmuLib | MM_CORE_STANDALONE MM_STANDALONE
> 
> Although clearly an improvement, this hunk does not form part of the
> described change. Can you move it to  1/16?
> Indeed, if there are more "properly restrict modules to where they
> actually work" changes in the set, I'd rather see them all rolled up
> into one patch than sprinkled throughout.

Or, you know, given 4/16, just don't add the restriction that obscures
that you're changing the library class in the first place...

> 
> /
>     Leif
> 
> >    PI_SPECIFICATION_VERSION       = 0x00010032
> >  
> >  [Sources]
> > -- 
> > 2.31.1.windows.1
> > 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 04/16] ArmPkg: Disavow StandaloneMmMmuLib. It's just ArmMmuLib
  2021-11-01 19:56 ` [PATCH v1 04/16] ArmPkg: Disavow StandaloneMmMmuLib. It's just ArmMmuLib Bret Barkelew
@ 2021-11-02  9:39   ` Leif Lindholm
  0 siblings, 0 replies; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:39 UTC (permalink / raw)
  To: brbarkel@microsoft.com; +Cc: devel, Ard Biesheuvel, Sean Brogan

On Mon, Nov 01, 2021 at 12:56:36 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> This extra interface is redundant and unnecessary. Dropping it is
> more EDK2-ish.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3647
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>

Reviewed-by: Leif Lindholm <leif@nuviainc.com>

> ---
>  ArmPkg/ArmPkg.dec                           |  4 ---
>  ArmPkg/Include/Library/StandaloneMmMmuLib.h | 36 --------------------
>  2 files changed, 40 deletions(-)
> 
> diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
> index 9da1bbc9f216..f5c235ecc11b 100644
> --- a/ArmPkg/ArmPkg.dec
> +++ b/ArmPkg/ArmPkg.dec
> @@ -88,10 +88,6 @@ [LibraryClasses.common]
>    #
>    SemihostLib|Include/Library/SemihostLib.h
>  
> -  ##  @libraryclass  Provides an interface for a StandaloneMm Mmu.
> -  #
> -  StandaloneMmMmuLib|Include/Library/StandaloneMmMmuLib.h
> -
>  [Guids.common]
>    gArmTokenSpaceGuid       = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }
>  
> diff --git a/ArmPkg/Include/Library/StandaloneMmMmuLib.h b/ArmPkg/Include/Library/StandaloneMmMmuLib.h
> deleted file mode 100644
> index ccc016d0350a..000000000000
> --- a/ArmPkg/Include/Library/StandaloneMmMmuLib.h
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -/** @file
> -
> -  Copyright (c) 2018, ARM Ltd. All rights reserved.
> -
> -  SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -
> -#ifndef STANDALONE_MM_MMU_LIB_
> -#define STANDALONE_MM_MMU_LIB_
> -
> -EFI_STATUS
> -ArmSetMemoryRegionNoExec (
> -  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> -  IN  UINT64                    Length
> -  );
> -
> -EFI_STATUS
> -ArmClearMemoryRegionNoExec (
> -  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> -  IN  UINT64                    Length
> -  );
> -
> -EFI_STATUS
> -ArmSetMemoryRegionReadOnly (
> -  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> -  IN  UINT64                    Length
> -  );
> -
> -EFI_STATUS
> -ArmClearMemoryRegionReadOnly (
> -  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> -  IN  UINT64                    Length
> -  );
> -
> -#endif /* STANDALONE_MM_MMU_LIB_ */
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg
  2021-11-01 19:56 ` [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg Bret Barkelew
@ 2021-11-02  9:50   ` Leif Lindholm
  2021-11-02 19:44     ` [EXTERNAL] Re: [edk2-devel] " Bret Barkelew
  2021-11-04  6:23     ` 回复: " gaoliming
  0 siblings, 2 replies; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:50 UTC (permalink / raw)
  To: brbarkel@microsoft.com
  Cc: devel, Ard Biesheuvel, Michael D Kinney, Liming Gao, Zhiguang Liu,
	Sami Mujawar, Jiewen Yao, Supreeth Venkatesh, Maciej Rabeda,
	Jiaxin Wu, Siyuan Fu, Ray Ni, Zhichao Gao, Sean Brogan

On Mon, Nov 01, 2021 at 12:56:37 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3649
> 

Only one comment on this patch really.

>  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf => MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf | 3 +--

Could we just keep the .inf name as is?

I think we're getting closer to the x86 folk accepting that they
need this too, rather than keep inventing new dialects of C in the
desperate hope that the compiler won't generate stdlib calls it's
fully permitted to generate whenever it feels like.

/
    Leif

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools
  2021-11-01 19:56 ` [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools Bret Barkelew
@ 2021-11-02  9:55   ` Leif Lindholm
  2021-11-02 19:45     ` [EXTERNAL] Re: [edk2-devel] " Bret Barkelew
  0 siblings, 1 reply; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:55 UTC (permalink / raw)
  To: brbarkel@microsoft.com
  Cc: devel, Ard Biesheuvel, Bob Feng, Liming Gao, Yuwei Chen,
	Sean Brogan

On Mon, Nov 01, 2021 at 12:56:38 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3650
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>

No objections to this for any of my use-cases, but I'd like for one of
the BaseTools maintainers to comment on whether this breaks anything
with regards to EDK_TOOLS_PATH, or if we can finally get rid of that
and replace it with $WORKSPACE/BaseTools globally.

/
    Leif

> ---
>  {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 ++++++++++---------
>  5 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.a b/BaseTools/Bin/GccLto/liblto-aarch64.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.a
> rename to BaseTools/Bin/GccLto/liblto-aarch64.a
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.s b/BaseTools/Bin/GccLto/liblto-aarch64.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.s
> rename to BaseTools/Bin/GccLto/liblto-aarch64.s
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.a b/BaseTools/Bin/GccLto/liblto-arm.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.a
> rename to BaseTools/Bin/GccLto/liblto-arm.a
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.s b/BaseTools/Bin/GccLto/liblto-arm.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.s
> rename to BaseTools/Bin/GccLto/liblto-arm.s
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 2e6b382ab623..cd8899d24d4a 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -15,7 +15,8 @@
>  # 2.00 - Initial version with changes for CI
>  #      - Change RC path to use plugin
>  #
> -#!VERSION=2.00
> +# 2.10 - Move GccLto files to a tools path to be more repository layout agnostic
> +#!VERSION=2.10
>  
>  IDENTIFIER = Default TOOL_CHAIN_CONF
>  
> @@ -2386,10 +2387,10 @@ RELEASE_GCC5_X64_DLINK_FLAGS     = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
>  *_GCC5_ARM_CC_XIPFLAGS           = DEF(GCC5_ARM_CC_XIPFLAGS)
>  
>    DEBUG_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>  
>  RELEASE_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>  
>    NOOPT_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -O0
>    NOOPT_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -O0
> @@ -2420,11 +2421,11 @@ RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
>  *_GCC5_AARCH64_CC_XIPFLAGS       = DEF(GCC5_AARCH64_CC_XIPFLAGS)
>  
>    DEBUG_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
>    DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>  
>  RELEASE_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
>  RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>  
>    NOOPT_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -O0
> @@ -2681,11 +2682,11 @@ DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLA
>  *_CLANG38_ARM_CC_XIPFLAGS        = DEF(GCC_ARM_CC_XIPFLAGS)
>  
>    DEBUG_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> -  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>    NOOPT_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
>    NOOPT_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS)
>  RELEASE_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> -RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>  
>  ##################
>  # CLANG38 AARCH64 definitions
> @@ -2727,11 +2728,11 @@ DEFINE CLANG38_AARCH64_DLINK_FLAGS  = DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH6
>  *_CLANG38_AARCH64_CC_XIPFLAGS    = DEF(GCC_AARCH64_CC_XIPFLAGS)
>  
>    DEBUG_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> -  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> +  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>    NOOPT_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
>    NOOPT_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS)
>  RELEASE_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> -RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> +RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>  
>  ####################################################################################
>  #
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 11/16] ArmPkg: Add Basic MMU Lib for Arm silicon
  2021-11-01 19:56 ` [PATCH v1 11/16] ArmPkg: Add Basic MMU Lib for Arm silicon Bret Barkelew
@ 2021-11-02  9:57   ` Leif Lindholm
  2021-11-02 19:51     ` Bret Barkelew
  0 siblings, 1 reply; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02  9:57 UTC (permalink / raw)
  To: brbarkel@microsoft.com; +Cc: devel, Ard Biesheuvel, Sean Brogan


On Mon, Nov 01, 2021 at 12:56:43 -0700, brbarkel@microsoft.com wrote:
> From: Sean Brogan <sean.brogan@microsoft.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651

Some description please.

> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  ArmPkg/Library/MmuLib/MmuLib.c       | 120 ++++++++++++++++++++
>  ArmPkg/ArmPkg.dsc                    |   1 +
>  ArmPkg/Library/MmuLib/BaseMmuLib.inf |  30 +++++
>  3 files changed, 151 insertions(+)
> 
> diff --git a/ArmPkg/Library/MmuLib/MmuLib.c b/ArmPkg/Library/MmuLib/MmuLib.c
> new file mode 100644
> index 000000000000..7a6ba1f81819
> --- /dev/null
> +++ b/ArmPkg/Library/MmuLib/MmuLib.c
> @@ -0,0 +1,120 @@
> +/** @file
> +This library instance implements a very limited MMU Lib instance
> +for the ARM/AARCH64 architectures.  This library shims a common library
> +interface to the ArmPkg defined ArmMmuLib.ib.

- ib. ?

> +
> +Copyright (c) Microsoft Corporation.
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Library/MmuLib.h>
> +#include <Library/ArmMmuLib.h>
> +#include <Library/DebugLib.h>

Please sort alphabetically.

/
    Leif

> +
> +/**
> +  Bitwise sets the memory attributes on a range of memory based on an attributes mask.
> +
> +  @param  BaseAddress           The start of the range for which to set attributes.
> +  @param  Length                The length of the range.
> +  @param  Attributes            A bitmask of the attributes to set. See "Physical memory
> +                                protection attributes" in UefiSpec.h
> +
> +  @return EFI_SUCCESS
> +  @return Others
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +MmuSetAttributes (
> +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> +  IN  UINT64                    Length,
> +  IN  UINT64                    Attributes
> +  )
> +  {
> +    EFI_STATUS Status;
> +
> +    Status = EFI_UNSUPPORTED;
> +
> +    if (Attributes & EFI_MEMORY_XP) {
> +      Status = ArmSetMemoryRegionNoExec (BaseAddress, Length);
> +      if (EFI_ERROR(Status)) {
> +        DEBUG((DEBUG_ERROR, "%a - Failed to set NX.  Status = %r\n", __FUNCTION__, Status));
> +      }
> +    }
> +
> +    ASSERT_EFI_ERROR(Status);
> +    return Status;
> +  }
> +
> +
> +/**
> +  Bitwise clears the memory attributes on a range of memory based on an attributes mask.
> +
> +  @param  BaseAddress           The start of the range for which to clear attributes.
> +  @param  Length                The length of the range.
> +  @param  Attributes            A bitmask of the attributes to clear. See "Physical memory
> +                                protection attributes" in UefiSpec.h
> +
> +  @return EFI_SUCCESS
> +  @return Others
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +MmuClearAttributes (
> +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> +  IN  UINT64                    Length,
> +  IN  UINT64                    Attributes
> +  )
> +  {
> +    EFI_STATUS Status;
> +
> +    Status = EFI_UNSUPPORTED;
> +
> +    if (Attributes & EFI_MEMORY_XP) {
> +      Status = ArmClearMemoryRegionNoExec (BaseAddress, Length);
> +      if (EFI_ERROR(Status)) {
> +        DEBUG((DEBUG_ERROR, "%a - Failed to clear NX.  Status = %r\n", __FUNCTION__, Status));
> +      }
> +    }
> +
> +    if (Attributes & EFI_MEMORY_RO) {
> +      Status = ArmClearMemoryRegionReadOnly(BaseAddress, Length);
> +      if (EFI_ERROR(Status)) {
> +        DEBUG((DEBUG_ERROR, "%a - Failed to clear RO.  Status = %r\n", __FUNCTION__, Status));
> +      }
> +    }
> +
> +    ASSERT_EFI_ERROR(Status);
> +    return Status;
> +  }
> +
> +
> +/**
> +  Returns the memory attributes on a range of memory.
> +
> +  @param  BaseAddress           The start of the range for which to set attributes.
> +  @param  Attributes            A return pointer for the attributes.
> +
> +  @return EFI_SUCCESS
> +  @return EFI_INVALID_PARAMETER   A return pointer is NULL.
> +  @return Others
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +MmuGetAttributes (
> +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> +  OUT UINT64                    *Attributes
> +  )
> +  {
> +    EFI_STATUS Status;
> +
> +    Status = EFI_UNSUPPORTED;
> +
> +    DEBUG ((DEBUG_ERROR, "%a() API not implemented\n", __FUNCTION__));
> +
> +    ASSERT_EFI_ERROR(Status);
> +    return Status;
> +  }
> diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
> index 06ede068f99d..cbc67daa7696 100644
> --- a/ArmPkg/ArmPkg.dsc
> +++ b/ArmPkg/ArmPkg.dsc
> @@ -165,3 +165,4 @@ [Components.AARCH64]
>  
>  [Components.AARCH64, Components.ARM]
>    ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> +  ArmPkg/Library/MmuLib/BaseMmuLib.inf
> diff --git a/ArmPkg/Library/MmuLib/BaseMmuLib.inf b/ArmPkg/Library/MmuLib/BaseMmuLib.inf
> new file mode 100644
> index 000000000000..15095abee9c3
> --- /dev/null
> +++ b/ArmPkg/Library/MmuLib/BaseMmuLib.inf
> @@ -0,0 +1,30 @@
> +## @file
> +# This library instance implements a very limited MMU Lib instance
> +# for the ARM/AARCH64 architectures.  This library shims a common library
> +# interface to the ArmPkg defined ArmMmuLib.
> +#
> +# Copyright (c) Microsoft Corporation.
> +#
> +# SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010005
> +  BASE_NAME                      = MmuLib
> +  FILE_GUID                      = 6f2ee9a4-79b3-4b77-9a47-e2bd4b917b75
> +  MODULE_TYPE                    = BASE
> +  VERSION_STRING                 = 1.0
> +  LIBRARY_CLASS                  = MmuLib
> +
> +[Sources]
> +  MmuLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  ArmPkg/ArmPkg.dec
> +
> +[LibraryClasses]
> +  DebugLib
> +  ArmMmuLib
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 12/16] ArmPkg: Move the StandaloneMmCpu driver to ArmPkg
  2021-11-01 19:56 ` [PATCH v1 12/16] ArmPkg: Move the StandaloneMmCpu driver to ArmPkg Bret Barkelew
@ 2021-11-02 10:00   ` Leif Lindholm
  2021-11-02 19:53     ` Bret Barkelew
  0 siblings, 1 reply; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02 10:00 UTC (permalink / raw)
  To: brbarkel@microsoft.com
  Cc: devel, Ard Biesheuvel, Sami Mujawar, Jiewen Yao,
	Supreeth Venkatesh, Sean Brogan

On Mon, Nov 01, 2021 at 12:56:44 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652

I much prefer moving things out of ArmPkg (which shouldn't exist),
than moving things into it. Where would be the logical place for this
to go if ARM wasn't so special it needed its own top-level package?

/
    Leif

> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/EventHandle.c       | 0
>  {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.c   | 0
>  {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.h   | 0
>  {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf | 0
>  4 files changed, 0 insertions(+), 0 deletions(-)
> 
> diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c b/ArmPkg/Drivers/StandaloneMmCpu/EventHandle.c
> similarity index 100%
> rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
> rename to ArmPkg/Drivers/StandaloneMmCpu/EventHandle.c
> diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
> similarity index 100%
> rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
> rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
> diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
> similarity index 100%
> rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
> rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
> diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> similarity index 100%
> rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 13/16] ArmPkg: Move the StandaloneMmCoreEntryPoint lib to ArmPkg
  2021-11-01 19:56 ` [PATCH v1 13/16] ArmPkg: Move the StandaloneMmCoreEntryPoint lib " Bret Barkelew
@ 2021-11-02 10:00   ` Leif Lindholm
  0 siblings, 0 replies; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02 10:00 UTC (permalink / raw)
  To: brbarkel@microsoft.com
  Cc: devel, Ard Biesheuvel, Sami Mujawar, Jiewen Yao,
	Supreeth Venkatesh, Sean Brogan

On Mon, Nov 01, 2021 at 12:56:45 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652

(Same comment as for preceding patch.)

/
    Leif

> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c              | 0
>  {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c             | 0
>  {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c | 0
>  {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c | 0
>  ArmPkg/ArmPkg.ci.yaml                                                                           | 3 ++-
>  ArmPkg/ArmPkg.dsc                                                                               | 3 +++
>  {StandaloneMmPkg => ArmPkg}/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf   | 0
>  7 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
> similarity index 100%
> rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
> rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
> similarity index 100%
> rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
> rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
> similarity index 100%
> rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
> rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
> similarity index 100%
> rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
> rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
> diff --git a/ArmPkg/ArmPkg.ci.yaml b/ArmPkg/ArmPkg.ci.yaml
> index a0d6a75fe881..de6926c82e67 100644
> --- a/ArmPkg/ArmPkg.ci.yaml
> +++ b/ArmPkg/ArmPkg.ci.yaml
> @@ -46,7 +46,8 @@
>              "EmbeddedPkg/EmbeddedPkg.dec",
>              "MdeModulePkg/MdeModulePkg.dec",
>              "MdePkg/MdePkg.dec",
> -            "ShellPkg/ShellPkg.dec"
> +            "ShellPkg/ShellPkg.dec",
> +            "StandaloneMmPkg/StandaloneMmPkg.dec"
>          ],
>          # For host based unit tests
>          "AcceptableDependencies-HOST_APPLICATION":[
> diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
> index cbc67daa7696..4741a93f609a 100644
> --- a/ArmPkg/ArmPkg.dsc
> +++ b/ArmPkg/ArmPkg.dsc
> @@ -159,6 +159,9 @@ [Components.common]
>    ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
>    ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
>  
> +  ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> +  ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
> +
>  [Components.AARCH64]
>    ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
>    ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf
> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
> similarity index 100%
> rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
> rename to ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 14/16] ArmPkg/Library: Convert StandaloneMmCoreEntryPoint to Arm-only
  2021-11-01 19:56 ` [PATCH v1 14/16] ArmPkg/Library: Convert StandaloneMmCoreEntryPoint to Arm-only Bret Barkelew
@ 2021-11-02 10:05   ` Leif Lindholm
  0 siblings, 0 replies; 46+ messages in thread
From: Leif Lindholm @ 2021-11-02 10:05 UTC (permalink / raw)
  To: brbarkel@microsoft.com
  Cc: devel, Ard Biesheuvel, Sean Brogan, Sami Mujawar, Jiewen Yao

+ StandaloneMmPkg maintianers - this is their code.

Sami: can you submit a patch to drop Supreeth please?

/
    Leif

On Mon, Nov 01, 2021 at 12:56:46 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
> 
> Drop X64 references. Update GUID.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> ---
>  ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c | 71 --------------------
>  ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf   |  6 +-
>  2 files changed, 2 insertions(+), 75 deletions(-)
> 
> diff --git a/ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c b/ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
> deleted file mode 100644
> index dffa965b8425..000000000000
> --- a/ArmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEntryPoint.c
> +++ /dev/null
> @@ -1,71 +0,0 @@
> -/** @file
> -  Entry point to the Standalone Mm Core.
> -
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> -Copyright (c) Microsoft Corporation.
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -
> -
> -#include <PiMm.h>
> -
> -#include <Library/StandaloneMmCoreEntryPoint.h>
> -#include <Library/DebugLib.h>
> -#include <Library/BaseLib.h>
> -
> -//
> -// Cache copy of HobList pointer.
> -//
> -VOID *gHobList = NULL;
> -
> -/**
> -  The entry point of PE/COFF Image for the STANDALONE MM Core.
> -
> -  This function is the entry point for the STANDALONE MM Core. This function is required to call
> -  ProcessModuleEntryPointList() and ProcessModuleEntryPointList() is never expected to return.
> -  The STANDALONE MM Core is responsible for calling ProcessLibraryConstructorList() as soon as the EFI
> -  System Table and the image handle for the STANDALONE MM Core itself have been established.
> -  If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.
> -
> -  @param  HobStart  Pointer to the beginning of the HOB List passed in from the PEI Phase.
> -
> -**/
> -VOID
> -EFIAPI
> -_ModuleEntryPoint (
> -  IN VOID  *HobStart
> -  )
> -{
> -  //
> -  // Cache a pointer to the HobList
> -  //
> -  gHobList = HobStart;
> -
> -  //
> -  // Call the Standalone MM Core entry point
> -  //
> -  ProcessModuleEntryPointList (HobStart);
> -
> -  //
> -  // TODO: Set page table here?? AARCH64 has this step for some reason
> -  //
> -}
> -
> -
> -/**
> -  Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
> -
> -  This function is required to call _ModuleEntryPoint() passing in HobStart.
> -
> -  @param  HobStart  Pointer to the beginning of the HOB List passed in from the PEI Phase.
> -
> -**/
> -VOID
> -EFIAPI
> -EfiMain (
> -  IN VOID  *HobStart
> -  )
> -{
> -  _ModuleEntryPoint (HobStart);
> -}
> diff --git a/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
> index a0629cbc1a6f..c6b283653882 100644
> --- a/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
> +++ b/ArmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
> @@ -10,8 +10,8 @@
>  
>  [Defines]
>    INF_VERSION                    = 0x0001001A
> -  BASE_NAME                      = StandaloneMmCoreEntryPoint
> -  FILE_GUID                      = C97AC593-109A-4C63-905C-675FDE2689E8
> +  BASE_NAME                      = ArmStandaloneMmCoreEntryPoint
> +  FILE_GUID                      = 0D7C6883-E1A8-4A7A-A35C-E0C200775B43
>    MODULE_TYPE                    = MM_CORE_STANDALONE
>    VERSION_STRING                 = 1.0
>    PI_SPECIFICATION_VERSION       = 0x00010032
> @@ -26,8 +26,6 @@ [Sources.AARCH64, Sources.ARM]
>    Arm/SetPermissions.c
>    Arm/CreateHobList.c
>  
> -[Sources.X64]
> -  X64/StandaloneMmCoreEntryPoint.c
>  
>  [Packages]
>    MdePkg/MdePkg.dec
> -- 
> 2.31.1.windows.1
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg
  2021-11-02  9:50   ` Leif Lindholm
@ 2021-11-02 19:44     ` Bret Barkelew
  2021-11-04  6:23     ` 回复: " gaoliming
  1 sibling, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-02 19:44 UTC (permalink / raw)
  To: devel@edk2.groups.io, Lindholm, Leif, brbarkel@microsoft.com,
	Sean Brogan
  Cc: devel@edk2.groups.io, Ard Biesheuvel, Kinney, Michael D,
	Liming Gao, Zhiguang Liu, Sami Mujawar, Yao, Jiewen,
	Supreeth Venkatesh, Maciej Rabeda, Jiaxin Wu, Siyuan Fu, Ni, Ray,
	Zhichao Gao, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]

I’d be amenable to that. @Sean<mailto:sean.brogan@microsoft.com>?

- Bret

From: Leif Lindholm via groups.io<mailto:leif=nuviainc.com@groups.io>
Sent: Tuesday, November 2, 2021 2:51 AM
To: brbarkel@microsoft.com<mailto:bret@corthon.com>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Ard Biesheuvel<mailto:ardb+tianocore@kernel.org>; Kinney, Michael D<mailto:michael.d.kinney@intel.com>; Liming Gao<mailto:gaoliming@byosoft.com.cn>; Zhiguang Liu<mailto:zhiguang.liu@intel.com>; Sami Mujawar<mailto:sami.mujawar@arm.com>; Yao, Jiewen<mailto:jiewen.yao@intel.com>; Supreeth Venkatesh<mailto:supreeth.venkatesh@arm.com>; Maciej Rabeda<mailto:maciej.rabeda@linux.intel.com>; Jiaxin Wu<mailto:jiaxin.wu@intel.com>; Siyuan Fu<mailto:siyuan.fu@intel.com>; Ni, Ray<mailto:ray.ni@intel.com>; Zhichao Gao<mailto:zhichao.gao@intel.com>; Sean Brogan<mailto:sean.brogan@microsoft.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg

On Mon, Nov 01, 2021 at 12:56:37 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
>
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3649&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C6acadbd5a03f44edf9c408d99de642ee%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714434603817528%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=AmwBKl6uWTs1VYo3Hw3I3RglkhPrWXhKPkobrwQid84%3D&amp;reserved=0
>

Only one comment on this patch really.

>  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf => MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf | 3 +--

Could we just keep the .inf name as is?

I think we're getting closer to the x86 folk accepting that they
need this too, rather than keep inventing new dialects of C in the
desperate hope that the compiler won't generate stdlib calls it's
fully permitted to generate whenever it feels like.

/
    Leif






[-- Attachment #2: Type: text/html, Size: 5035 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools
  2021-11-02  9:55   ` Leif Lindholm
@ 2021-11-02 19:45     ` Bret Barkelew
  2021-11-02 23:34       ` [EXTERNAL] " Andrew Fish
  0 siblings, 1 reply; 46+ messages in thread
From: Bret Barkelew @ 2021-11-02 19:45 UTC (permalink / raw)
  To: devel@edk2.groups.io, Lindholm, Leif, brbarkel@microsoft.com
  Cc: devel@edk2.groups.io, Ard Biesheuvel, Feng, Bob C, Liming Gao,
	Chen, Yuwei, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 9167 bytes --]

Good call. Maintainers, your opinion?

- Bret

From: Leif Lindholm via groups.io<mailto:leif=nuviainc.com@groups.io>
Sent: Tuesday, November 2, 2021 2:55 AM
To: brbarkel@microsoft.com<mailto:bret@corthon.com>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Ard Biesheuvel<mailto:ardb+tianocore@kernel.org>; Feng, Bob C<mailto:bob.c.feng@intel.com>; Liming Gao<mailto:gaoliming@byosoft.com.cn>; Chen, Yuwei<mailto:yuwei.chen@intel.com>; Sean Brogan<mailto:sean.brogan@microsoft.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools

On Mon, Nov 01, 2021 at 12:56:38 -0700, brbarkel@microsoft.com wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
>
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&amp;data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cc9129586336447a44c3908d99de6e1d1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714437251132216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ijjQG1L4fScVxSn5nIBQGrFHLVtNbuTfd0YYLGdw8sg%3D&amp;reserved=0
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>

No objections to this for any of my use-cases, but I'd like for one of
the BaseTools maintainers to comment on whether this breaks anything
with regards to EDK_TOOLS_PATH, or if we can finally get rid of that
and replace it with $WORKSPACE/BaseTools globally.

/
    Leif

> ---
>  {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 ++++++++++---------
>  5 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.a b/BaseTools/Bin/GccLto/liblto-aarch64.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.a
> rename to BaseTools/Bin/GccLto/liblto-aarch64.a
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.s b/BaseTools/Bin/GccLto/liblto-aarch64.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.s
> rename to BaseTools/Bin/GccLto/liblto-aarch64.s
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.a b/BaseTools/Bin/GccLto/liblto-arm.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.a
> rename to BaseTools/Bin/GccLto/liblto-arm.a
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.s b/BaseTools/Bin/GccLto/liblto-arm.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.s
> rename to BaseTools/Bin/GccLto/liblto-arm.s
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 2e6b382ab623..cd8899d24d4a 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -15,7 +15,8 @@
>  # 2.00 - Initial version with changes for CI
>  #      - Change RC path to use plugin
>  #
> -#!VERSION=2.00
> +# 2.10 - Move GccLto files to a tools path to be more repository layout agnostic
> +#!VERSION=2.10
>
>  IDENTIFIER = Default TOOL_CHAIN_CONF
>
> @@ -2386,10 +2387,10 @@ RELEASE_GCC5_X64_DLINK_FLAGS     = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
>  *_GCC5_ARM_CC_XIPFLAGS           = DEF(GCC5_ARM_CC_XIPFLAGS)
>
>    DEBUG_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>  RELEASE_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>    NOOPT_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -O0
>    NOOPT_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -O0
> @@ -2420,11 +2421,11 @@ RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
>  *_GCC5_AARCH64_CC_XIPFLAGS       = DEF(GCC5_AARCH64_CC_XIPFLAGS)
>
>    DEBUG_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
>    DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>
>  RELEASE_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
>  RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>
>    NOOPT_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -O0
> @@ -2681,11 +2682,11 @@ DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLA
>  *_CLANG38_ARM_CC_XIPFLAGS        = DEF(GCC_ARM_CC_XIPFLAGS)
>
>    DEBUG_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> -  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>    NOOPT_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
>    NOOPT_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS)
>  RELEASE_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> -RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>  ##################
>  # CLANG38 AARCH64 definitions
> @@ -2727,11 +2728,11 @@ DEFINE CLANG38_AARCH64_DLINK_FLAGS  = DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH6
>  *_CLANG38_AARCH64_CC_XIPFLAGS    = DEF(GCC_AARCH64_CC_XIPFLAGS)
>
>    DEBUG_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> -  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> +  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>    NOOPT_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
>    NOOPT_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS)
>  RELEASE_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> -RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> +RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>
>  ####################################################################################
>  #
> --
> 2.31.1.windows.1
>






[-- Attachment #2: Type: text/html, Size: 13622 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg
  2021-11-02  9:24   ` Leif Lindholm
@ 2021-11-02 19:48     ` Bret Barkelew
  0 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-02 19:48 UTC (permalink / raw)
  To: Leif Lindholm
  Cc: devel, Ard Biesheuvel, Michael D Kinney, Liming Gao, Zhiguang Liu,
	Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]

Will address. Thanks!

On Tue, Nov 2, 2021 at 2:25 AM Leif Lindholm <leif@nuviainc.com> wrote:

> On Mon, Nov 01, 2021 at 12:56:39 -0700, brbarkel@microsoft.com wrote:
> > From: Bret Barkelew <brbarkel@microsoft.com>
> >
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> > ---
> >  {ArmPkg => MdePkg}/Include/AsmMacroIoLib.h | 0
>
> I approve of this move, but if it goes into MdePkg, it needs some form
> of arch-specific handling (like ProcessorBind.h, and indeed for x86,
> Nasm.inc).
>
> I also note that the AArch64 version is not moved at the same time.
> That seems counterintuituve.
>
> So could you:
> Move
> ArmPkg/Include/AsmMacroIoLib.h => MdePkg/Include/ARM/AsmMacroIoLib.h
> ArmPkg/Include/AsmMacroIoLibV8.h =>
> MdePkg/Include/AArch64/AsmMacroIoLibV8.h
> ?
>
> Ideally, the AArch64 version should also lose its spectacularly
> incorrect suffix, but that can wait for another day due to the
> resulting fallout.
>
> Ideally2, the VS .inc files ought to move with the ARM header, but that
> feels like a bit much of a can of worms to ask for.
>
> /
>     Leif
>
> >  1 file changed, 0 insertions(+), 0 deletions(-)
> >
> > diff --git a/ArmPkg/Include/AsmMacroIoLib.h
> b/MdePkg/Include/AsmMacroIoLib.h
> > similarity index 100%
> > rename from ArmPkg/Include/AsmMacroIoLib.h
> > rename to MdePkg/Include/AsmMacroIoLib.h
> > --
> > 2.31.1.windows.1
> >
>

[-- Attachment #2: Type: text/html, Size: 2761 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 11/16] ArmPkg: Add Basic MMU Lib for Arm silicon
  2021-11-02  9:57   ` Leif Lindholm
@ 2021-11-02 19:51     ` Bret Barkelew
  0 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-02 19:51 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: devel, Ard Biesheuvel, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 6341 bytes --]

Will address.

On Tue, Nov 2, 2021 at 2:57 AM Leif Lindholm <leif@nuviainc.com> wrote:

>
> On Mon, Nov 01, 2021 at 12:56:43 -0700, brbarkel@microsoft.com wrote:
> > From: Sean Brogan <sean.brogan@microsoft.com>
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651
>
> Some description please.
>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> > ---
> >  ArmPkg/Library/MmuLib/MmuLib.c       | 120 ++++++++++++++++++++
> >  ArmPkg/ArmPkg.dsc                    |   1 +
> >  ArmPkg/Library/MmuLib/BaseMmuLib.inf |  30 +++++
> >  3 files changed, 151 insertions(+)
> >
> > diff --git a/ArmPkg/Library/MmuLib/MmuLib.c
> b/ArmPkg/Library/MmuLib/MmuLib.c
> > new file mode 100644
> > index 000000000000..7a6ba1f81819
> > --- /dev/null
> > +++ b/ArmPkg/Library/MmuLib/MmuLib.c
> > @@ -0,0 +1,120 @@
> > +/** @file
> > +This library instance implements a very limited MMU Lib instance
> > +for the ARM/AARCH64 architectures.  This library shims a common library
> > +interface to the ArmPkg defined ArmMmuLib.ib.
>
> - ib. ?
>
> > +
> > +Copyright (c) Microsoft Corporation.
> > +SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#include <Library/MmuLib.h>
> > +#include <Library/ArmMmuLib.h>
> > +#include <Library/DebugLib.h>
>
> Please sort alphabetically.
>
> /
>     Leif
>
> > +
> > +/**
> > +  Bitwise sets the memory attributes on a range of memory based on an
> attributes mask.
> > +
> > +  @param  BaseAddress           The start of the range for which to set
> attributes.
> > +  @param  Length                The length of the range.
> > +  @param  Attributes            A bitmask of the attributes to set. See
> "Physical memory
> > +                                protection attributes" in UefiSpec.h
> > +
> > +  @return EFI_SUCCESS
> > +  @return Others
> > +
> > +**/
> > +EFI_STATUS
> > +EFIAPI
> > +MmuSetAttributes (
> > +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> > +  IN  UINT64                    Length,
> > +  IN  UINT64                    Attributes
> > +  )
> > +  {
> > +    EFI_STATUS Status;
> > +
> > +    Status = EFI_UNSUPPORTED;
> > +
> > +    if (Attributes & EFI_MEMORY_XP) {
> > +      Status = ArmSetMemoryRegionNoExec (BaseAddress, Length);
> > +      if (EFI_ERROR(Status)) {
> > +        DEBUG((DEBUG_ERROR, "%a - Failed to set NX.  Status = %r\n",
> __FUNCTION__, Status));
> > +      }
> > +    }
> > +
> > +    ASSERT_EFI_ERROR(Status);
> > +    return Status;
> > +  }
> > +
> > +
> > +/**
> > +  Bitwise clears the memory attributes on a range of memory based on an
> attributes mask.
> > +
> > +  @param  BaseAddress           The start of the range for which to
> clear attributes.
> > +  @param  Length                The length of the range.
> > +  @param  Attributes            A bitmask of the attributes to clear.
> See "Physical memory
> > +                                protection attributes" in UefiSpec.h
> > +
> > +  @return EFI_SUCCESS
> > +  @return Others
> > +
> > +**/
> > +EFI_STATUS
> > +EFIAPI
> > +MmuClearAttributes (
> > +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> > +  IN  UINT64                    Length,
> > +  IN  UINT64                    Attributes
> > +  )
> > +  {
> > +    EFI_STATUS Status;
> > +
> > +    Status = EFI_UNSUPPORTED;
> > +
> > +    if (Attributes & EFI_MEMORY_XP) {
> > +      Status = ArmClearMemoryRegionNoExec (BaseAddress, Length);
> > +      if (EFI_ERROR(Status)) {
> > +        DEBUG((DEBUG_ERROR, "%a - Failed to clear NX.  Status = %r\n",
> __FUNCTION__, Status));
> > +      }
> > +    }
> > +
> > +    if (Attributes & EFI_MEMORY_RO) {
> > +      Status = ArmClearMemoryRegionReadOnly(BaseAddress, Length);
> > +      if (EFI_ERROR(Status)) {
> > +        DEBUG((DEBUG_ERROR, "%a - Failed to clear RO.  Status = %r\n",
> __FUNCTION__, Status));
> > +      }
> > +    }
> > +
> > +    ASSERT_EFI_ERROR(Status);
> > +    return Status;
> > +  }
> > +
> > +
> > +/**
> > +  Returns the memory attributes on a range of memory.
> > +
> > +  @param  BaseAddress           The start of the range for which to set
> attributes.
> > +  @param  Attributes            A return pointer for the attributes.
> > +
> > +  @return EFI_SUCCESS
> > +  @return EFI_INVALID_PARAMETER   A return pointer is NULL.
> > +  @return Others
> > +
> > +**/
> > +EFI_STATUS
> > +EFIAPI
> > +MmuGetAttributes (
> > +  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,
> > +  OUT UINT64                    *Attributes
> > +  )
> > +  {
> > +    EFI_STATUS Status;
> > +
> > +    Status = EFI_UNSUPPORTED;
> > +
> > +    DEBUG ((DEBUG_ERROR, "%a() API not implemented\n", __FUNCTION__));
> > +
> > +    ASSERT_EFI_ERROR(Status);
> > +    return Status;
> > +  }
> > diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
> > index 06ede068f99d..cbc67daa7696 100644
> > --- a/ArmPkg/ArmPkg.dsc
> > +++ b/ArmPkg/ArmPkg.dsc
> > @@ -165,3 +165,4 @@ [Components.AARCH64]
> >
> >  [Components.AARCH64, Components.ARM]
> >    ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> > +  ArmPkg/Library/MmuLib/BaseMmuLib.inf
> > diff --git a/ArmPkg/Library/MmuLib/BaseMmuLib.inf
> b/ArmPkg/Library/MmuLib/BaseMmuLib.inf
> > new file mode 100644
> > index 000000000000..15095abee9c3
> > --- /dev/null
> > +++ b/ArmPkg/Library/MmuLib/BaseMmuLib.inf
> > @@ -0,0 +1,30 @@
> > +## @file
> > +# This library instance implements a very limited MMU Lib instance
> > +# for the ARM/AARCH64 architectures.  This library shims a common
> library
> > +# interface to the ArmPkg defined ArmMmuLib.
> > +#
> > +# Copyright (c) Microsoft Corporation.
> > +#
> > +# SPDX-License-Identifier: BSD-2-Clause-Patent
> > +#
> > +##
> > +
> > +[Defines]
> > +  INF_VERSION                    = 0x00010005
> > +  BASE_NAME                      = MmuLib
> > +  FILE_GUID                      = 6f2ee9a4-79b3-4b77-9a47-e2bd4b917b75
> > +  MODULE_TYPE                    = BASE
> > +  VERSION_STRING                 = 1.0
> > +  LIBRARY_CLASS                  = MmuLib
> > +
> > +[Sources]
> > +  MmuLib.c
> > +
> > +[Packages]
> > +  MdePkg/MdePkg.dec
> > +  MdeModulePkg/MdeModulePkg.dec
> > +  ArmPkg/ArmPkg.dec
> > +
> > +[LibraryClasses]
> > +  DebugLib
> > +  ArmMmuLib
> > --
> > 2.31.1.windows.1
> >
>

[-- Attachment #2: Type: text/html, Size: 8735 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v1 12/16] ArmPkg: Move the StandaloneMmCpu driver to ArmPkg
  2021-11-02 10:00   ` Leif Lindholm
@ 2021-11-02 19:53     ` Bret Barkelew
  0 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-02 19:53 UTC (permalink / raw)
  To: Leif Lindholm
  Cc: devel, Ard Biesheuvel, Sami Mujawar, Jiewen Yao,
	Supreeth Venkatesh, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 2782 bytes --]

If the implementation didn't make so many calls into Arm-specific libs for
SMC servicing, it could stay right where it is.
It's just that untangling that Gordian knot is outside my ken.

On Tue, Nov 2, 2021 at 3:00 AM Leif Lindholm <leif@nuviainc.com> wrote:

> On Mon, Nov 01, 2021 at 12:56:44 -0700, brbarkel@microsoft.com wrote:
> > From: Bret Barkelew <brbarkel@microsoft.com>
> >
> > This aligns better with Mu's philosophy around dependency structuring
> > and is one of the steps to enable Basecore to have zero CI dependencies
> > on other Mu repos.
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3652
>
> I much prefer moving things out of ArmPkg (which shouldn't exist),
> than moving things into it. Where would be the logical place for this
> to go if ARM wasn't so special it needed its own top-level package?
>
> /
>     Leif
>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
> > ---
> >  {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/EventHandle.c
>  | 0
> >  {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
>  | 0
> >  {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
>  | 0
> >  {StandaloneMmPkg => ArmPkg}/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> | 0
> >  4 files changed, 0 insertions(+), 0 deletions(-)
> >
> > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
> b/ArmPkg/Drivers/StandaloneMmCpu/EventHandle.c
> > similarity index 100%
> > rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
> > rename to ArmPkg/Drivers/StandaloneMmCpu/EventHandle.c
> > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
> b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
> > similarity index 100%
> > rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
> > rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
> > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
> b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
> > similarity index 100%
> > rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
> > rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
> > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> b/ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> > similarity index 100%
> > rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> > rename to ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
> > --
> > 2.31.1.windows.1
> >
>

[-- Attachment #2: Type: text/html, Size: 4075 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools
  2021-11-02 19:45     ` [EXTERNAL] Re: [edk2-devel] " Bret Barkelew
@ 2021-11-02 23:34       ` Andrew Fish
  2021-11-03 11:03         ` Leif Lindholm
  2021-11-03 15:35         ` Bob Feng
  0 siblings, 2 replies; 46+ messages in thread
From: Andrew Fish @ 2021-11-02 23:34 UTC (permalink / raw)
  To: edk2-devel-groups-io, bret.barkelew
  Cc: Lindholm, Leif, brbarkel@microsoft.com, Ard Biesheuvel,
	Feng, Bob C, Liming Gao, Chen, Yuwei, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 10730 bytes --]



> On Nov 2, 2021, at 12:45 PM, Bret Barkelew via groups.io <bret.barkelew=microsoft.com@groups.io> wrote:
> 
> Good call. Maintainers, your opinion?
>  
> - Bret
>  
> From: Leif Lindholm via groups.io <mailto:leif=nuviainc.com@groups.io>
> Sent: Tuesday, November 2, 2021 2:55 AM
> To: brbarkel@microsoft.com <mailto:bret@corthon.com>
> Cc: devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Ard Biesheuvel <mailto:ardb+tianocore@kernel.org>; Feng, Bob C <mailto:bob.c.feng@intel.com>; Liming Gao <mailto:gaoliming@byosoft.com.cn>; Chen, Yuwei <mailto:yuwei.chen@intel.com>; Sean Brogan <mailto:sean.brogan@microsoft.com>
> Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools
>  
> On Mon, Nov 01, 2021 at 12:56:38 -0700, brbarkel@microsoft.com <mailto:brbarkel@microsoft.com> wrote:
> > From: Bret Barkelew <brbarkel@microsoft.com <mailto:brbarkel@microsoft.com>>
> > 
> > This aligns better with Mu's philosophy around dependency structuring
> > and is one of the steps to enable Basecore to have zero CI dependencies
> > on other Mu repos.
> > 
> > REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&amp;data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cc9129586336447a44c3908d99de6e1d1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714437251132216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ijjQG1L4fScVxSn5nIBQGrFHLVtNbuTfd0YYLGdw8sg%3D&amp;reserved=0 <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&amp;data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cc9129586336447a44c3908d99de6e1d1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714437251132216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ijjQG1L4fScVxSn5nIBQGrFHLVtNbuTfd0YYLGdw8sg%3D&amp;reserved=0>
> > 
> > Cc: Leif Lindholm <leif@nuviainc.com <mailto:leif@nuviainc.com>>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org <mailto:ardb+tianocore@kernel.org>>
> > Cc: Bob Feng <bob.c.feng@intel.com <mailto:bob.c.feng@intel.com>>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn>>
> > Cc: Yuwei Chen <yuwei.chen@intel.com <mailto:yuwei.chen@intel.com>>
> > Cc: Sean Brogan <sean.brogan@microsoft.com <mailto:sean.brogan@microsoft.com>>
> > Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com <mailto:bret.barkelew@microsoft.com>>
> 
> No objections to this for any of my use-cases, but I'd like for one of
> the BaseTools maintainers to comment on whether this breaks anything
> with regards to EDK_TOOLS_PATH, or if we can finally get rid of that
> and replace it with $WORKSPACE/BaseTools globally.
> 
> 
Our internal repo uses EDK_TOOLS_PATH. In our case it is $(WORKSPACE)/edk2/BaseTools. We have a PACKAGES_PATH set to $(WORKSPACE)/edk2 and magic happens. 

So I’m thinking maybe:
  $(EDK_TOOLS_PATH)/Bin/GccLto
Vs:
  $(WORKSPACE)/BaseTools/Bin/GccLto

If EDK_TOOLS_PATH gets ripped out, it should be one atomic remove, but let us not stick that on Bret. 

Thanks,

Andrew Fish

> /
>     Leif
> 
> > ---
> >  {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 ++++++++++---------
> >  5 files changed, 10 insertions(+), 9 deletions(-)
> > 
> > diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.a b/BaseTools/Bin/GccLto/liblto-aarch64.a
> > similarity index 100%
> > rename from ArmPkg/Library/GccLto/liblto-aarch64.a
> > rename to BaseTools/Bin/GccLto/liblto-aarch64.a
> > diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.s b/BaseTools/Bin/GccLto/liblto-aarch64.s
> > similarity index 100%
> > rename from ArmPkg/Library/GccLto/liblto-aarch64.s
> > rename to BaseTools/Bin/GccLto/liblto-aarch64.s
> > diff --git a/ArmPkg/Library/GccLto/liblto-arm.a b/BaseTools/Bin/GccLto/liblto-arm.a
> > similarity index 100%
> > rename from ArmPkg/Library/GccLto/liblto-arm.a
> > rename to BaseTools/Bin/GccLto/liblto-arm.a
> > diff --git a/ArmPkg/Library/GccLto/liblto-arm.s b/BaseTools/Bin/GccLto/liblto-arm.s
> > similarity index 100%
> > rename from ArmPkg/Library/GccLto/liblto-arm.s
> > rename to BaseTools/Bin/GccLto/liblto-arm.s
> > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> > index 2e6b382ab623..cd8899d24d4a 100755
> > --- a/BaseTools/Conf/tools_def.template
> > +++ b/BaseTools/Conf/tools_def.template
> > @@ -15,7 +15,8 @@
> >  # 2.00 - Initial version with changes for CI
> >  #      - Change RC path to use plugin
> >  #
> > -#!VERSION=2.00
> > +# 2.10 - Move GccLto files to a tools path to be more repository layout agnostic
> > +#!VERSION=2.10
> >  
> >  IDENTIFIER = Default TOOL_CHAIN_CONF
> >  
> > @@ -2386,10 +2387,10 @@ RELEASE_GCC5_X64_DLINK_FLAGS     = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
> >  *_GCC5_ARM_CC_XIPFLAGS           = DEF(GCC5_ARM_CC_XIPFLAGS)
> >  
> >    DEBUG_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> > -  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> > +  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> >  
> >  RELEASE_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> > -RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> > +RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> >  
> >    NOOPT_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -O0
> >    NOOPT_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -O0
> > @@ -2420,11 +2421,11 @@ RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
> >  *_GCC5_AARCH64_CC_XIPFLAGS       = DEF(GCC5_AARCH64_CC_XIPFLAGS)
> >  
> >    DEBUG_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> > -  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> > +  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> >    DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
> >  
> >  RELEASE_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> > -RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> > +RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> >  RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
> >  
> >    NOOPT_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -O0
> > @@ -2681,11 +2682,11 @@ DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLA
> >  *_CLANG38_ARM_CC_XIPFLAGS        = DEF(GCC_ARM_CC_XIPFLAGS)
> >  
> >    DEBUG_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> > -  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> > +  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> >    NOOPT_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
> >    NOOPT_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS)
> >  RELEASE_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> > -RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> > +RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> >  
> >  ##################
> >  # CLANG38 AARCH64 definitions
> > @@ -2727,11 +2728,11 @@ DEFINE CLANG38_AARCH64_DLINK_FLAGS  = DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH6
> >  *_CLANG38_AARCH64_CC_XIPFLAGS    = DEF(GCC_AARCH64_CC_XIPFLAGS)
> >  
> >    DEBUG_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> > -  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> > +  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> >    NOOPT_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
> >    NOOPT_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS)
> >  RELEASE_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> > -RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> > +RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> >  
> >  ####################################################################################
> >  #
> > -- 
> > 2.31.1.windows.1
> > 
> 
> 
> 
> 
> 
>  
> 


[-- Attachment #2: Type: text/html, Size: 18962 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools
  2021-11-02 23:34       ` [EXTERNAL] " Andrew Fish
@ 2021-11-03 11:03         ` Leif Lindholm
  2021-11-03 15:35         ` Bob Feng
  1 sibling, 0 replies; 46+ messages in thread
From: Leif Lindholm @ 2021-11-03 11:03 UTC (permalink / raw)
  To: devel, afish
  Cc: bret.barkelew, brbarkel@microsoft.com, Ard Biesheuvel,
	Feng, Bob C, Liming Gao, Chen, Yuwei, Sean Brogan

On Tue, Nov 02, 2021 at 16:34:15 -0700, Andrew Fish via groups.io wrote:
> > No objections to this for any of my use-cases, but I'd like for one of
> > the BaseTools maintainers to comment on whether this breaks anything
> > with regards to EDK_TOOLS_PATH, or if we can finally get rid of that
> > and replace it with $WORKSPACE/BaseTools globally.
> > 
> > 
> Our internal repo uses EDK_TOOLS_PATH. In our case it is
> $(WORKSPACE)/edk2/BaseTools. We have a PACKAGES_PATH set to
> $(WORKSPACE)/edk2 and magic happens.
> 
> So I’m thinking maybe:
>   $(EDK_TOOLS_PATH)/Bin/GccLto
> Vs:
>   $(WORKSPACE)/BaseTools/Bin/GccLto
> 
> If EDK_TOOLS_PATH gets ripped out, it should be one atomic remove,
> but let us not stick that on Bret.

Agreed. I'd be happy with your proposed solution.

/
    Leif

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools
  2021-11-02 23:34       ` [EXTERNAL] " Andrew Fish
  2021-11-03 11:03         ` Leif Lindholm
@ 2021-11-03 15:35         ` Bob Feng
  2021-11-03 16:08           ` Bret Barkelew
  1 sibling, 1 reply; 46+ messages in thread
From: Bob Feng @ 2021-11-03 15:35 UTC (permalink / raw)
  To: Andrew Fish, edk2-devel-groups-io, bret.barkelew@microsoft.com
  Cc: Lindholm, Leif, brbarkel@microsoft.com, Ard Biesheuvel,
	Liming Gao, Chen, Christine, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 10933 bytes --]

I’d prefer to use EDK_TOOLS_PATH. Because of PACKAGES_PATH, the relative path does not depend on the WORKSPACE, the WORKSPACE can be set to anywhere. So we can’t assume the BaseTools is under WORKSPACE. But EDK_TOOLS_PATH always points to edk2/BaseTools.

This patch does not break any of the use-cases on my side.

Thanks,
Bob

From: Andrew Fish <afish@apple.com>
Sent: Wednesday, November 3, 2021 7:34 AM
To: edk2-devel-groups-io <devel@edk2.groups.io>; bret.barkelew@microsoft.com
Cc: Lindholm, Leif <leif@nuviainc.com>; brbarkel@microsoft.com <bret@corthon.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools




On Nov 2, 2021, at 12:45 PM, Bret Barkelew via groups.io<http://groups.io> <bret.barkelew=microsoft.com@groups.io<mailto:bret.barkelew=microsoft.com@groups.io>> wrote:

Good call. Maintainers, your opinion?

- Bret

From: Leif Lindholm via groups.io<mailto:leif=nuviainc.com@groups.io>
Sent: Tuesday, November 2, 2021 2:55 AM
To: brbarkel@microsoft.com<mailto:bret@corthon.com>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Ard Biesheuvel<mailto:ardb+tianocore@kernel.org>; Feng, Bob C<mailto:bob.c.feng@intel.com>; Liming Gao<mailto:gaoliming@byosoft.com.cn>; Chen, Yuwei<mailto:yuwei.chen@intel.com>; Sean Brogan<mailto:sean.brogan@microsoft.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools

On Mon, Nov 01, 2021 at 12:56:38 -0700, brbarkel@microsoft.com<mailto:brbarkel@microsoft.com> wrote:
> From: Bret Barkelew <brbarkel@microsoft.com<mailto:brbarkel@microsoft.com>>
>
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&amp;data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cc9129586336447a44c3908d99de6e1d1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714437251132216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ijjQG1L4fScVxSn5nIBQGrFHLVtNbuTfd0YYLGdw8sg%3D&amp;reserved=0
>
> Cc: Leif Lindholm <leif@nuviainc.com<mailto:leif@nuviainc.com>>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org<mailto:ardb+tianocore@kernel.org>>
> Cc: Bob Feng <bob.c.feng@intel.com<mailto:bob.c.feng@intel.com>>
> Cc: Liming Gao <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>
> Cc: Yuwei Chen <yuwei.chen@intel.com<mailto:yuwei.chen@intel.com>>
> Cc: Sean Brogan <sean.brogan@microsoft.com<mailto:sean.brogan@microsoft.com>>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com<mailto:bret.barkelew@microsoft.com>>

No objections to this for any of my use-cases, but I'd like for one of
the BaseTools maintainers to comment on whether this breaks anything
with regards to EDK_TOOLS_PATH, or if we can finally get rid of that
and replace it with $WORKSPACE/BaseTools globally.
Our internal repo uses EDK_TOOLS_PATH. In our case it is $(WORKSPACE)/edk2/BaseTools. We have a PACKAGES_PATH set to $(WORKSPACE)/edk2 and magic happens.

So I’m thinking maybe:
  $(EDK_TOOLS_PATH)/Bin/GccLto
Vs:
  $(WORKSPACE)/BaseTools/Bin/GccLto

If EDK_TOOLS_PATH gets ripped out, it should be one atomic remove, but let us not stick that on Bret.

Thanks,

Andrew Fish


/
    Leif

> ---
>  {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 ++++++++++---------
>  5 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.a b/BaseTools/Bin/GccLto/liblto-aarch64.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.a
> rename to BaseTools/Bin/GccLto/liblto-aarch64.a
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.s b/BaseTools/Bin/GccLto/liblto-aarch64.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.s
> rename to BaseTools/Bin/GccLto/liblto-aarch64.s
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.a b/BaseTools/Bin/GccLto/liblto-arm.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.a
> rename to BaseTools/Bin/GccLto/liblto-arm.a
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.s b/BaseTools/Bin/GccLto/liblto-arm.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.s
> rename to BaseTools/Bin/GccLto/liblto-arm.s
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 2e6b382ab623..cd8899d24d4a 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -15,7 +15,8 @@
>  # 2.00 - Initial version with changes for CI
>  #      - Change RC path to use plugin
>  #
> -#!VERSION=2.00
> +# 2.10 - Move GccLto files to a tools path to be more repository layout agnostic
> +#!VERSION=2.10
>
>  IDENTIFIER = Default TOOL_CHAIN_CONF
>
> @@ -2386,10 +2387,10 @@ RELEASE_GCC5_X64_DLINK_FLAGS     = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
>  *_GCC5_ARM_CC_XIPFLAGS           = DEF(GCC5_ARM_CC_XIPFLAGS)
>
>    DEBUG_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>  RELEASE_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>    NOOPT_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -O0
>    NOOPT_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -O0
> @@ -2420,11 +2421,11 @@ RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
>  *_GCC5_AARCH64_CC_XIPFLAGS       = DEF(GCC5_AARCH64_CC_XIPFLAGS)
>
>    DEBUG_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
>    DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>
>  RELEASE_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
>  RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>
>    NOOPT_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -O0
> @@ -2681,11 +2682,11 @@ DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLA
>  *_CLANG38_ARM_CC_XIPFLAGS        = DEF(GCC_ARM_CC_XIPFLAGS)
>
>    DEBUG_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> -  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>    NOOPT_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
>    NOOPT_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS)
>  RELEASE_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> -RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>  ##################
>  # CLANG38 AARCH64 definitions
> @@ -2727,11 +2728,11 @@ DEFINE CLANG38_AARCH64_DLINK_FLAGS  = DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH6
>  *_CLANG38_AARCH64_CC_XIPFLAGS    = DEF(GCC_AARCH64_CC_XIPFLAGS)
>
>    DEBUG_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> -  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> +  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>    NOOPT_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
>    NOOPT_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS)
>  RELEASE_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> -RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> +RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>
>  ####################################################################################
>  #
> --
> 2.31.1.windows.1
>









[-- Attachment #2: Type: text/html, Size: 19598 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools
  2021-11-03 15:35         ` Bob Feng
@ 2021-11-03 16:08           ` Bret Barkelew
  0 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-03 16:08 UTC (permalink / raw)
  To: Feng, Bob C, Andrew Fish, edk2-devel-groups-io
  Cc: Lindholm, Leif, brbarkel@microsoft.com, Ard Biesheuvel,
	Liming Gao, Chen, Yuwei, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 12459 bytes --]

Sounds good. Will update in v3.

- Bret
________________________________
From: Feng, Bob C <bob.c.feng@intel.com>
Sent: Wednesday, November 3, 2021 8:35:33 AM
To: Andrew Fish <afish@apple.com>; edk2-devel-groups-io <devel@edk2.groups.io>; Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Lindholm, Leif <leif@nuviainc.com>; brbarkel@microsoft.com <bret@corthon.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Yuwei <yuwei.chen@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
Subject: RE: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools


I’d prefer to use EDK_TOOLS_PATH. Because of PACKAGES_PATH, the relative path does not depend on the WORKSPACE, the WORKSPACE can be set to anywhere. So we can’t assume the BaseTools is under WORKSPACE. But EDK_TOOLS_PATH always points to edk2/BaseTools.



This patch does not break any of the use-cases on my side.



Thanks,

Bob



From: Andrew Fish <afish@apple.com>
Sent: Wednesday, November 3, 2021 7:34 AM
To: edk2-devel-groups-io <devel@edk2.groups.io>; bret.barkelew@microsoft.com
Cc: Lindholm, Leif <leif@nuviainc.com>; brbarkel@microsoft.com <bret@corthon.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools







On Nov 2, 2021, at 12:45 PM, Bret Barkelew via groups.io<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.io%2F&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C06f295b9903a44c7b8d408d99edff565%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637715507056865024%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7IeYGfQir8xUiKwmZ9N%2BTsiLRc8%2F03Rzsr%2FwJ08qmvQ%3D&reserved=0> <bret.barkelew=microsoft.com@groups.io<mailto:bret.barkelew=microsoft.com@groups.io>> wrote:



Good call. Maintainers, your opinion?



- Bret



From: Leif Lindholm via groups.io<mailto:leif=nuviainc.com@groups.io>
Sent: Tuesday, November 2, 2021 2:55 AM
To: brbarkel@microsoft.com<mailto:bret@corthon.com>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Ard Biesheuvel<mailto:ardb+tianocore@kernel.org>; Feng, Bob C<mailto:bob.c.feng@intel.com>; Liming Gao<mailto:gaoliming@byosoft.com.cn>; Chen, Yuwei<mailto:yuwei.chen@intel.com>; Sean Brogan<mailto:sean.brogan@microsoft.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools



On Mon, Nov 01, 2021 at 12:56:38 -0700, brbarkel@microsoft.com<mailto:brbarkel@microsoft.com> wrote:
> From: Bret Barkelew <brbarkel@microsoft.com<mailto:brbarkel@microsoft.com>>
>
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&amp;data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cc9129586336447a44c3908d99de6e1d1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714437251132216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ijjQG1L4fScVxSn5nIBQGrFHLVtNbuTfd0YYLGdw8sg%3D&amp;reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C06f295b9903a44c7b8d408d99edff565%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637715507056865024%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=oBOJo5g2DzNrgu2Py0sjxAd%2BHekQBxrlDylc%2BkIwEow%3D&reserved=0>
>
> Cc: Leif Lindholm <leif@nuviainc.com<mailto:leif@nuviainc.com>>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org<mailto:ardb+tianocore@kernel.org>>
> Cc: Bob Feng <bob.c.feng@intel.com<mailto:bob.c.feng@intel.com>>
> Cc: Liming Gao <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>
> Cc: Yuwei Chen <yuwei.chen@intel.com<mailto:yuwei.chen@intel.com>>
> Cc: Sean Brogan <sean.brogan@microsoft.com<mailto:sean.brogan@microsoft.com>>
> Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com<mailto:bret.barkelew@microsoft.com>>

No objections to this for any of my use-cases, but I'd like for one of
the BaseTools maintainers to comment on whether this breaks anything
with regards to EDK_TOOLS_PATH, or if we can finally get rid of that
and replace it with $WORKSPACE/BaseTools globally.

Our internal repo uses EDK_TOOLS_PATH. In our case it is $(WORKSPACE)/edk2/BaseTools. We have a PACKAGES_PATH set to $(WORKSPACE)/edk2 and magic happens.



So I’m thinking maybe:

  $(EDK_TOOLS_PATH)/Bin/GccLto

Vs:

  $(WORKSPACE)/BaseTools/Bin/GccLto



If EDK_TOOLS_PATH gets ripped out, it should be one atomic remove, but let us not stick that on Bret.



Thanks,



Andrew Fish



/
    Leif

> ---
>  {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 ++++++++++---------
>  5 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.a b/BaseTools/Bin/GccLto/liblto-aarch64.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.a
> rename to BaseTools/Bin/GccLto/liblto-aarch64.a
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.s b/BaseTools/Bin/GccLto/liblto-aarch64.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.s
> rename to BaseTools/Bin/GccLto/liblto-aarch64.s
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.a b/BaseTools/Bin/GccLto/liblto-arm.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.a
> rename to BaseTools/Bin/GccLto/liblto-arm.a
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.s b/BaseTools/Bin/GccLto/liblto-arm.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.s
> rename to BaseTools/Bin/GccLto/liblto-arm.s
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 2e6b382ab623..cd8899d24d4a 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -15,7 +15,8 @@
>  # 2.00 - Initial version with changes for CI
>  #      - Change RC path to use plugin
>  #
> -#!VERSION=2.00
> +# 2.10 - Move GccLto files to a tools path to be more repository layout agnostic
> +#!VERSION=2.10
>
>  IDENTIFIER = Default TOOL_CHAIN_CONF
>
> @@ -2386,10 +2387,10 @@ RELEASE_GCC5_X64_DLINK_FLAGS     = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
>  *_GCC5_ARM_CC_XIPFLAGS           = DEF(GCC5_ARM_CC_XIPFLAGS)
>
>    DEBUG_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>  RELEASE_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>    NOOPT_GCC5_ARM_CC_FLAGS        = DEF(GCC5_ARM_CC_FLAGS) -O0
>    NOOPT_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -O0
> @@ -2420,11 +2421,11 @@ RELEASE_GCC5_ARM_DLINK_FLAGS     = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
>  *_GCC5_AARCH64_CC_XIPFLAGS       = DEF(GCC5_AARCH64_CC_XIPFLAGS)
>
>    DEBUG_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +  DEBUG_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
>    DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>
>  RELEASE_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
> +RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch
>  RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>
>    NOOPT_GCC5_AARCH64_CC_FLAGS    = DEF(GCC5_AARCH64_CC_FLAGS) -O0
> @@ -2681,11 +2682,11 @@ DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLA
>  *_CLANG38_ARM_CC_XIPFLAGS        = DEF(GCC_ARM_CC_XIPFLAGS)
>
>    DEBUG_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> -  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>    NOOPT_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
>    NOOPT_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS)
>  RELEASE_CLANG38_ARM_CC_FLAGS     = DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> -RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_CLANG38_ARM_DLINK_FLAGS  = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
>  ##################
>  # CLANG38 AARCH64 definitions
> @@ -2727,11 +2728,11 @@ DEFINE CLANG38_AARCH64_DLINK_FLAGS  = DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH6
>  *_CLANG38_AARCH64_CC_XIPFLAGS    = DEF(GCC_AARCH64_CC_XIPFLAGS)
>
>    DEBUG_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
> -  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> +  DEBUG_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>    NOOPT_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -O0
>    NOOPT_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS)
>  RELEASE_CLANG38_AARCH64_CC_FLAGS    = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
> -RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
> +RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>
>  ####################################################################################
>  #
> --
> 2.31.1.windows.1
>












[-- Attachment #2: Type: text/html, Size: 20242 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* 回复: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg
  2021-11-02  9:50   ` Leif Lindholm
  2021-11-02 19:44     ` [EXTERNAL] Re: [edk2-devel] " Bret Barkelew
@ 2021-11-04  6:23     ` gaoliming
  2021-11-04  6:24       ` Andrew Fish
  1 sibling, 1 reply; 46+ messages in thread
From: gaoliming @ 2021-11-04  6:23 UTC (permalink / raw)
  To: devel, leif, 'brbarkel@microsoft.com'
  Cc: 'Ard Biesheuvel', 'Michael D Kinney',
	'Zhiguang Liu', 'Sami Mujawar',
	'Jiewen Yao', 'Supreeth Venkatesh',
	'Maciej Rabeda', 'Jiaxin Wu', 'Siyuan Fu',
	'Ray Ni', 'Zhichao Gao', 'Sean Brogan'

Lefi:

> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Leif Lindholm
> 发送时间: 2021年11月2日 17:51
> 收件人: brbarkel@microsoft.com <bret@corthon.com>
> 抄送: devel@edk2.groups.io; Ard Biesheuvel <ardb+tianocore@kernel.org>;
> Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Sami
> Mujawar <sami.mujawar@arm.com>; Jiewen Yao <jiewen.yao@intel.com>;
> Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Maciej Rabeda
> <maciej.rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan
> Fu <siyuan.fu@intel.com>; Ray Ni <ray.ni@intel.com>; Zhichao Gao
> <zhichao.gao@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
> 主题: Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm
> CompilerIntrinsicsLib to MdePkg
> 
> On Mon, Nov 01, 2021 at 12:56:37 -0700, brbarkel@microsoft.com wrote:
> > From: Bret Barkelew <brbarkel@microsoft.com>
> >
> > This aligns better with Mu's philosophy around dependency structuring
> > and is one of the steps to enable Basecore to have zero CI dependencies
> > on other Mu repos.
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3649
> >
> 
> Only one comment on this patch really.
> 
> >  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf =>
> MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf | 3 +--
> 
> Could we just keep the .inf name as is?
> 
I agree your suggestion. CompilerIntrinsicsLib can support X86 in future.
So, 
CompilerIntrinsicsLib.inf should be used. 

Thanks
Liming

> I think we're getting closer to the x86 folk accepting that they
> need this too, rather than keep inventing new dialects of C in the
> desperate hope that the compiler won't generate stdlib calls it's
> fully permitted to generate whenever it feels like.
> 
> /
>     Leif
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg
  2021-11-04  6:23     ` 回复: " gaoliming
@ 2021-11-04  6:24       ` Andrew Fish
  2021-11-04 17:23         ` Bret Barkelew
  0 siblings, 1 reply; 46+ messages in thread
From: Andrew Fish @ 2021-11-04  6:24 UTC (permalink / raw)
  To: edk2-devel-groups-io, Liming Gao
  Cc: Lindholm, Leif, brbarkel@microsoft.com, Ard Biesheuvel,
	Mike Kinney, Zhiguang Liu, Sami Mujawar, Jiewen Yao,
	Supreeth Venkatesh, Maciej Rabeda, Jiaxin Wu, Siyuan Fu, Ray Ni,
	Zhichao Gao, Sean Brogan



> On Nov 3, 2021, at 11:23 PM, gaoliming <gaoliming@byosoft.com.cn> wrote:
> 
> Lefi:
> 
>> -----邮件原件-----
>> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Leif Lindholm
>> 发送时间: 2021年11月2日 17:51
>> 收件人: brbarkel@microsoft.com <bret@corthon.com>
>> 抄送: devel@edk2.groups.io; Ard Biesheuvel <ardb+tianocore@kernel.org>;
>> Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
>> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Sami
>> Mujawar <sami.mujawar@arm.com>; Jiewen Yao <jiewen.yao@intel.com>;
>> Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Maciej Rabeda
>> <maciej.rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan
>> Fu <siyuan.fu@intel.com>; Ray Ni <ray.ni@intel.com>; Zhichao Gao
>> <zhichao.gao@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
>> 主题: Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm
>> CompilerIntrinsicsLib to MdePkg
>> 
>> On Mon, Nov 01, 2021 at 12:56:37 -0700, brbarkel@microsoft.com wrote:
>>> From: Bret Barkelew <brbarkel@microsoft.com>
>>> 
>>> This aligns better with Mu's philosophy around dependency structuring
>>> and is one of the steps to enable Basecore to have zero CI dependencies
>>> on other Mu repos.
>>> 
>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3649
>>> 
>> 
>> Only one comment on this patch really.
>> 
>>> ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf =>
>> MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf | 3 +--
>> 
>> Could we just keep the .inf name as is?
>> 
> I agree your suggestion. CompilerIntrinsicsLib can support X86 in future.
> So, 
> CompilerIntrinsicsLib.inf should be used. 
> 

+1

Thanks,

Andrew Fish

> Thanks
> Liming
> 
>> I think we're getting closer to the x86 folk accepting that they
>> need this too, rather than keep inventing new dialects of C in the
>> desperate hope that the compiler won't generate stdlib calls it's
>> fully permitted to generate whenever it feels like.
>> 
>> /
>>    Leif
>> 
>> 
>> 
>> 
> 
> 
> 
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg
  2021-11-04  6:24       ` Andrew Fish
@ 2021-11-04 17:23         ` Bret Barkelew
  0 siblings, 0 replies; 46+ messages in thread
From: Bret Barkelew @ 2021-11-04 17:23 UTC (permalink / raw)
  To: Andrew Fish
  Cc: edk2-devel-groups-io, Liming Gao, Lindholm, Leif, Ard Biesheuvel,
	Mike Kinney, Zhiguang Liu, Sami Mujawar, Jiewen Yao,
	Supreeth Venkatesh, Maciej Rabeda, Jiaxin Wu, Siyuan Fu, Ray Ni,
	Zhichao Gao, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 2371 bytes --]

Will address.

On Wed, Nov 3, 2021 at 11:24 PM Andrew Fish <afish@apple.com> wrote:

>
>
> > On Nov 3, 2021, at 11:23 PM, gaoliming <gaoliming@byosoft.com.cn> wrote:
> >
> > Lefi:
> >
> >> -----邮件原件-----
> >> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Leif Lindholm
> >> 发送时间: 2021年11月2日 17:51
> >> 收件人: brbarkel@microsoft.com <bret@corthon.com>
> >> 抄送: devel@edk2.groups.io; Ard Biesheuvel <ardb+tianocore@kernel.org>;
> >> Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> >> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Sami
> >> Mujawar <sami.mujawar@arm.com>; Jiewen Yao <jiewen.yao@intel.com>;
> >> Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Maciej Rabeda
> >> <maciej.rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>;
> Siyuan
> >> Fu <siyuan.fu@intel.com>; Ray Ni <ray.ni@intel.com>; Zhichao Gao
> >> <zhichao.gao@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
> >> 主题: Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm
> >> CompilerIntrinsicsLib to MdePkg
> >>
> >> On Mon, Nov 01, 2021 at 12:56:37 -0700, brbarkel@microsoft.com wrote:
> >>> From: Bret Barkelew <brbarkel@microsoft.com>
> >>>
> >>> This aligns better with Mu's philosophy around dependency structuring
> >>> and is one of the steps to enable Basecore to have zero CI dependencies
> >>> on other Mu repos.
> >>>
> >>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3649
> >>>
> >>
> >> Only one comment on this patch really.
> >>
> >>> ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf =>
> >> MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf | 3
> +--
> >>
> >> Could we just keep the .inf name as is?
> >>
> > I agree your suggestion. CompilerIntrinsicsLib can support X86 in future.
> > So,
> > CompilerIntrinsicsLib.inf should be used.
> >
>
> +1
>
> Thanks,
>
> Andrew Fish
>
> > Thanks
> > Liming
> >
> >> I think we're getting closer to the x86 folk accepting that they
> >> need this too, rather than keep inventing new dialects of C in the
> >> desperate hope that the compiler won't generate stdlib calls it's
> >> fully permitted to generate whenever it feels like.
> >>
> >> /
> >>    Leif
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> > 
> >
> >
>
>

[-- Attachment #2: Type: text/html, Size: 4632 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2021-11-04 17:24 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-01 19:56 [PATCH v1 00/16] Un-siloing Arm common code Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM Bret Barkelew
2021-11-02  8:43   ` Leif Lindholm
2021-11-02  8:50     ` [edk2-devel] " ryan.harkin
2021-11-02  9:03       ` Leif Lindholm
2021-11-02  9:26   ` Leif Lindholm
2021-11-01 19:56 ` [PATCH v1 02/16] ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib Bret Barkelew
2021-11-02  9:34   ` Leif Lindholm
2021-11-02  9:39     ` Leif Lindholm
2021-11-01 19:56 ` [PATCH v1 03/16] ArmPkg/StandaloneMmCoreEntryPoint: Swap to ArmMmuLib Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 04/16] ArmPkg: Disavow StandaloneMmMmuLib. It's just ArmMmuLib Bret Barkelew
2021-11-02  9:39   ` Leif Lindholm
2021-11-01 19:56 ` [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg Bret Barkelew
2021-11-02  9:50   ` Leif Lindholm
2021-11-02 19:44     ` [EXTERNAL] Re: [edk2-devel] " Bret Barkelew
2021-11-04  6:23     ` 回复: " gaoliming
2021-11-04  6:24       ` Andrew Fish
2021-11-04 17:23         ` Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools Bret Barkelew
2021-11-02  9:55   ` Leif Lindholm
2021-11-02 19:45     ` [EXTERNAL] Re: [edk2-devel] " Bret Barkelew
2021-11-02 23:34       ` [EXTERNAL] " Andrew Fish
2021-11-03 11:03         ` Leif Lindholm
2021-11-03 15:35         ` Bob Feng
2021-11-03 16:08           ` Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg Bret Barkelew
2021-11-02  1:52   ` 回复: " gaoliming
2021-11-02  9:24   ` Leif Lindholm
2021-11-02 19:48     ` Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 08/16] MdePkg: Create the MMU access lib to abstract memory protection settings Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 09/16] MdeModulePkg: Swap to MmuLib instead of Arm-specific lib Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 10/16] StandaloneMmPkg: Switch to the MmuLib abstraction Bret Barkelew
2021-11-02  0:25   ` [edk2-devel] " Yao, Jiewen
2021-11-01 19:56 ` [PATCH v1 11/16] ArmPkg: Add Basic MMU Lib for Arm silicon Bret Barkelew
2021-11-02  9:57   ` Leif Lindholm
2021-11-02 19:51     ` Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 12/16] ArmPkg: Move the StandaloneMmCpu driver to ArmPkg Bret Barkelew
2021-11-02 10:00   ` Leif Lindholm
2021-11-02 19:53     ` Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 13/16] ArmPkg: Move the StandaloneMmCoreEntryPoint lib " Bret Barkelew
2021-11-02 10:00   ` Leif Lindholm
2021-11-01 19:56 ` [PATCH v1 14/16] ArmPkg/Library: Convert StandaloneMmCoreEntryPoint to Arm-only Bret Barkelew
2021-11-02 10:05   ` Leif Lindholm
2021-11-01 19:56 ` [PATCH v1 15/16] ArmPkg/ArmPkg.dsc: Resolve build errors resulting from package moves Bret Barkelew
2021-11-01 19:56 ` [PATCH v1 16/16] ArmPlatformPkg/ArmPlatformPkg.dsc: " Bret Barkelew
2021-11-02  0:26 ` [edk2-devel] [PATCH v1 00/16] Un-siloing Arm common code Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox