From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web09.1615.1635796625125487910 for ; Mon, 01 Nov 2021 12:57:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@corthon-com.20210112.gappssmtp.com header.s=20210112 header.b=iiEWaPX+; spf=none, err=permanent DNS error (domain: corthon.com, ip: 209.85.214.182, mailfrom: bret@corthon.com) Received: by mail-pl1-f182.google.com with SMTP id u11so124884plf.3 for ; Mon, 01 Nov 2021 12:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corthon-com.20210112.gappssmtp.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=FcJ+3uhseyscAr9g3orWXF7AOc56Qgh/sJl5gY2je/s=; b=iiEWaPX+Ua+l2fIkP0Ys2zYjBREhZDT/xn5BB3e+vVcBVDhfRm5kT756SqK+UJs1jq 4uEBkg1uZVAadF/FQpaJNzyUUojVrFCX9nhmB23TcCHCYqCjkCWHKxAizbZLiK618myL Q6WdOx0vRMmz7TuhTUDEaqWPcCNTUGAmyImN4P94j/1Pc32TyhuGB+Z4RCS1FwHqhOrO ZB6MxFJUwKGqEH3uVRQ4mCVwCp5yDxR0ZzVIIVHrI4izb90kHkWAsb5UEGL6w27goHyv kAl1tldl304pI9LhGXCd6rHTvo2ANGlSUsZRj6oVVMjB/+IsR/A88kSDnJGRMhOiWJdN Pcug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=FcJ+3uhseyscAr9g3orWXF7AOc56Qgh/sJl5gY2je/s=; b=qpFRZCNmDdKCkni5tRpLRx/xGe9NSyAIF9Ii8tG8k84vlymxuh0adHbTjyTo0gRRsY 1wtF+PFiS35qZt3aDUJxrK8Ds+tfTnUjsA2kwL23uNlyJlK6SPvFV6GC5sUIsJaWCbo7 0SKtET2bWpn/8NjfsWu+ejmNK+XM5GKutkXtTrsXOb3zjr9ZNKlrr6py0CMcvbgWot3A rSDSsqzp9QewyZWdtbf+6/f3qEKyJvIjAVw3/B0kAgZHV4y5uk0xgbp1QVoJRHmtJpuk YQydZ8SGmp0tpMLOIF45aeSKJToJ9i23Pbe0E1p8G/KZOewfp0r/FoCYDl+73/pEUAkr Hz0Q== X-Gm-Message-State: AOAM5326SgbQMEhipGeNUGBFzx7KDLj6LZgcXnPJnNHp7RGtTXyky1g0 udPv8nb+XjK08KERnvhE9dql4JvA7CgA8AEf X-Google-Smtp-Source: ABdhPJykzQP0TUf1ztnNSqVQ7Wbbr4kTxNnY4Fu84EeiaiWbnJMi6/dAouc2jByWcFJpctVHAsfz+A== X-Received: by 2002:a17:90a:c78f:: with SMTP id gn15mr1203348pjb.54.1635796624115; Mon, 01 Nov 2021 12:57:04 -0700 (PDT) Return-Path: Received: from localhost.localdomain (174-21-94-94.tukw.qwest.net. [174.21.94.94]) by smtp.gmail.com with ESMTPSA id t2sm13759796pgf.35.2021.11.01.12.57.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 12:57:03 -0700 (PDT) From: "Bret Barkelew" X-Google-Original-From: "brbarkel@microsoft.com" To: devel@edk2.groups.io Subject: [PATCH v1 00/16] Un-siloing Arm common code Date: Mon, 1 Nov 2021 12:56:32 -0700 Message-Id: <20211101195648.6420-1-brbarkel@microsoft.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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