From f26959260c78db6704451e78ee24641581ec2a6a Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Fri, 14 Oct 2022 15:22:52 -0400 Subject: [PATCH 001/139] BRANCH DEPRECATION NOTICE: Use GitHub main branch! This branch is now deprecated and locked. Use the main branch on GitHub to submit new changes. From 275475196565d44bac799aa9ae311ede371b82b2 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 9 May 2024 11:15:13 -0700 Subject: [PATCH 002/139] Submodule update --- Common/MU_OEM_SAMPLE | 2 +- Features/CONFIG | 2 +- MU_BASECORE | 2 +- Silicon/Arm/MU_TIANO | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/MU_OEM_SAMPLE b/Common/MU_OEM_SAMPLE index 2d1aa5cc4..a29b96dc4 160000 --- a/Common/MU_OEM_SAMPLE +++ b/Common/MU_OEM_SAMPLE @@ -1 +1 @@ -Subproject commit 2d1aa5cc483628d59ee36d4da3fcd437a86d58c3 +Subproject commit a29b96dc4c391ce4f8f7049d74b0b236257175b1 diff --git a/Features/CONFIG b/Features/CONFIG index 937689b6b..ed7572a67 160000 --- a/Features/CONFIG +++ b/Features/CONFIG @@ -1 +1 @@ -Subproject commit 937689b6b2c1778e152464c8fe0e8f66b93757ab +Subproject commit ed7572a674ed7e4783880487453c3b1ed8d7c65e diff --git a/MU_BASECORE b/MU_BASECORE index b152f68d5..e74cf72e8 160000 --- a/MU_BASECORE +++ b/MU_BASECORE @@ -1 +1 @@ -Subproject commit b152f68d5badc3b278f7749d1e50effb8a5aca60 +Subproject commit e74cf72e84967ff0a754c6a68914a9cbf550ab94 diff --git a/Silicon/Arm/MU_TIANO b/Silicon/Arm/MU_TIANO index 445f41d9d..2c5f02b86 160000 --- a/Silicon/Arm/MU_TIANO +++ b/Silicon/Arm/MU_TIANO @@ -1 +1 @@ -Subproject commit 445f41d9db497612ee83cbaf7ae49538d5cd0172 +Subproject commit 2c5f02b86e91c0b76096b10bd6daa38c722324af From 4808172a1c78248d17a03d73af8d6d5eab72c8c6 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 9 May 2024 11:16:17 -0700 Subject: [PATCH 003/139] Use system QEMU and update toolchain tag to use clangpdb --- Platforms/QemuSbsaPkg/PlatformBuild.py | 20 ++++++++++---------- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 16 +++++++++++----- QemuPkg/Binaries/qemu-windows_ext_dep.yaml | 2 +- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 6843f637b..eab391c7c 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -40,7 +40,7 @@ class CommonPlatform(): PackagesSupported = ("QemuSbsaPkg",) ArchSupported = ("AARCH64",) TargetsSupported = ("DEBUG", "RELEASE", "NOOPT") - Scopes = ('qemu', 'qemusbsa', 'gcc_aarch64_linux', 'edk2-build', 'cibuild', 'configdata', 'rust-ci') + Scopes = ('qemu', 'qemusbsa', 'edk2-build', 'cibuild', 'configdata', 'rust-ci') WorkspaceRoot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) PackagesPath = ( "Platforms", @@ -158,12 +158,12 @@ def __init__(self): UefiBuilder.__init__(self) def CleanTree(self, RemoveConfTemplateFilesToo=False): - # Add a step to clean up BL31 as well, if asked - cmd = "make" - args = "distclean" - ret = RunCmd(cmd, args, workingdir= self.env.GetValue("ARM_TFA_PATH")) - if ret != 0: - return ret + # # Add a step to clean up BL31 as well, if asked + # cmd = "make" + # args = "distclean" + # ret = RunCmd(cmd, args, workingdir= self.env.GetValue("ARM_TFA_PATH")) + # if ret != 0: + # return ret return super().CleanTree(RemoveConfTemplateFilesToo) @@ -234,7 +234,7 @@ def SetPlatformEnv(self): self.env.SetValue("PRODUCT_NAME", "QemuSbsa", "Platform Hardcoded") self.env.SetValue("ACTIVE_PLATFORM", "QemuSbsaPkg/QemuSbsaPkg.dsc", "Platform Hardcoded") self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "GCC5", "set default to gcc5") + self.env.SetValue("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") self.env.SetValue("QEMU_HEADLESS", "FALSE", "Default to false") @@ -294,7 +294,7 @@ def PlatformPostBuild(self): logging.info("Building TF-A") cmd = "make" - args = "CROSS_COMPILE=" + shell_environment.GetEnvironment().get_shell_var("GCC5_AARCH64_PREFIX") + args = "CC=\"" + shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") + "clang\"" args += " PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) @@ -303,7 +303,7 @@ def PlatformPostBuild(self): # args += " FEATURE_DETECTION=1" # Enforces support for features enabled. args += " BL32=" + os.path.join(op_fv, "BL32_AP_MM.fd") args += " all fip" - args += " -j $(nproc)" + # args += " -j $(nproc)" ret = RunCmd(cmd, args, workingdir= self.env.GetValue("ARM_TFA_PATH")) if ret != 0: return ret diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index cbc6213e2..13b988f2e 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -964,7 +964,7 @@ OemPkg/OemConfigPolicyCreatorPei/OemConfigPolicyCreatorPei.inf { # producer of config data - NULL|QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.inf + NULL|SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.inf } # @@ -1365,7 +1365,7 @@ MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf { - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf NULL|MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLibStandaloneMm.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf @@ -1394,12 +1394,18 @@ RVCT:*_*_*_CC_FLAGS = -DDISABLE_NEW_DEPRECATED_INTERFACES GCC:*_*_*_CC_FLAGS = -DDISABLE_NEW_DEPRECATED_INTERFACES +[BuildOptions.common.EDKII.SEC,BuildOptions.common.EDKII.MM_CORE_STANDALONE] + GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 /FILEALIGN:0x1000 + [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION,BuildOptions.common.EDKII.MM_CORE_STANDALONE,BuildOptions.common.EDKII.MM_STANDALONE] - GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] - GCC:*_*_ARM_DLINK_FLAGS = -z common-page-size=0x1000 - GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000 + GCC:*_GCC*_ARM_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_GCC*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000 + GCC:*_CLANGPDB_AARCH64_DLINK_FLAGS = /ALIGN:0x10000 RVCT:*_*_ARM_DLINK_FLAGS = --scatter $(EDK_TOOLS_PATH)/Scripts/Rvct-Align4K.sct [BuildOptions.AARCH64.EDKII.MM_CORE_STANDALONE,BuildOptions.AARCH64.EDKII.MM_STANDALONE] diff --git a/QemuPkg/Binaries/qemu-windows_ext_dep.yaml b/QemuPkg/Binaries/qemu-windows_ext_dep.yaml index bbc5db2dc..95da1d47c 100644 --- a/QemuPkg/Binaries/qemu-windows_ext_dep.yaml +++ b/QemuPkg/Binaries/qemu-windows_ext_dep.yaml @@ -6,7 +6,7 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent ## { - "scope": "global-win", + "scope": "glssdobal-win", "type": "web", "name": "qemu-win", "source": "https://github.com/microsoft/mu_tiano_platforms/releases/download/v7.0.0/qemu-windows-v7.0.0.zip", From d03e1575b43c8c8ff5a0fdcfa3aca29ebfff7be9 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 9 May 2024 13:32:11 -0700 Subject: [PATCH 004/139] diusable ffa --- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index 13b988f2e..dc2714985 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -600,6 +600,7 @@ !endif [PcdsFixedAtBuild.common] + gArmTokenSpaceGuid.PcdFfaEnable|0 !include QemuPkg/AutoGen/SecurebootPcds.inc gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 From f8fdcef02279d3c6e02739d9e9f565d9d6da439f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 10 May 2024 01:46:59 -0700 Subject: [PATCH 005/139] work from toolsdef --- .../Library/SbsaConfigDataLib/SbsaConfigDataLib.c | 1 + Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Platforms/QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c b/Platforms/QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c index 4fe64d248..b3db10c8b 100644 --- a/Platforms/QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c +++ b/Platforms/QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c @@ -16,3 +16,4 @@ PROFILE gProfileData = { 0 }; UINTN gNumProfiles = 0; +CHAR8 *gProfileFlavorNames[] = { NULL }; diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index dc2714985..a1ca40d39 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -627,9 +627,9 @@ # gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x40 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x0 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x505 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x258 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x260 + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x30 + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x40 + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x300 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode|0x5DC gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|0x2EE0 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|0x14 @@ -965,7 +965,7 @@ OemPkg/OemConfigPolicyCreatorPei/OemConfigPolicyCreatorPei.inf { # producer of config data - NULL|SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.inf + NULL|QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.inf } # From 0189d736dc4011d3b8190e4dbbdee8fab7b20060 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 10 May 2024 01:48:33 -0700 Subject: [PATCH 006/139] fix basecore --- MU_BASECORE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MU_BASECORE b/MU_BASECORE index e74cf72e8..683e24b18 160000 --- a/MU_BASECORE +++ b/MU_BASECORE @@ -1 +1 @@ -Subproject commit e74cf72e84967ff0a754c6a68914a9cbf550ab94 +Subproject commit 683e24b18c3f8199beeb50b4cc3b529d7d76516d From ccda9757cd76d54512f709bc4bea85fc9f3d0e95 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 10 May 2024 10:59:39 -0700 Subject: [PATCH 007/139] Updated submodule to github --- MU_BASECORE | 2 +- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 1 - Silicon/Arm/MU_TIANO | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/MU_BASECORE b/MU_BASECORE index 683e24b18..ac9a2b15f 160000 --- a/MU_BASECORE +++ b/MU_BASECORE @@ -1 +1 @@ -Subproject commit 683e24b18c3f8199beeb50b4cc3b529d7d76516d +Subproject commit ac9a2b15fa1fd100dabd75ec5fb089566b79ebdf diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index c6a6c7680..d09efdb64 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -600,7 +600,6 @@ !endif [PcdsFixedAtBuild.common] - gArmTokenSpaceGuid.PcdFfaEnable|0 !include QemuPkg/AutoGen/SecurebootPcds.inc gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 diff --git a/Silicon/Arm/MU_TIANO b/Silicon/Arm/MU_TIANO index 2c5f02b86..a138e108d 160000 --- a/Silicon/Arm/MU_TIANO +++ b/Silicon/Arm/MU_TIANO @@ -1 +1 @@ -Subproject commit 2c5f02b86e91c0b76096b10bd6daa38c722324af +Subproject commit a138e108dea945f1472fa86e86d110fca29b8768 From 993e5431ec333ea833dc8940f09eaadb0fd2e180 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Mon, 13 May 2024 15:23:11 -0700 Subject: [PATCH 008/139] it works like hack but works --- Platforms/QemuSbsaPkg/PlatformBuild.py | 99 ++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 6 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index eab391c7c..52c92bd33 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -20,6 +20,8 @@ from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd +from edk2toollib.windows.locate_tools import QueryVcVariables +from edk2toollib.utility_functions import GetHostInfo # Declare test whose failure will not return a non-zero exit code FAILURE_EXEMPT_TESTS = { @@ -158,12 +160,49 @@ def __init__(self): UefiBuilder.__init__(self) def CleanTree(self, RemoveConfTemplateFilesToo=False): - # # Add a step to clean up BL31 as well, if asked - # cmd = "make" - # args = "distclean" - # ret = RunCmd(cmd, args, workingdir= self.env.GetValue("ARM_TFA_PATH")) - # if ret != 0: - # return ret + interesting_keys = ["VCToolsInstallDir", "Path", "LIB"] + if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": + HostInfo = GetHostInfo() + + # check to see if host is configured + # HostType for VS tools should be (defined in tools_def): + # x86 == 32bit Intel + # x64 == 64bit Intel + # arm == 32bit Arm + # arm64 == 64bit Arm + # + HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") + if HostType is not None: + HostType = HostType.lower() + self.Logger.info( + f"CLANG_VS_HOST defined by environment. Value is {HostType}") + else: + #figure it out based on host info + if HostInfo.arch == "x86": + if HostInfo.bit == "32": + HostType = "x86" + elif HostInfo.bit == "64": + HostType = "x64" + else: + # anything other than x86 or x64 is not supported + raise NotImplementedError() + + # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. + VC_HOST_ARCH_TRANSLATOR = { + "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} + + # now get the environment variables for the platform + shell_env = shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for the vars that interest us. + vs_vars = QueryVcVariables( + interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) + for (k, v) in vs_vars.items(): + shell_env.set_shell_var(k, v) + + # Add a step to clean up BL31 as well, if asked + cmd = "make" + args = "clean" + RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) return super().CleanTree(RemoveConfTemplateFilesToo) @@ -293,6 +332,54 @@ def PlatformPostBuild(self): op_fv = os.path.join(self.env.GetValue("BUILD_OUTPUT_BASE"), "FV") logging.info("Building TF-A") + + interesting_keys = ["LIB"] + if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": + HostInfo = GetHostInfo() + + # check to see if host is configured + # HostType for VS tools should be (defined in tools_def): + # x86 == 32bit Intel + # x64 == 64bit Intel + # arm == 32bit Arm + # arm64 == 64bit Arm + # + HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") + if HostType is not None: + HostType = HostType.lower() + self.Logger.info( + f"CLANG_VS_HOST defined by environment. Value is {HostType}") + else: + #figure it out based on host info + if HostInfo.arch == "x86": + if HostInfo.bit == "32": + HostType = "x86" + elif HostInfo.bit == "64": + HostType = "x64" + else: + # anything other than x86 or x64 is not supported + raise NotImplementedError() + + # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. + VC_HOST_ARCH_TRANSLATOR = { + "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} + + # now get the environment variables for the platform + shell_env = shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for the vars that interest us. + vs_vars = QueryVcVariables( + interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) + for (k, v) in vs_vars.items(): + shell_env.set_shell_var(k, v) + + # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds + cmd = "make" + args = " fiptool LIB=\"" + shell_env.get_shell_var("LIB") + "\"" + ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) + if ret != 0: + return ret + + # Then we can make the firmware images with the fiptool built above cmd = "make" args = "CC=\"" + shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") + "clang\"" args += " PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() From 0358ab62e4ff4edc2228b1e4b037f40080556101 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Mon, 13 May 2024 17:33:20 -0700 Subject: [PATCH 009/139] Update oem sample to mainline --- Common/MU_OEM_SAMPLE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/MU_OEM_SAMPLE b/Common/MU_OEM_SAMPLE index a29b96dc4..6cd87eaaf 160000 --- a/Common/MU_OEM_SAMPLE +++ b/Common/MU_OEM_SAMPLE @@ -1 +1 @@ -Subproject commit a29b96dc4c391ce4f8f7049d74b0b236257175b1 +Subproject commit 6cd87eaaf2cc4ffabaafe2ae307e78e324c7c4b9 From 5948401849e1fa54a1e5a95126a3b4439e899685 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Mon, 13 May 2024 17:41:08 -0700 Subject: [PATCH 010/139] Update config to mainline --- Features/CONFIG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Features/CONFIG b/Features/CONFIG index ed7572a67..a1d5a5e1e 160000 --- a/Features/CONFIG +++ b/Features/CONFIG @@ -1 +1 @@ -Subproject commit ed7572a674ed7e4783880487453c3b1ed8d7c65e +Subproject commit a1d5a5e1ebd17a56738c03ca0a4be2f27109a9cf From 9db06367613ca167028279a050011e22b49dddd1 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 12:50:39 -0700 Subject: [PATCH 011/139] Test build with clang pdb --- .azurepipelines/Platform-Build-VS.yml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 842395492..19c004225 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -129,3 +129,43 @@ jobs: displayName: Install Report Generator BuildArtifactsOther: "**/Coverage/**" Run: false + +- template: Platform-Build-Job.yml + parameters: + extra_install_step: + - template: Steps/InstallCoverageTools.yml@mu_devops + tool_chain_tag: 'CLANGPDB' + vm_image: $(vm_image) + os_type: Windows_NT + build_matrix: + QemuSbsa_DEBUG: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildArch: AARCH64 + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuSbsa_RELEASE: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildArch: AARCH64 + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" From 9fce7942df4150b4704e5f42d9b1bb98b3ed5327 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 12:51:02 -0700 Subject: [PATCH 012/139] simplify the logic --- Platforms/QemuSbsaPkg/PlatformBuild.py | 57 +++++++------------------- 1 file changed, 15 insertions(+), 42 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 52c92bd33..c09ac35f1 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -115,7 +115,13 @@ def GetWorkspaceRoot(self): def GetActiveScopes(self): ''' return tuple containing scopes that should be active for this process ''' - return CommonPlatform.Scopes + scopes = CommonPlatform.Scopes + actual_tool_chain_tag = shell_environment.GetBuildVars().GetValue( + "TOOL_CHAIN_TAG", "" + ) + if actual_tool_chain_tag.upper().startswith("GCC"): + scopes = scopes + "gcc_aarch64_linux" + return scopes def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: ''' Filter other cases that this package should be built @@ -236,7 +242,13 @@ def GetPackagesPath(self): def GetActiveScopes(self): ''' return tuple containing scopes that should be active for this process ''' - return CommonPlatform.Scopes + scopes = CommonPlatform.Scopes + actual_tool_chain_tag = shell_environment.GetBuildVars().GetValue( + "TOOL_CHAIN_TAG", "" + ) + if actual_tool_chain_tag.upper().startswith("GCC"): + scopes = scopes + "gcc_aarch64_linux" + return scopes def GetName(self): ''' Get the name of the repo, platform, or product being build ''' @@ -333,48 +345,9 @@ def PlatformPostBuild(self): logging.info("Building TF-A") - interesting_keys = ["LIB"] - if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": - HostInfo = GetHostInfo() - - # check to see if host is configured - # HostType for VS tools should be (defined in tools_def): - # x86 == 32bit Intel - # x64 == 64bit Intel - # arm == 32bit Arm - # arm64 == 64bit Arm - # - HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") - if HostType is not None: - HostType = HostType.lower() - self.Logger.info( - f"CLANG_VS_HOST defined by environment. Value is {HostType}") - else: - #figure it out based on host info - if HostInfo.arch == "x86": - if HostInfo.bit == "32": - HostType = "x86" - elif HostInfo.bit == "64": - HostType = "x64" - else: - # anything other than x86 or x64 is not supported - raise NotImplementedError() - - # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. - VC_HOST_ARCH_TRANSLATOR = { - "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} - - # now get the environment variables for the platform - shell_env = shell_environment.GetEnvironment() - # Use the tools lib to determine the correct values for the vars that interest us. - vs_vars = QueryVcVariables( - interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) - for (k, v) in vs_vars.items(): - shell_env.set_shell_var(k, v) - # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds cmd = "make" - args = " fiptool LIB=\"" + shell_env.get_shell_var("LIB") + "\"" + args = " fiptool LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) if ret != 0: return ret From 0f25b598f06ed61cd585090fc2c5bab880ad69a1 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 13:18:41 -0700 Subject: [PATCH 013/139] test pipeline --- .azurepipelines/Platform-Build-VS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 19c004225..0ceccebb3 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -10,7 +10,7 @@ resources: - repository: mu_devops type: github endpoint: microsoft - name: microsoft/mu_devops + name: kuqin12/mu_devops ref: main variables: From eb926226dbee8da98200a542479077c41cdd6ab3 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 13:22:47 -0700 Subject: [PATCH 014/139] Removed some steps temporarily --- .azurepipelines/Platform-Build-VS.yml | 113 -------------------------- 1 file changed, 113 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 0ceccebb3..0541a572e 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -17,119 +17,6 @@ variables: - group: tool-chain-windows-visual-studio-latest jobs: -- template: Platform-Build-Job.yml - parameters: - extra_install_step: - - template: Steps/InstallCoverageTools.yml@mu_devops - tool_chain_tag: 'VS2022' - vm_image: $(vm_image) - os_type: Windows_NT - build_matrix: - QemuQ35_DEBUG: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "" - BuildTarget: "DEBUG" - BuildExtraTag: "" - BuildExtraStep: - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_RELEASE: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "" - BuildExtraStep: - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_DEBUG_ARM: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "" - BuildTarget: "DEBUG" - BuildExtraTag: "ON_ARM" - BuildExtraStep: - - script: echo No extra steps provided - Run: false - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - **/*/*TestApp.efi - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_RELEASE_ARM: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "ON_ARM" - BuildExtraStep: - - script: echo No extra steps provided - Run: false - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - **/*/*TestApp.efi - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_NO_SMM_RELEASE: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "BLD_*_SMM_ENABLED=FALSE" - BuildTarget: "RELEASE" - BuildExtraTag: "NO_SMM" - BuildExtraStep: - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=2 BLD_*_SMM_ENABLED=FALSE" - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - BuildArtifactsOther: "" - - QemuQ35_CODE_COVERAGE: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/Test/PlatformTest.py" - BuildArch: "X64" - BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" - BuildTarget: "NOOPT" - BuildExtraTag: "UNIT_TESTS" - BuildExtraStep: - - script: dotnet tool install -g dotnet-reportgenerator-globaltool - displayName: Install Report Generator - BuildArtifactsOther: "**/Coverage/**" - Run: false - - QemuSbsa_CODE_COVERAGE: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/Test/PlatformTest.py" - BuildArch: "AARCH64" - BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" - BuildTarget: "NOOPT" - BuildExtraTag: "UNIT_TESTS" - BuildExtraStep: - - script: dotnet tool install -g dotnet-reportgenerator-globaltool - displayName: Install Report Generator - BuildArtifactsOther: "**/Coverage/**" - Run: false - - template: Platform-Build-Job.yml parameters: extra_install_step: From 10a9920fb33cf6a27ee0748479f6c7e4cedb836f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 14:36:53 -0700 Subject: [PATCH 015/139] Using the correct branch --- .azurepipelines/Platform-Build-VS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 0541a572e..57f423383 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -11,7 +11,7 @@ resources: type: github endpoint: microsoft name: kuqin12/mu_devops - ref: main + ref: add_clangpdb variables: - group: tool-chain-windows-visual-studio-latest From 732b584085464ff18c6e92eee32c32b94763d40b Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 15:02:24 -0700 Subject: [PATCH 016/139] Fixing the tool chain tag? --- .azurepipelines/Platform-Build-Job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azurepipelines/Platform-Build-Job.yml b/.azurepipelines/Platform-Build-Job.yml index b2a6990c0..3519c06d7 100644 --- a/.azurepipelines/Platform-Build-Job.yml +++ b/.azurepipelines/Platform-Build-Job.yml @@ -92,7 +92,7 @@ jobs: - template: Steps/BuildPlatform.yml@mu_devops parameters: - tool_chain_tag: $(tool_chain_tag) + tool_chain_tag: ${{ parameters.tool_chain_tag }} build_pkg: ${{ item.Value.BuildPackage }} build_target: ${{ item.Value.BuildTarget }} build_arch: ${{ item.Value.BuildArch }} From 9f57eb14ea8033462b08ca7290a4b5210549ae14 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 15:58:03 -0700 Subject: [PATCH 017/139] missed the point --- Platforms/QemuSbsaPkg/PlatformBuild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index c09ac35f1..7bc1d592b 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -120,7 +120,7 @@ def GetActiveScopes(self): "TOOL_CHAIN_TAG", "" ) if actual_tool_chain_tag.upper().startswith("GCC"): - scopes = scopes + "gcc_aarch64_linux" + scopes = scopes + ("gcc_aarch64_linux") return scopes def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: @@ -207,7 +207,7 @@ def CleanTree(self, RemoveConfTemplateFilesToo=False): # Add a step to clean up BL31 as well, if asked cmd = "make" - args = "clean" + args = "distclean" RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) return super().CleanTree(RemoveConfTemplateFilesToo) @@ -247,7 +247,7 @@ def GetActiveScopes(self): "TOOL_CHAIN_TAG", "" ) if actual_tool_chain_tag.upper().startswith("GCC"): - scopes = scopes + "gcc_aarch64_linux" + scopes = scopes + ("gcc_aarch64_linux") return scopes def GetName(self): From cb79fcc8272d52ee18d2850a47600eebeca356b3 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 16:08:01 -0700 Subject: [PATCH 018/139] uncrustify --- .../QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c b/Platforms/QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c index b3db10c8b..65576f53a 100644 --- a/Platforms/QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c +++ b/Platforms/QemuSbsaPkg/Library/SbsaConfigDataLib/SbsaConfigDataLib.c @@ -14,6 +14,6 @@ #include #include -PROFILE gProfileData = { 0 }; -UINTN gNumProfiles = 0; +PROFILE gProfileData = { 0 }; +UINTN gNumProfiles = 0; CHAR8 *gProfileFlavorNames[] = { NULL }; From 925cba8888ca54034447cbfa00a497ef9194a6e1 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 16:26:44 -0700 Subject: [PATCH 019/139] once more --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 7bc1d592b..4acdb5d5d 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -120,7 +120,7 @@ def GetActiveScopes(self): "TOOL_CHAIN_TAG", "" ) if actual_tool_chain_tag.upper().startswith("GCC"): - scopes = scopes + ("gcc_aarch64_linux") + scopes += ("gcc_aarch64_linux") return scopes def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: @@ -247,7 +247,7 @@ def GetActiveScopes(self): "TOOL_CHAIN_TAG", "" ) if actual_tool_chain_tag.upper().startswith("GCC"): - scopes = scopes + ("gcc_aarch64_linux") + scopes += ("gcc_aarch64_linux") return scopes def GetName(self): From 7ab0f0b1419873ea716bfbd95fddd2014b2a5787 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 16:40:55 -0700 Subject: [PATCH 020/139] see if this tells anything? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 4acdb5d5d..e7bfd5e10 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -347,7 +347,7 @@ def PlatformPostBuild(self): # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds cmd = "make" - args = " fiptool LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + args = " DEBUG=1 V=1 fiptool LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) if ret != 0: return ret From cce4d3529658a24a4ed0e7619095098cb03aca3f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 14 May 2024 16:58:59 -0700 Subject: [PATCH 021/139] Use the feeds --- .github/workflows/publish-qemu-bin.yml | 1 + QemuPkg/Binaries/qemu-windows_ext_dep.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-qemu-bin.yml b/.github/workflows/publish-qemu-bin.yml index f7f06496b..72e6ca907 100644 --- a/.github/workflows/publish-qemu-bin.yml +++ b/.github/workflows/publish-qemu-bin.yml @@ -45,6 +45,7 @@ jobs: cp "C:\Program Files\qemu\share\kvmvapic.bin" temp\share cp "C:\Program Files\qemu\share\vgabios-cirrus.bin" temp\share cp "C:\Program Files\qemu\share\vgabios-stdvga.bin" temp\share + cp "C:\Program Files\qemu\share\vgabios-bochs-display.bin" temp\share Get-ChildItem -Path "C:\Program Files\qemu" -Filter *.dll | Move-Item -Destination "temp" - name: Upload Qemu Artifact diff --git a/QemuPkg/Binaries/qemu-windows_ext_dep.yaml b/QemuPkg/Binaries/qemu-windows_ext_dep.yaml index 95da1d47c..bbc5db2dc 100644 --- a/QemuPkg/Binaries/qemu-windows_ext_dep.yaml +++ b/QemuPkg/Binaries/qemu-windows_ext_dep.yaml @@ -6,7 +6,7 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent ## { - "scope": "glssdobal-win", + "scope": "global-win", "type": "web", "name": "qemu-win", "source": "https://github.com/microsoft/mu_tiano_platforms/releases/download/v7.0.0/qemu-windows-v7.0.0.zip", From 13be08e1ba67bcd669091d25750a696bcccecff7 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 10:51:43 -0700 Subject: [PATCH 022/139] missing some crap --- .azurepipelines/Platform-Build-VS.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 57f423383..66ff2ad99 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -34,6 +34,7 @@ jobs: BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops + - template: ../Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | @@ -50,6 +51,7 @@ jobs: BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops + - template: ../Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | From 94caeddb4f5ee72365e69c91750df75c0ffc5784 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 10:54:19 -0700 Subject: [PATCH 023/139] Update again --- .azurepipelines/Platform-Build-VS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 66ff2ad99..5346a1b60 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -34,7 +34,7 @@ jobs: BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops - - template: ../Steps/SetupToolChainTagPreReqs.yml@mu_devops + - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | @@ -51,7 +51,7 @@ jobs: BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops - - template: ../Steps/SetupToolChainTagPreReqs.yml@mu_devops + - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | From f82f36f86ed76aa66819877615ba944c719e14fd Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 11:13:29 -0700 Subject: [PATCH 024/139] Does this work? --- .azurepipelines/Platform-Build-VS.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 5346a1b60..b8fc6ad00 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -21,6 +21,7 @@ jobs: parameters: extra_install_step: - template: Steps/InstallCoverageTools.yml@mu_devops + - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops tool_chain_tag: 'CLANGPDB' vm_image: $(vm_image) os_type: Windows_NT @@ -34,7 +35,6 @@ jobs: BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops - - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | @@ -51,7 +51,6 @@ jobs: BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops - - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | From 33036d773dc9b4023f35eb5a3040b334882421b2 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 11:15:18 -0700 Subject: [PATCH 025/139] Update again by reversion --- .azurepipelines/Platform-Build-VS.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index b8fc6ad00..5346a1b60 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -21,7 +21,6 @@ jobs: parameters: extra_install_step: - template: Steps/InstallCoverageTools.yml@mu_devops - - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops tool_chain_tag: 'CLANGPDB' vm_image: $(vm_image) os_type: Windows_NT @@ -35,6 +34,7 @@ jobs: BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops + - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | @@ -51,6 +51,7 @@ jobs: BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops + - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | From e64fe534071cd75952c15a34256e58c38e227b06 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 11:37:06 -0700 Subject: [PATCH 026/139] See if this is better --- .gitmodules | 8 ++++---- Silicon/Arm/TFA | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index a9f9699ca..df7b462af 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,7 +20,7 @@ branch = release/202302 [submodule "Silicon/Arm/TFA"] path = Silicon/Arm/TFA - url = https://github.com/ARM-software/arm-trusted-firmware.git + url = https://github.com/kuqin12/arm-trusted-firmware.git branch = v2.9.0 [submodule "Features/DFCI"] path = Features/DFCI @@ -31,6 +31,6 @@ [submodule "Features/MM_SUPV"] path = Features/MM_SUPV url = https://github.com/microsoft/mu_feature_mm_supv.git -[submodule "Features/DEBUGGER"] - path = Features/DEBUGGER - url = https://github.com/microsoft/mu_feature_debugger.git +[submodule "Features/DEBUGGER"] + path = Features/DEBUGGER + url = https://github.com/microsoft/mu_feature_debugger.git diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index b6c094840..ddf560396 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit b6c0948400594e3cc4dbb5a4ef04b815d2675808 +Subproject commit ddf560396851cb60b6fd945a309d14730fa81235 From ad0535cc09500d7aace93269ad2c614cc4a60381 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 13:25:38 -0700 Subject: [PATCH 027/139] How about now? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index ddf560396..393034ce6 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit ddf560396851cb60b6fd945a309d14730fa81235 +Subproject commit 393034ce6f9a2a5319b4c4dcabb0027572e96eac From ef1ba4a5d75cb69396c0e490c453bbbdbd35849e Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 16:37:43 -0700 Subject: [PATCH 028/139] try this? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 393034ce6..f1177c3a1 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 393034ce6f9a2a5319b4c4dcabb0027572e96eac +Subproject commit f1177c3a1843326e47b4aacba3eb674cc2a18d9d From 9bf01582bb9d65daf22a46b3e642d624ee7a8105 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 16:54:59 -0700 Subject: [PATCH 029/139] Update TFA? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index f1177c3a1..485bc986e 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit f1177c3a1843326e47b4aacba3eb674cc2a18d9d +Subproject commit 485bc986eba1c9b9bc08f1b650e9bb044387aebc From f049d612820983a589141fad99fcfd61265a063f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 15 May 2024 17:15:29 -0700 Subject: [PATCH 030/139] Updated tfa --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 485bc986e..1ebf8b556 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 485bc986eba1c9b9bc08f1b650e9bb044387aebc +Subproject commit 1ebf8b556cb135da252a1c278fbe63ecd8f83a02 From 1b414bef6ca7641c30f8186bfcab923078ab3ee6 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 16 May 2024 10:21:52 -0700 Subject: [PATCH 031/139] Fixing the tfa? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 1ebf8b556..ccb66c805 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 1ebf8b556cb135da252a1c278fbe63ecd8f83a02 +Subproject commit ccb66c80534fa43a23d86716adef9c555075a968 From c037dda3167f8e0775811d26ebabbf99282719bb Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 16 May 2024 11:47:26 -0700 Subject: [PATCH 032/139] does this work? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index e7bfd5e10..731ecdbf1 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -347,7 +347,7 @@ def PlatformPostBuild(self): # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds cmd = "make" - args = " DEBUG=1 V=1 fiptool LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + args = " DEBUG=1 V=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) if ret != 0: return ret From 07d659427526704bb33857b49a7cf4611a75bfc2 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 16 May 2024 16:18:43 -0700 Subject: [PATCH 033/139] see if this hack works? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 731ecdbf1..c765a58f5 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -10,6 +10,7 @@ import uuid from io import StringIO from pathlib import Path +import posixpath from edk2toolext.environment import shell_environment from edk2toolext.environment.uefi_build import UefiBuilder @@ -354,7 +355,7 @@ def PlatformPostBuild(self): # Then we can make the firmware images with the fiptool built above cmd = "make" - args = "CC=\"" + shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") + "clang\"" + args = "CC=\"" + shell_environment.GetEnvironment().get_shell_var("CLANG_BIN").replace(os.sep, posixpath.sep) + "clang\"" args += " PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) From faa2384781b4898c609ff03d2f0b129d940ab213 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 17 May 2024 13:30:16 -0700 Subject: [PATCH 034/139] that will do? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 49 +++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index c765a58f5..3984f2bac 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -346,6 +346,53 @@ def PlatformPostBuild(self): logging.info("Building TF-A") + # HACKHACK: This is to tell if this is running from a POSIX compatible shell + os_type = shell_environment.GetEnvironment().get_shell_var("OSTYPE") + + if os_type is not None and "msys" in os_type: + + import ctypes + import sys + + xunicode = str if sys.version_info[0] > 2 else eval("unicode") + + # If running under Msys2 Python, just use DLL name + # If running under non-Msys2 Windows Python, use full path to msys-2.0.dll + # Note Python and msys-2.0.dll must match bitness (i.e. 32-bit Python must + # use 32-bit msys-2.0.dll, 64-bit Python must use 64-bit msys-2.0.dll.) + msys = ctypes.cdll.LoadLibrary("msys-2.0.dll") + msys_create_path = msys.cygwin_create_path + msys_create_path.restype = ctypes.c_void_p + msys_create_path.argtypes = [ctypes.c_int32, ctypes.c_void_p] + + # Initialise the msys DLL. This step should only be done if using + # non-msys Python. If you are using msys Python don't do this because + # it has already been done for you. + if sys.platform != "msys": + msys_dll_init = msys.msys_dll_init + msys_dll_init.restype = None + msys_dll_init.argtypes = [] + msys_dll_init() + + free = msys.free + free.restype = None + free.argtypes = [ctypes.c_void_p] + + CCP_WIN_W_TO_POSIX = 3 + + def win2posix(path): + """Convert a Windows path to a msys path""" + result = msys_create_path(CCP_WIN_W_TO_POSIX, xunicode(path)) + if result is None: + raise Exception("msys_create_path failed") + value = ctypes.cast(result, ctypes.c_char_p).value + free(result) + return value + + clang_path = win2posix(shell_environment.GetEnvironment().get_shell_var("CLANG_BIN")) + else: + clang_path = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") + # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds cmd = "make" args = " DEBUG=1 V=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" @@ -355,7 +402,7 @@ def PlatformPostBuild(self): # Then we can make the firmware images with the fiptool built above cmd = "make" - args = "CC=\"" + shell_environment.GetEnvironment().get_shell_var("CLANG_BIN").replace(os.sep, posixpath.sep) + "clang\"" + args = "CC=\"" + clang_path + "clang\"" args += " PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) From 1cd11b07b93b99010df5f0152711b3fb1483106e Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 17 May 2024 14:18:43 -0700 Subject: [PATCH 035/139] clang path --- Platforms/QemuSbsaPkg/PlatformBuild.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 3984f2bac..9bd6771d3 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -351,6 +351,8 @@ def PlatformPostBuild(self): if os_type is not None and "msys" in os_type: + logging.critical("Running under Msys2, using msys-2.0.dll to convert paths") + import ctypes import sys @@ -373,11 +375,14 @@ def PlatformPostBuild(self): msys_dll_init.restype = None msys_dll_init.argtypes = [] msys_dll_init() + logging.critical("msys_dll_init() called") free = msys.free free.restype = None free.argtypes = [ctypes.c_void_p] + logging.critical("msys-2.0.dll loaded") + CCP_WIN_W_TO_POSIX = 3 def win2posix(path): @@ -389,9 +394,14 @@ def win2posix(path): free(result) return value + logging.critical("win2posix() defined") + clang_path = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") + logging.critical("clang_path before = %s" % clang_path) clang_path = win2posix(shell_environment.GetEnvironment().get_shell_var("CLANG_BIN")) + logging.critical("clang_path after = %s" % clang_path) else: clang_path = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") + logging.critical("clang_path simply = %s" % clang_path) # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds cmd = "make" From 54a5adc073a3a5ea573d1c40220e2d836f6c016e Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 17 May 2024 15:10:36 -0700 Subject: [PATCH 036/139] that will do 2? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 9bd6771d3..fc0270f2a 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -348,6 +348,8 @@ def PlatformPostBuild(self): # HACKHACK: This is to tell if this is running from a POSIX compatible shell os_type = shell_environment.GetEnvironment().get_shell_var("OSTYPE") + RunCmd('set', '') + logging.info(os_type) if os_type is not None and "msys" in os_type: From 75da310f85557a207ee88d1da767699020ab975a Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 17 May 2024 15:45:09 -0700 Subject: [PATCH 037/139] another set --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index fc0270f2a..c2f70c59e 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -412,6 +412,8 @@ def win2posix(path): if ret != 0: return ret + RunCmd('set', '') + # Then we can make the firmware images with the fiptool built above cmd = "make" args = "CC=\"" + clang_path + "clang\"" From b6200c8433d8737815502aa542e1eb65a99ff2fa Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 17 May 2024 16:45:37 -0700 Subject: [PATCH 038/139] Finishing the where? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index c2f70c59e..d23864799 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -348,7 +348,7 @@ def PlatformPostBuild(self): # HACKHACK: This is to tell if this is running from a POSIX compatible shell os_type = shell_environment.GetEnvironment().get_shell_var("OSTYPE") - RunCmd('set', '') + RunCmd('where', 'make') logging.info(os_type) if os_type is not None and "msys" in os_type: From f8ca6f45afd7080ee72f59620cec33ff92855bf7 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 17 May 2024 17:04:38 -0700 Subject: [PATCH 039/139] another hack? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index d23864799..1e80b4643 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -347,10 +347,7 @@ def PlatformPostBuild(self): logging.info("Building TF-A") # HACKHACK: This is to tell if this is running from a POSIX compatible shell - os_type = shell_environment.GetEnvironment().get_shell_var("OSTYPE") - RunCmd('where', 'make') - logging.info(os_type) - + os_type = shell_environment.GetEnvironment().get_shell_var("GHCUP_MSYS2") if os_type is not None and "msys" in os_type: logging.critical("Running under Msys2, using msys-2.0.dll to convert paths") From f4375648bc4e2f2eaef27162a62f76cc5a6b13bd Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Mon, 20 May 2024 09:37:29 -0700 Subject: [PATCH 040/139] add more logs --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 1e80b4643..2333ac02e 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -348,7 +348,7 @@ def PlatformPostBuild(self): # HACKHACK: This is to tell if this is running from a POSIX compatible shell os_type = shell_environment.GetEnvironment().get_shell_var("GHCUP_MSYS2") - if os_type is not None and "msys" in os_type: + if os_type is None and "msys" in os_type: logging.critical("Running under Msys2, using msys-2.0.dll to convert paths") @@ -414,7 +414,7 @@ def win2posix(path): # Then we can make the firmware images with the fiptool built above cmd = "make" args = "CC=\"" + clang_path + "clang\"" - args += " PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() + args += " DEBUG=1 V=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) args += " SPM_MM=1 EL3_EXCEPTION_HANDLING=1 ENABLE_SME_FOR_NS=0 ENABLE_SVE_FOR_NS=0" From 4e8206c0d07bcd58f41b82c3a857ff9cd215a278 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Mon, 20 May 2024 11:17:11 -0700 Subject: [PATCH 041/139] how about now? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 2333ac02e..93dea2096 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -411,9 +411,13 @@ def win2posix(path): RunCmd('set', '') + current_path = shell_environment.GetEnvironment().get_shell_var("PATH") + current_path = os.pathsep.join([current_path, os.path.dirname(clang_path)]) + shell_environment.GetEnvironment().set_shell_var("PATH", current_path) + # Then we can make the firmware images with the fiptool built above cmd = "make" - args = "CC=\"" + clang_path + "clang\"" + args = "CC=clang" args += " DEBUG=1 V=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) From 7dd83bf4e859f7d74b42f9c7682f16732a8e980f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Mon, 20 May 2024 23:41:14 -0700 Subject: [PATCH 042/139] again.. --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 93dea2096..a8b6caa00 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -411,9 +411,7 @@ def win2posix(path): RunCmd('set', '') - current_path = shell_environment.GetEnvironment().get_shell_var("PATH") - current_path = os.pathsep.join([current_path, os.path.dirname(clang_path)]) - shell_environment.GetEnvironment().set_shell_var("PATH", current_path) + shell_environment.GetEnvironment().insert_path(clang_path) # Then we can make the firmware images with the fiptool built above cmd = "make" From 762d4cf015857904c17c30b7131b5f1c95c51548 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 21 May 2024 00:00:30 -0700 Subject: [PATCH 043/139] back to the beginning? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index ccb66c805..b6c094840 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit ccb66c80534fa43a23d86716adef9c555075a968 +Subproject commit b6c0948400594e3cc4dbb5a4ef04b815d2675808 From 252f43080e910b1d742a6782dbc74aeed5173413 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 21 May 2024 00:21:12 -0700 Subject: [PATCH 044/139] how is that? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index b6c094840..7d1b87592 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit b6c0948400594e3cc4dbb5a4ef04b815d2675808 +Subproject commit 7d1b8759255bd1e387bafe511c0a4fee9f3fd740 From 33c3fbb19ac8e263f013666390f0c5945588e5b0 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 21 May 2024 10:53:54 -0700 Subject: [PATCH 045/139] this should do? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 7d1b87592..2b8f53ba8 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 7d1b8759255bd1e387bafe511c0a4fee9f3fd740 +Subproject commit 2b8f53ba87228e864155822d7e6fd9f45230b270 From 561061e9b15460669947d0d5ce7efe979646a100 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 21 May 2024 14:45:41 -0700 Subject: [PATCH 046/139] Update the path --- Platforms/QemuSbsaPkg/PlatformBuild.py | 57 +------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index a8b6caa00..6fcb95b92 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -346,61 +346,8 @@ def PlatformPostBuild(self): logging.info("Building TF-A") - # HACKHACK: This is to tell if this is running from a POSIX compatible shell - os_type = shell_environment.GetEnvironment().get_shell_var("GHCUP_MSYS2") - if os_type is None and "msys" in os_type: - - logging.critical("Running under Msys2, using msys-2.0.dll to convert paths") - - import ctypes - import sys - - xunicode = str if sys.version_info[0] > 2 else eval("unicode") - - # If running under Msys2 Python, just use DLL name - # If running under non-Msys2 Windows Python, use full path to msys-2.0.dll - # Note Python and msys-2.0.dll must match bitness (i.e. 32-bit Python must - # use 32-bit msys-2.0.dll, 64-bit Python must use 64-bit msys-2.0.dll.) - msys = ctypes.cdll.LoadLibrary("msys-2.0.dll") - msys_create_path = msys.cygwin_create_path - msys_create_path.restype = ctypes.c_void_p - msys_create_path.argtypes = [ctypes.c_int32, ctypes.c_void_p] - - # Initialise the msys DLL. This step should only be done if using - # non-msys Python. If you are using msys Python don't do this because - # it has already been done for you. - if sys.platform != "msys": - msys_dll_init = msys.msys_dll_init - msys_dll_init.restype = None - msys_dll_init.argtypes = [] - msys_dll_init() - logging.critical("msys_dll_init() called") - - free = msys.free - free.restype = None - free.argtypes = [ctypes.c_void_p] - - logging.critical("msys-2.0.dll loaded") - - CCP_WIN_W_TO_POSIX = 3 - - def win2posix(path): - """Convert a Windows path to a msys path""" - result = msys_create_path(CCP_WIN_W_TO_POSIX, xunicode(path)) - if result is None: - raise Exception("msys_create_path failed") - value = ctypes.cast(result, ctypes.c_char_p).value - free(result) - return value - - logging.critical("win2posix() defined") - clang_path = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") - logging.critical("clang_path before = %s" % clang_path) - clang_path = win2posix(shell_environment.GetEnvironment().get_shell_var("CLANG_BIN")) - logging.critical("clang_path after = %s" % clang_path) - else: - clang_path = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") - logging.critical("clang_path simply = %s" % clang_path) + clang_path = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") + logging.critical("clang_path simply = %s" % clang_path) # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds cmd = "make" From 8c1707f182c6304765577f36a3e14ee1d4904df6 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 21 May 2024 14:47:19 -0700 Subject: [PATCH 047/139] Update tfa --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 2b8f53ba8..8ee2f94fc 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 2b8f53ba87228e864155822d7e6fd9f45230b270 +Subproject commit 8ee2f94fc2dd23808ced0971ba4bb39828eb97b9 From ad40db4e18594535a015c7f946a595a72d6a7a47 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 21 May 2024 14:50:39 -0700 Subject: [PATCH 048/139] Update tfa and remove fip tool build --- Platforms/QemuSbsaPkg/PlatformBuild.py | 10 +++++----- Silicon/Arm/TFA | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 6fcb95b92..7de004014 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -350,11 +350,11 @@ def PlatformPostBuild(self): logging.critical("clang_path simply = %s" % clang_path) # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds - cmd = "make" - args = " DEBUG=1 V=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" - ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) - if ret != 0: - return ret + # cmd = "make" + # args = " DEBUG=1 V=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + # ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) + # if ret != 0: + # return ret RunCmd('set', '') diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 8ee2f94fc..2b8f53ba8 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 8ee2f94fc2dd23808ced0971ba4bb39828eb97b9 +Subproject commit 2b8f53ba87228e864155822d7e6fd9f45230b270 From ab469ad5bd1702659c3866e2c452dbc7c52f18bd Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 21 May 2024 14:51:49 -0700 Subject: [PATCH 049/139] Finishing the yml --- .azurepipelines/Platform-Build-GCC5.yml | 178 ------------------------ .azurepipelines/Ubuntu-GCC5.yml | 68 --------- .azurepipelines/Windows-VS.yml | 58 -------- 3 files changed, 304 deletions(-) delete mode 100644 .azurepipelines/Platform-Build-GCC5.yml delete mode 100644 .azurepipelines/Ubuntu-GCC5.yml delete mode 100644 .azurepipelines/Windows-VS.yml diff --git a/.azurepipelines/Platform-Build-GCC5.yml b/.azurepipelines/Platform-Build-GCC5.yml deleted file mode 100644 index 0047b4b46..000000000 --- a/.azurepipelines/Platform-Build-GCC5.yml +++ /dev/null @@ -1,178 +0,0 @@ -## @file -# Azure Pipeline build file for building platforms with GCC. -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -resources: - repositories: - - repository: mu_devops - type: github - endpoint: microsoft - name: microsoft/mu_devops - ref: main - containers: - - container: linux-gcc - image: ghcr.io/microsoft/mu_devops/ubuntu-22-test:latest - options: --name mu_devops_build_container - -variables: -- group: tool-chain-ubuntu-gcc - -jobs: -- template: Platform-Build-Job.yml - parameters: - tool_chain_tag: 'GCC5' - vm_image: $(vm_image) - os_type: Linux - container_image: linux-gcc - build_matrix: - QemuQ35_DEBUG: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "" - BuildTarget: "DEBUG" - BuildExtraTag: "" - BuildExtraStep: - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_RELEASE: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "" - BuildExtraStep: - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_DEBUG_ARM: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "" - BuildTarget: "DEBUG" - BuildExtraTag: "ON_ARM" - BuildExtraStep: - - script: echo No extra steps provided - Run: false - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - **/*/*TestApp.efi - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_RELEASE_ARM: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "ON_ARM" - BuildExtraStep: - - script: echo No extra steps provided - Run: false - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - **/*/*TestApp.efi - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_NO_SMM_RELEASE: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildArch: IA32,X64 - BuildFlags: "BLD_*_SMM_ENABLED=FALSE" - BuildTarget: "RELEASE" - BuildExtraTag: "NO_SMM" - BuildExtraStep: - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=2 BLD_*_SMM_ENABLED=FALSE" - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - BuildArtifactsOther: "" - - QemuSbsa_DEBUG: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" - BuildArch: AARCH64 - BuildFlags: "" - BuildTarget: "DEBUG" - BuildExtraTag: "" - BuildExtraStep: - - script: sudo apt-get install -y libssl-dev - displayName: Install openssl - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - BuildArtifactsBinary: | - **/QEMU_EFI.fd - **/SECURE_FLASH0.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuSbsa_RELEASE: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" - BuildArch: AARCH64 - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "" - BuildExtraStep: - - script: sudo apt-get install -y libssl-dev - displayName: Install openssl - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - BuildArtifactsBinary: | - **/QEMU_EFI.fd - **/SECURE_FLASH0.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuSbsa_DEBUG_ARM: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" - BuildArch: AARCH64 - BuildFlags: "" - BuildTarget: "DEBUG" - BuildExtraTag: "ON_AARCH64" - BuildExtraStep: - - script: echo No extra steps provided - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMU_EFI.fd - **/SECURE_FLASH0.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuSbsa_RELEASE_ARM: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" - BuildArch: AARCH64 - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "ON_AARCH64" - BuildExtraStep: - - script: echo No extra steps provided - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMU_EFI.fd - **/SECURE_FLASH0.fd - BuildArtifactsOther: "**/unit_test_results/*" diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml deleted file mode 100644 index 498f3590b..000000000 --- a/.azurepipelines/Ubuntu-GCC5.yml +++ /dev/null @@ -1,68 +0,0 @@ -## @file -# Azure Pipeline build file for a build using Ubuntu and GCC. -# -# IMPORTANT: This file requires the local repo to contain a .azurepipelines/Matrix-Build-Job.yml file that -# performs the actual build steps for the configurations and packages supported by the repo. -# -# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there -# instead of the file in this repo. -# -# - Mu DevOps Repo: https://github.com/microsoft/mu_devops -# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -variables: -- group: architectures-arm-64-x86-64 -- group: tool-chain-ubuntu-gcc - -extends: - template: MuDevOpsWrapper.yml - parameters: - do_ci_build: true - do_ci_setup: true - do_non_ci_build: false - do_non_ci_setup: true - do_pr_eval: true - container_build: true - os_type: Linux - rust_build: true - extra_cargo_steps: - - script: pip install -r pip-requirements.txt --upgrade - displayName: Install and Upgrade pip Modules - condition: succeeded() - - task: CmdLine@2 - displayName: Repo Setup - inputs: - script: stuart_setup -c .pytool/CISettings.py - condition: succeeded() - build_matrix: - TARGET_QEMU: - Pkgs: 'QemuPkg' - Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - ArchList: IA32,X64,AARCH64 - TARGET_Q35: - Pkgs: 'QemuQ35Pkg' - Targets: 'NO-TARGET' - ArchList: IA32,X64 - TARGET_SBSA: - Pkgs: 'QemuSbsaPkg' - Targets: 'NO-TARGET' - ArchList: AARCH64 - TARGET_QEMU_ARM: - Pkgs: 'QemuPkg' - Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - ArchList: IA32,X64,AARCH64 - SelfHostAgent: true - TARGET_Q35_ARM: - Pkgs: 'QemuQ35Pkg' - Targets: 'NO-TARGET' - ArchList: IA32,X64 - SelfHostAgent: true - TARGET_SBSA_ARM: - Pkgs: 'QemuSbsaPkg' - Targets: 'NO-TARGET' - ArchList: AARCH64 - SelfHostAgent: true diff --git a/.azurepipelines/Windows-VS.yml b/.azurepipelines/Windows-VS.yml deleted file mode 100644 index e2333662b..000000000 --- a/.azurepipelines/Windows-VS.yml +++ /dev/null @@ -1,58 +0,0 @@ -## @file -# Azure Pipeline build file for a build using Windows and the latest Visual Studio toolchain supported. -# -# IMPORTANT: This file requires the local repo to contain a .azurepipelines/Matrix-Build-Job.yml file that -# performs the actual build steps for the configurations and packages supported by the repo. -# -# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there -# instead of the file in this repo. -# -# - Mu DevOps Repo: https://github.com/microsoft/mu_devops -# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -variables: -- group: architectures-x86-64 -- group: tool-chain-windows-visual-studio-latest - -extends: - template: MuDevOpsWrapper.yml - parameters: - do_ci_build: true - do_ci_setup: true - do_non_ci_build: false - do_non_ci_setup: true - do_pr_eval: true - os_type: Windows_NT - rust_build: true - extra_cargo_steps: - - script: pip install -r pip-requirements.txt --upgrade - displayName: Install and Upgrade pip Modules - condition: succeeded() - - task: CmdLine@2 - displayName: Repo Setup - inputs: - script: stuart_setup -c .pytool/CISettings.py - condition: succeeded() - build_matrix: - TARGET_QEMU: - Pkgs: 'QemuPkg' - Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - ArchList: IA32,X64,AARCH64 - TARGET_Q35: - Pkgs: 'QemuQ35Pkg' - Targets: 'NO-TARGET' - ArchList: IA32,X64 - TARGET_QEMU_ARM: - Pkgs: 'QemuPkg' - Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - ArchList: IA32,X64,AARCH64 - SelfHostAgent: true - TARGET_Q35_ARM: - Pkgs: 'QemuQ35Pkg' - Targets: 'NO-TARGET' - ArchList: IA32,X64 - SelfHostAgent: true From f7fc021cbac4d8ab9a01cbf7ea45c25635090596 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 21 May 2024 17:51:47 -0700 Subject: [PATCH 050/139] remvoe v=1 --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 7de004014..df6c138c3 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -351,7 +351,7 @@ def PlatformPostBuild(self): # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds # cmd = "make" - # args = " DEBUG=1 V=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + # args = " DEBUG=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" # ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) # if ret != 0: # return ret @@ -363,7 +363,7 @@ def PlatformPostBuild(self): # Then we can make the firmware images with the fiptool built above cmd = "make" args = "CC=clang" - args += " DEBUG=1 V=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() + args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) args += " SPM_MM=1 EL3_EXCEPTION_HANDLING=1 ENABLE_SME_FOR_NS=0 ENABLE_SVE_FOR_NS=0" From 18c78d4b0058b306d5a3fb29dd5a4396a075b2be Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 09:48:04 -0700 Subject: [PATCH 051/139] How is now? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 2b8f53ba8..8ee2f94fc 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 2b8f53ba87228e864155822d7e6fd9f45230b270 +Subproject commit 8ee2f94fc2dd23808ced0971ba4bb39828eb97b9 From 8b97ce1d711b88423e01ae9b1c7734b2854c67c8 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 11:25:40 -0700 Subject: [PATCH 052/139] update tfa for more pritns --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 8ee2f94fc..62c08d9a9 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 8ee2f94fc2dd23808ced0971ba4bb39828eb97b9 +Subproject commit 62c08d9a931838697bff31b17d046b38f72c1485 From 5caa9335112e20f4e790cb14b1dd6cbab9cc81ea Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 12:30:10 -0700 Subject: [PATCH 053/139] more crap --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 62c08d9a9..fe8c8cb40 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 62c08d9a931838697bff31b17d046b38f72c1485 +Subproject commit fe8c8cb40156117edbabd64384ba40b59c003f88 From eeca747a39345995dabf67ffdcb82d2903af100f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 12:30:45 -0700 Subject: [PATCH 054/139] drop more crap[ --- .azurepipelines/Platform-Build-VS.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 5346a1b60..bcc664acc 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -41,20 +41,3 @@ jobs: **/QEMU_EFI.fd **/SECURE_FLASH0.fd BuildArtifactsOther: "**/unit_test_results/*" - - QemuSbsa_RELEASE: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" - BuildArch: AARCH64 - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "" - BuildExtraStep: - - template: Steps/RustSetupSteps.yml@mu_devops - - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - BuildArtifactsBinary: | - **/QEMU_EFI.fd - **/SECURE_FLASH0.fd - BuildArtifactsOther: "**/unit_test_results/*" From 22fa0168c55651f9517c52a08acfc86a37dda4ed Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 13:08:40 -0700 Subject: [PATCH 055/139] one more --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index fe8c8cb40..4cf8b6606 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit fe8c8cb40156117edbabd64384ba40b59c003f88 +Subproject commit 4cf8b66063c59f8578bceb0a27222bc0ef339d65 From 26364b76014ce69c7b4d4b2d6cb8999ce80e2deb Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 15:17:41 -0700 Subject: [PATCH 056/139] quick test? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 4cf8b6606..0490f1ca3 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 4cf8b66063c59f8578bceb0a27222bc0ef339d65 +Subproject commit 0490f1ca31d6015a13b153834ae76726c9ab37e6 From b979af4d9892aba946ee5952d72a74fd32386cfc Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 15:18:55 -0700 Subject: [PATCH 057/139] Even quicker? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 87 ++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index df6c138c3..bc1402d45 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -322,6 +322,93 @@ def SetPlatformEnvAfterTarget(self): return 0 def PlatformPreBuild(self): + interesting_keys = ["ExtensionSdkDir", "INCLUDE", "LIB", "LIBPATH", "UniversalCRTSdkDir", + "UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVerBinPath", + "WindowsSDKVersion", "VCToolsInstallDir", "Path"] + if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": + HostInfo = GetHostInfo() + + # check to see if host is configured + # HostType for VS tools should be (defined in tools_def): + # x86 == 32bit Intel + # x64 == 64bit Intel + # arm == 32bit Arm + # arm64 == 64bit Arm + # + HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") + if HostType is not None: + HostType = HostType.lower() + self.Logger.info( + f"CLANG_VS_HOST defined by environment. Value is {HostType}") + else: + #figure it out based on host info + if HostInfo.arch == "x86": + if HostInfo.bit == "32": + HostType = "x86" + elif HostInfo.bit == "64": + HostType = "x64" + else: + # anything other than x86 or x64 is not supported + raise NotImplementedError() + + # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. + VC_HOST_ARCH_TRANSLATOR = { + "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} + + # now get the environment variables for the platform + shell_env = shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for the vars that interest us. + vs_vars = QueryVcVariables( + interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) + for (k, v) in vs_vars.items(): + shell_env.set_shell_var(k, v) + + HostInfo = GetHostInfo() + clang_exe = "clang.exe" if HostInfo.os == "Windows" else "clang" + ClangBin = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") + ClangBin_Default = "UNDEFINED" + + if HostInfo.os == "Windows": + ClangBin_Default = "D:\\LLVM\\bin\\\\" #need to escape the last slash as it seems to be removed + clang_exe += ".exe" + elif HostInfo.os == "Linux": + ClangBin_Default = "/LLVM/bin/" #this isn't right + else: + pass + if ClangBin is not None: + self.Logger.info("CLANG_BIN is already set.") + else: + # see if clang is on path. + for path_entry in os.getenv("PATH").split(os.pathsep): + path_entry = os.path.normpath(path_entry) + if os.path.isfile(os.path.join(path_entry, clang_exe)): + ClangBin = os.path.abspath(path_entry) + os.sep + break + if ClangBin is None: + # Didn't find it on path - try the install default. + ClangBin = ClangBin_Default + + shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) + + shell_environment.GetEnvironment().insert_path(ClangBin) + RunCmd("set", "") + + # Then we can make the firmware images with the fiptool built above + cmd = "make" + args = "CC=clang" + args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() + args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() + args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) + args += " SPM_MM=1 EL3_EXCEPTION_HANDLING=1 ENABLE_SME_FOR_NS=0 ENABLE_SVE_FOR_NS=0" + args += " ENABLE_FEAT_HCX=1" # Features used by hypervisor + # args += " FEATURE_DETECTION=1" # Enforces support for features enabled. + # args += " BL32=" + os.path.join(op_fv, "BL32_AP_MM.fd") + args += " all fip" + # args += " -j $(nproc)" + ret = RunCmd(cmd, args, workingdir= self.env.GetValue("ARM_TFA_PATH")) + if ret != 0: + return ret + return 0 # From 3fc6ff4d3eb695ddb26001747ac2fa022f8c65dd Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 15:31:49 -0700 Subject: [PATCH 058/139] Fixing the build? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- Silicon/Arm/TFA | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index bc1402d45..ac0d7ce15 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -369,7 +369,7 @@ def PlatformPreBuild(self): ClangBin_Default = "UNDEFINED" if HostInfo.os == "Windows": - ClangBin_Default = "D:\\LLVM\\bin\\\\" #need to escape the last slash as it seems to be removed + ClangBin_Default = "C:\\Program Files\\LLVM\\bin\\\\" #need to escape the last slash as it seems to be removed clang_exe += ".exe" elif HostInfo.os == "Linux": ClangBin_Default = "/LLVM/bin/" #this isn't right diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 0490f1ca3..317dc7463 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 0490f1ca31d6015a13b153834ae76726c9ab37e6 +Subproject commit 317dc74634a95aa705f95bff951ba043486dca37 From 371e4678de3f29a524adc4f358bb425e609d1748 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 16:27:25 -0700 Subject: [PATCH 059/139] how about this junk? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index ac0d7ce15..01bb9f889 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -395,7 +395,7 @@ def PlatformPreBuild(self): # Then we can make the firmware images with the fiptool built above cmd = "make" - args = "CC=clang" + args = "CC=\"" + ClangBin + "clang.exe\"" args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) From 9224499dc7c932e5f8da1e51d1534316d8c505bc Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 23:05:01 -0700 Subject: [PATCH 060/139] see if this will do? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 01bb9f889..7373d8b90 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -369,7 +369,10 @@ def PlatformPreBuild(self): ClangBin_Default = "UNDEFINED" if HostInfo.os == "Windows": - ClangBin_Default = "C:\\Program Files\\LLVM\\bin\\\\" #need to escape the last slash as it seems to be removed + ClangBin_Default = shell_environment.GetEnvironment().get_shell_var("AGENT_TEMPDIRECTORY") + if ClangBin_Default is None: + ClangBin_Default = "C:\\Program Files\\LLVM\\bin\\\\" #need to escape the last slash as it seems to be removed + logging.critical("ClangBin_Default = %s" % ClangBin_Default) clang_exe += ".exe" elif HostInfo.os == "Linux": ClangBin_Default = "/LLVM/bin/" #this isn't right From 5f2879b60b689a74bb1ae533b8b2c072e1c4f201 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 23:18:01 -0700 Subject: [PATCH 061/139] Updte tfa printing --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 317dc7463..35e481af5 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 317dc74634a95aa705f95bff951ba043486dca37 +Subproject commit 35e481af5fed3bcf692199f29659a23e513b4b49 From 7f10bac98b3192779e040c073c7f3542570d5881 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 23:20:00 -0700 Subject: [PATCH 062/139] clabg bin --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 7373d8b90..e408b1e33 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -372,6 +372,8 @@ def PlatformPreBuild(self): ClangBin_Default = shell_environment.GetEnvironment().get_shell_var("AGENT_TEMPDIRECTORY") if ClangBin_Default is None: ClangBin_Default = "C:\\Program Files\\LLVM\\bin\\\\" #need to escape the last slash as it seems to be removed + else: + ClangBin_Default += "\\LLVM\\bin\\\\" logging.critical("ClangBin_Default = %s" % ClangBin_Default) clang_exe += ".exe" elif HostInfo.os == "Linux": From 3daeb151afb0504e6dde2c37067e103ec666b9df Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 23:26:43 -0700 Subject: [PATCH 063/139] not chck out other submodules --- Platforms/QemuSbsaPkg/PlatformBuild.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index e408b1e33..2887122f9 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -83,17 +83,7 @@ def GetRequiredSubmodules(self): !!! note If no RequiredSubmodules return an empty iterable """ - return [ - RequiredSubmodule("MU_BASECORE", True), - RequiredSubmodule("Common/MU", True), - RequiredSubmodule("Common/MU_TIANO", True), - RequiredSubmodule("Common/MU_OEM_SAMPLE", True), - RequiredSubmodule("Silicon/Arm/MU_TIANO", True), - RequiredSubmodule("Silicon/Arm/TFA", True), - RequiredSubmodule("Features/DEBUGGER", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Features/CONFIG", True), - ] + return [] def SetArchitectures(self, list_of_requested_architectures): ''' Confirm the requests architecture list is valid and configure SettingsManager From b0551db309e6127182b328a6c37753bbd3eebc3f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 23:35:16 -0700 Subject: [PATCH 064/139] one more piece --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 2887122f9..ba95fa1be 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -83,7 +83,9 @@ def GetRequiredSubmodules(self): !!! note If no RequiredSubmodules return an empty iterable """ - return [] + return [ + RequiredSubmodule("MU_BASECORE", True), + ] def SetArchitectures(self, list_of_requested_architectures): ''' Confirm the requests architecture list is valid and configure SettingsManager From 8ef27f2842f946958fd2b5a5beb6670fbb511cee Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 23:44:12 -0700 Subject: [PATCH 065/139] that aint work --- Platforms/QemuSbsaPkg/PlatformBuild.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index ba95fa1be..e408b1e33 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -85,6 +85,14 @@ def GetRequiredSubmodules(self): """ return [ RequiredSubmodule("MU_BASECORE", True), + RequiredSubmodule("Common/MU", True), + RequiredSubmodule("Common/MU_TIANO", True), + RequiredSubmodule("Common/MU_OEM_SAMPLE", True), + RequiredSubmodule("Silicon/Arm/MU_TIANO", True), + RequiredSubmodule("Silicon/Arm/TFA", True), + RequiredSubmodule("Features/DEBUGGER", True), + RequiredSubmodule("Features/DFCI", True), + RequiredSubmodule("Features/CONFIG", True), ] def SetArchitectures(self, list_of_requested_architectures): From 88ba9981f2f58b046c56acf518251181d9c5a565 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 22 May 2024 23:51:38 -0700 Subject: [PATCH 066/139] How is that --- Platforms/QemuSbsaPkg/PlatformBuild.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index e408b1e33..7476614ac 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -84,15 +84,15 @@ def GetRequiredSubmodules(self): If no RequiredSubmodules return an empty iterable """ return [ - RequiredSubmodule("MU_BASECORE", True), - RequiredSubmodule("Common/MU", True), - RequiredSubmodule("Common/MU_TIANO", True), - RequiredSubmodule("Common/MU_OEM_SAMPLE", True), - RequiredSubmodule("Silicon/Arm/MU_TIANO", True), - RequiredSubmodule("Silicon/Arm/TFA", True), - RequiredSubmodule("Features/DEBUGGER", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Features/CONFIG", True), + RequiredSubmodule("MU_BASECORE", False), + RequiredSubmodule("Common/MU", False), + RequiredSubmodule("Common/MU_TIANO", False), + RequiredSubmodule("Common/MU_OEM_SAMPLE", False), + RequiredSubmodule("Silicon/Arm/MU_TIANO", False), + RequiredSubmodule("Silicon/Arm/TFA", False), + RequiredSubmodule("Features/DEBUGGER", False), + RequiredSubmodule("Features/DFCI", False), + RequiredSubmodule("Features/CONFIG", False), ] def SetArchitectures(self, list_of_requested_architectures): From ef4f94cb1f5db12f239318c94f5d5fa8110a8389 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 23 May 2024 00:18:17 -0700 Subject: [PATCH 067/139] this is really getting annoying --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 7476614ac..e533f9885 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -400,7 +400,7 @@ def PlatformPreBuild(self): # Then we can make the firmware images with the fiptool built above cmd = "make" - args = "CC=\"" + ClangBin + "clang.exe\"" + args = "CC=\"" + ClangBin.replace(os.sep, posixpath.sep) + "clang.exe\"" args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) From 0b37b8f682b65cd21153a077017dda6937b96f20 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 23 May 2024 00:27:28 -0700 Subject: [PATCH 068/139] last try --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index e533f9885..1933646df 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -373,7 +373,7 @@ def PlatformPreBuild(self): if ClangBin_Default is None: ClangBin_Default = "C:\\Program Files\\LLVM\\bin\\\\" #need to escape the last slash as it seems to be removed else: - ClangBin_Default += "\\LLVM\\bin\\\\" + ClangBin_Default += "\\LLVM\\bin\\" logging.critical("ClangBin_Default = %s" % ClangBin_Default) clang_exe += ".exe" elif HostInfo.os == "Linux": @@ -387,7 +387,7 @@ def PlatformPreBuild(self): for path_entry in os.getenv("PATH").split(os.pathsep): path_entry = os.path.normpath(path_entry) if os.path.isfile(os.path.join(path_entry, clang_exe)): - ClangBin = os.path.abspath(path_entry) + os.sep + ClangBin = os.path.abspath(path_entry) break if ClangBin is None: # Didn't find it on path - try the install default. From 7368c8a717d65fcffcfc788d2637abca284ef5c1 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 23 May 2024 09:34:10 -0700 Subject: [PATCH 069/139] how abhout this? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 1933646df..2abaa5b34 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -396,10 +396,11 @@ def PlatformPreBuild(self): shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) shell_environment.GetEnvironment().insert_path(ClangBin) + choco_path = shell_environment.GetEnvironment().get_shell_var("ChocolateyInstall") RunCmd("set", "") # Then we can make the firmware images with the fiptool built above - cmd = "make" + cmd = os.path.join(choco_path, "bin", "make") args = "CC=\"" + ClangBin.replace(os.sep, posixpath.sep) + "clang.exe\"" args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() From 232a5ffe25d82acb4722cef8add81034501d95db Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 23 May 2024 10:09:47 -0700 Subject: [PATCH 070/139] This should be better? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 2abaa5b34..5b8c688ce 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -278,7 +278,7 @@ def GetLoggingLevel(self, loggerType): "txt": logs to plain text file """ - return logging.INFO + return logging.DEBUG return super().GetLoggingLevel(loggerType) def SetPlatformEnv(self): @@ -396,8 +396,10 @@ def PlatformPreBuild(self): shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) shell_environment.GetEnvironment().insert_path(ClangBin) - choco_path = shell_environment.GetEnvironment().get_shell_var("ChocolateyInstall") RunCmd("set", "") + shell_environment.GetEnvironment().log_environment() + choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") + print(f"choco_path = {choco_path}") # Then we can make the firmware images with the fiptool built above cmd = os.path.join(choco_path, "bin", "make") From b795f9d0f98fbcbb370b3bb8b72e1bb767b08644 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 23 May 2024 10:27:39 -0700 Subject: [PATCH 071/139] Print more staff from TFA --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 35e481af5..a97ccaff2 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 35e481af5fed3bcf692199f29659a23e513b4b49 +Subproject commit a97ccaff21830eb5a265b6f9ed302601671701e0 From 6a8235322fc07ca80e2814fe441d5f9d91bf17d5 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 23 May 2024 11:46:58 -0700 Subject: [PATCH 072/139] print more crap --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index a97ccaff2..371448520 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit a97ccaff21830eb5a265b6f9ed302601671701e0 +Subproject commit 371448520cd881d8c8fdcbc134eff3b77e62c8f1 From 60ae3f5da0312ac7e18771bfa3e3e01a5fbe5826 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 23 May 2024 11:48:34 -0700 Subject: [PATCH 073/139] finish tfa --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 371448520..dd5446bb3 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 371448520cd881d8c8fdcbc134eff3b77e62c8f1 +Subproject commit dd5446bb3b58f72d0ded6e3e219c4775bf853ec3 From 6b43df5fe287688fe7b76b956cadb4599db47f7f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 23 May 2024 17:10:21 -0700 Subject: [PATCH 074/139] remove everything? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 78 +++++++++++++------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 5b8c688ce..fda76d2cd 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -322,46 +322,44 @@ def SetPlatformEnvAfterTarget(self): return 0 def PlatformPreBuild(self): - interesting_keys = ["ExtensionSdkDir", "INCLUDE", "LIB", "LIBPATH", "UniversalCRTSdkDir", - "UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVerBinPath", - "WindowsSDKVersion", "VCToolsInstallDir", "Path"] - if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": - HostInfo = GetHostInfo() - - # check to see if host is configured - # HostType for VS tools should be (defined in tools_def): - # x86 == 32bit Intel - # x64 == 64bit Intel - # arm == 32bit Arm - # arm64 == 64bit Arm - # - HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") - if HostType is not None: - HostType = HostType.lower() - self.Logger.info( - f"CLANG_VS_HOST defined by environment. Value is {HostType}") - else: - #figure it out based on host info - if HostInfo.arch == "x86": - if HostInfo.bit == "32": - HostType = "x86" - elif HostInfo.bit == "64": - HostType = "x64" - else: - # anything other than x86 or x64 is not supported - raise NotImplementedError() - - # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. - VC_HOST_ARCH_TRANSLATOR = { - "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} - - # now get the environment variables for the platform - shell_env = shell_environment.GetEnvironment() - # Use the tools lib to determine the correct values for the vars that interest us. - vs_vars = QueryVcVariables( - interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) - for (k, v) in vs_vars.items(): - shell_env.set_shell_var(k, v) + # interesting_keys = ["LIB", "LIBPATH", "VCToolsInstallDir", "Path"] + # if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": + # HostInfo = GetHostInfo() + + # # check to see if host is configured + # # HostType for VS tools should be (defined in tools_def): + # # x86 == 32bit Intel + # # x64 == 64bit Intel + # # arm == 32bit Arm + # # arm64 == 64bit Arm + # # + # HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") + # if HostType is not None: + # HostType = HostType.lower() + # self.Logger.info( + # f"CLANG_VS_HOST defined by environment. Value is {HostType}") + # else: + # #figure it out based on host info + # if HostInfo.arch == "x86": + # if HostInfo.bit == "32": + # HostType = "x86" + # elif HostInfo.bit == "64": + # HostType = "x64" + # else: + # # anything other than x86 or x64 is not supported + # raise NotImplementedError() + + # # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. + # VC_HOST_ARCH_TRANSLATOR = { + # "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} + + # # now get the environment variables for the platform + # shell_env = shell_environment.GetEnvironment() + # # Use the tools lib to determine the correct values for the vars that interest us. + # vs_vars = QueryVcVariables( + # interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) + # for (k, v) in vs_vars.items(): + # shell_env.set_shell_var(k, v) HostInfo = GetHostInfo() clang_exe = "clang.exe" if HostInfo.os == "Windows" else "clang" From 573267f88329813959470d2d409364efe8b652b1 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 09:45:49 -0700 Subject: [PATCH 075/139] flush path --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index fda76d2cd..4eb17e292 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -393,6 +393,8 @@ def PlatformPreBuild(self): shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) + path = os.environ["PATH"] + shell_environment.GetEnvironment().set_path('') shell_environment.GetEnvironment().insert_path(ClangBin) RunCmd("set", "") shell_environment.GetEnvironment().log_environment() From 6a9e4b0952b0cf04fbece50db1122a3eef782201 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 10:21:09 -0700 Subject: [PATCH 076/139] now should do --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index dd5446bb3..f87315b1d 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit dd5446bb3b58f72d0ded6e3e219c4775bf853ec3 +Subproject commit f87315b1da995b5f23243f06c69bda1183f2defb From 05c274108ad0489206e863a76e98a58243f0f7f2 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 11:37:15 -0700 Subject: [PATCH 077/139] now? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 4eb17e292..f34479acb 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -403,7 +403,7 @@ def PlatformPreBuild(self): # Then we can make the firmware images with the fiptool built above cmd = os.path.join(choco_path, "bin", "make") - args = "CC=\"" + ClangBin.replace(os.sep, posixpath.sep) + "clang.exe\"" + args = "CC=clang.exe" args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) From 14d97977e013814e9ddb63f5f699572e2bee6b6f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 12:10:13 -0700 Subject: [PATCH 078/139] make fip as well --- Platforms/QemuSbsaPkg/PlatformBuild.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index f34479acb..1b6241772 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -393,6 +393,12 @@ def PlatformPreBuild(self): shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) + cmd = "make" + args = " DEBUG=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) + if ret != 0: + return ret + path = os.environ["PATH"] shell_environment.GetEnvironment().set_path('') shell_environment.GetEnvironment().insert_path(ClangBin) From 5e46001ed00571adff3e5b2e4b7623401eed6031 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 12:35:41 -0700 Subject: [PATCH 079/139] add back the path? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 76 +++++++++++++------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 1b6241772..0912db6f1 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -322,44 +322,44 @@ def SetPlatformEnvAfterTarget(self): return 0 def PlatformPreBuild(self): - # interesting_keys = ["LIB", "LIBPATH", "VCToolsInstallDir", "Path"] - # if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": - # HostInfo = GetHostInfo() - - # # check to see if host is configured - # # HostType for VS tools should be (defined in tools_def): - # # x86 == 32bit Intel - # # x64 == 64bit Intel - # # arm == 32bit Arm - # # arm64 == 64bit Arm - # # - # HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") - # if HostType is not None: - # HostType = HostType.lower() - # self.Logger.info( - # f"CLANG_VS_HOST defined by environment. Value is {HostType}") - # else: - # #figure it out based on host info - # if HostInfo.arch == "x86": - # if HostInfo.bit == "32": - # HostType = "x86" - # elif HostInfo.bit == "64": - # HostType = "x64" - # else: - # # anything other than x86 or x64 is not supported - # raise NotImplementedError() - - # # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. - # VC_HOST_ARCH_TRANSLATOR = { - # "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} - - # # now get the environment variables for the platform - # shell_env = shell_environment.GetEnvironment() - # # Use the tools lib to determine the correct values for the vars that interest us. - # vs_vars = QueryVcVariables( - # interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) - # for (k, v) in vs_vars.items(): - # shell_env.set_shell_var(k, v) + interesting_keys = ["LIB", "LIBPATH", "VCToolsInstallDir", "Path"] + if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": + HostInfo = GetHostInfo() + + # check to see if host is configured + # HostType for VS tools should be (defined in tools_def): + # x86 == 32bit Intel + # x64 == 64bit Intel + # arm == 32bit Arm + # arm64 == 64bit Arm + # + HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") + if HostType is not None: + HostType = HostType.lower() + self.Logger.info( + f"CLANG_VS_HOST defined by environment. Value is {HostType}") + else: + #figure it out based on host info + if HostInfo.arch == "x86": + if HostInfo.bit == "32": + HostType = "x86" + elif HostInfo.bit == "64": + HostType = "x64" + else: + # anything other than x86 or x64 is not supported + raise NotImplementedError() + + # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. + VC_HOST_ARCH_TRANSLATOR = { + "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} + + # now get the environment variables for the platform + shell_env = shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for the vars that interest us. + vs_vars = QueryVcVariables( + interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) + for (k, v) in vs_vars.items(): + shell_env.set_shell_var(k, v) HostInfo = GetHostInfo() clang_exe = "clang.exe" if HostInfo.os == "Windows" else "clang" From 7a0bbea16d42cf64c82d57d9aedfcb7882541db9 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 13:40:34 -0700 Subject: [PATCH 080/139] Put it back to post build --- Platforms/QemuSbsaPkg/PlatformBuild.py | 65 +++++++++++--------------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 0912db6f1..5628b229a 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -322,6 +322,30 @@ def SetPlatformEnvAfterTarget(self): return 0 def PlatformPreBuild(self): + return 0 + + # + # Copy a file into the designated region of target FD. + # + def PatchRegion(self, fdfile, mainStart, size, srcfile): + src_size = os.stat(srcfile).st_size + if src_size > size: + logging.error("Source file size is larger than the target region") + return -1 + + with open(fdfile, "r+b") as fd, open(srcfile, "rb") as src: + fd.seek(mainStart) + patchImage = src.read(size) + fd.seek(mainStart) + fd.write(patchImage) + return 0 + + def PlatformPostBuild(self): + # Add a post build step to build BL31 and assemble the FD files + op_fv = os.path.join(self.env.GetValue("BUILD_OUTPUT_BASE"), "FV") + + logging.info("Building TF-A") + interesting_keys = ["LIB", "LIBPATH", "VCToolsInstallDir", "Path"] if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": HostInfo = GetHostInfo() @@ -393,17 +417,18 @@ def PlatformPreBuild(self): shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) + # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds cmd = "make" args = " DEBUG=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) if ret != 0: return ret + logging.info(f"ClangBin = {ClangBin}") path = os.environ["PATH"] shell_environment.GetEnvironment().set_path('') shell_environment.GetEnvironment().insert_path(ClangBin) RunCmd("set", "") - shell_environment.GetEnvironment().log_environment() choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") print(f"choco_path = {choco_path}") @@ -423,44 +448,6 @@ def PlatformPreBuild(self): if ret != 0: return ret - return 0 - - # - # Copy a file into the designated region of target FD. - # - def PatchRegion(self, fdfile, mainStart, size, srcfile): - src_size = os.stat(srcfile).st_size - if src_size > size: - logging.error("Source file size is larger than the target region") - return -1 - - with open(fdfile, "r+b") as fd, open(srcfile, "rb") as src: - fd.seek(mainStart) - patchImage = src.read(size) - fd.seek(mainStart) - fd.write(patchImage) - return 0 - - def PlatformPostBuild(self): - # Add a post build step to build BL31 and assemble the FD files - op_fv = os.path.join(self.env.GetValue("BUILD_OUTPUT_BASE"), "FV") - - logging.info("Building TF-A") - - clang_path = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") - logging.critical("clang_path simply = %s" % clang_path) - - # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds - # cmd = "make" - # args = " DEBUG=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" - # ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) - # if ret != 0: - # return ret - - RunCmd('set', '') - - shell_environment.GetEnvironment().insert_path(clang_path) - # Then we can make the firmware images with the fiptool built above cmd = "make" args = "CC=clang" From 4728e32bcd21f32ae4f9196a326493085c7b2fd6 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 13:40:56 -0700 Subject: [PATCH 081/139] add top of tfa --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index f87315b1d..9ced78843 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit f87315b1da995b5f23243f06c69bda1183f2defb +Subproject commit 9ced788437bd2fd4bbff0bbf4ea6eed1ccc17370 From b09ad911b49dc302d9b95583e5c28f55e0f1fe4d Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 13:58:40 -0700 Subject: [PATCH 082/139] simplfy the make --- Platforms/QemuSbsaPkg/PlatformBuild.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 5628b229a..5d59e9ded 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -434,23 +434,7 @@ def PlatformPostBuild(self): # Then we can make the firmware images with the fiptool built above cmd = os.path.join(choco_path, "bin", "make") - args = "CC=clang.exe" - args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() - args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() - args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) - args += " SPM_MM=1 EL3_EXCEPTION_HANDLING=1 ENABLE_SME_FOR_NS=0 ENABLE_SVE_FOR_NS=0" - args += " ENABLE_FEAT_HCX=1" # Features used by hypervisor - # args += " FEATURE_DETECTION=1" # Enforces support for features enabled. - # args += " BL32=" + os.path.join(op_fv, "BL32_AP_MM.fd") - args += " all fip" - # args += " -j $(nproc)" - ret = RunCmd(cmd, args, workingdir= self.env.GetValue("ARM_TFA_PATH")) - if ret != 0: - return ret - - # Then we can make the firmware images with the fiptool built above - cmd = "make" - args = "CC=clang" + args = "CC="+clang_exe args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) From ac69a8b887e1c41cabbc7d6bf227404edb4dc0b1 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 14:14:40 -0700 Subject: [PATCH 083/139] why do i need to update basecore all this time? --- MU_BASECORE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MU_BASECORE b/MU_BASECORE index ac9a2b15f..bdced549f 160000 --- a/MU_BASECORE +++ b/MU_BASECORE @@ -1 +1 @@ -Subproject commit ac9a2b15fa1fd100dabd75ec5fb089566b79ebdf +Subproject commit bdced549f811d87fb07cc8c4dc11652585cb69cb From afb0c5b2939b38dd7eae3440a84a514cd5e909ea Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 16:30:13 -0700 Subject: [PATCH 084/139] fix? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 5d59e9ded..43ad88124 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -84,15 +84,15 @@ def GetRequiredSubmodules(self): If no RequiredSubmodules return an empty iterable """ return [ - RequiredSubmodule("MU_BASECORE", False), - RequiredSubmodule("Common/MU", False), - RequiredSubmodule("Common/MU_TIANO", False), - RequiredSubmodule("Common/MU_OEM_SAMPLE", False), - RequiredSubmodule("Silicon/Arm/MU_TIANO", False), - RequiredSubmodule("Silicon/Arm/TFA", False), - RequiredSubmodule("Features/DEBUGGER", False), - RequiredSubmodule("Features/DFCI", False), - RequiredSubmodule("Features/CONFIG", False), + RequiredSubmodule("MU_BASECORE", True), + RequiredSubmodule("Common/MU", True), + RequiredSubmodule("Common/MU_TIANO", True), + RequiredSubmodule("Common/MU_OEM_SAMPLE", True), + RequiredSubmodule("Silicon/Arm/MU_TIANO", True), + RequiredSubmodule("Silicon/Arm/TFA", True), + RequiredSubmodule("Features/DEBUGGER", True), + RequiredSubmodule("Features/DFCI", True), + RequiredSubmodule("Features/CONFIG", True), ] def SetArchitectures(self, list_of_requested_architectures): From 1105284957ce7dab09625e0835d8661dabeba0a2 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 17:05:59 -0700 Subject: [PATCH 085/139] more --- Platforms/QemuSbsaPkg/PlatformBuild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 43ad88124..ad67cbeb3 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -181,7 +181,7 @@ def CleanTree(self, RemoveConfTemplateFilesToo=False): HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") if HostType is not None: HostType = HostType.lower() - self.Logger.info( + logging.info( f"CLANG_VS_HOST defined by environment. Value is {HostType}") else: #figure it out based on host info @@ -360,7 +360,7 @@ def PlatformPostBuild(self): HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") if HostType is not None: HostType = HostType.lower() - self.Logger.info( + logging.info( f"CLANG_VS_HOST defined by environment. Value is {HostType}") else: #figure it out based on host info @@ -403,7 +403,7 @@ def PlatformPostBuild(self): else: pass if ClangBin is not None: - self.Logger.info("CLANG_BIN is already set.") + logging.info("CLANG_BIN is already set.") else: # see if clang is on path. for path_entry in os.getenv("PATH").split(os.pathsep): From 56b8759e94ee36d4bf50e19f58f1484ca73e6496 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 24 May 2024 17:35:51 -0700 Subject: [PATCH 086/139] oops --- Platforms/QemuSbsaPkg/PlatformBuild.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index ad67cbeb3..2920a5275 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -397,7 +397,6 @@ def PlatformPostBuild(self): else: ClangBin_Default += "\\LLVM\\bin\\" logging.critical("ClangBin_Default = %s" % ClangBin_Default) - clang_exe += ".exe" elif HostInfo.os == "Linux": ClangBin_Default = "/LLVM/bin/" #this isn't right else: From 347fe97a512aa64a6503c8f7c1721f86bf9dfcf6 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Sun, 26 May 2024 21:17:10 -0700 Subject: [PATCH 087/139] it works now? --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 9ced78843..7600e0ae0 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 9ced788437bd2fd4bbff0bbf4ea6eed1ccc17370 +Subproject commit 7600e0ae0b2b5dde0605c20df5c46efc45dd1222 From 665fbe13fbcbfa74041e7f6e4ef2ef1d04ffba19 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Sun, 26 May 2024 23:22:13 -0700 Subject: [PATCH 088/139] update tfa --- Silicon/Arm/TFA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index 7600e0ae0..bb9799bcf 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit 7600e0ae0b2b5dde0605c20df5c46efc45dd1222 +Subproject commit bb9799bcf5fedcf2870637c12050fed29188c59b From 8de62e8d83f057e2526b49777dcc15e17ec952b8 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Sun, 26 May 2024 23:55:14 -0700 Subject: [PATCH 089/139] what about now? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 2920a5275..f8747d875 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -418,7 +418,7 @@ def PlatformPostBuild(self): # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds cmd = "make" - args = " DEBUG=1 fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) if ret != 0: return ret @@ -434,7 +434,7 @@ def PlatformPostBuild(self): # Then we can make the firmware images with the fiptool built above cmd = os.path.join(choco_path, "bin", "make") args = "CC="+clang_exe - args += " DEBUG=1 PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() + args += " PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) args += " SPM_MM=1 EL3_EXCEPTION_HANDLING=1 ENABLE_SME_FOR_NS=0 ENABLE_SVE_FOR_NS=0" From 2c5a1d6ddb00d19abbab97ea35d6fc36189e17fa Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Mon, 27 May 2024 23:13:52 -0700 Subject: [PATCH 090/139] another shot? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index f8747d875..1ef610007 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -416,8 +416,11 @@ def PlatformPostBuild(self): shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) + choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") + print(f"choco_path = {choco_path}") + # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds - cmd = "make" + cmd = os.path.join(choco_path, "bin", "make") args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) if ret != 0: @@ -428,8 +431,6 @@ def PlatformPostBuild(self): shell_environment.GetEnvironment().set_path('') shell_environment.GetEnvironment().insert_path(ClangBin) RunCmd("set", "") - choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") - print(f"choco_path = {choco_path}") # Then we can make the firmware images with the fiptool built above cmd = os.path.join(choco_path, "bin", "make") From 3ed9c18c53e680ca6ddb5a4aa3f0eeb13d8cc18f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 28 May 2024 10:18:20 -0700 Subject: [PATCH 091/139] come on... --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 1ef610007..ab2abf701 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -346,6 +346,8 @@ def PlatformPostBuild(self): logging.info("Building TF-A") + path = os.environ["PATH"] + shell_environment.GetEnvironment().set_path('') interesting_keys = ["LIB", "LIBPATH", "VCToolsInstallDir", "Path"] if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": HostInfo = GetHostInfo() @@ -427,8 +429,6 @@ def PlatformPostBuild(self): return ret logging.info(f"ClangBin = {ClangBin}") - path = os.environ["PATH"] - shell_environment.GetEnvironment().set_path('') shell_environment.GetEnvironment().insert_path(ClangBin) RunCmd("set", "") From 2ffeb76efcd834aafdd1b294a9654b11231775d7 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 28 May 2024 16:06:50 -0700 Subject: [PATCH 092/139] added more prints --- Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index fcbac5d49..3d1fa6aa6 100644 --- a/Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -432,6 +432,8 @@ InitializeSbsaQemuAcpiDxe ( // Parse the device tree and get the number of CPUs NumCores = FdtHelperCountCpus (); + DEBUG ((DEBUG_ERROR, "Number of Cores: %d\n", NumCores)); + DEBUG ((DEBUG_ERROR, "Number of Cores from PCD: %d\n", PcdGet32 (PcdCoreCount))); ASSERT (PcdGet32 (PcdCoreCount) == NumCores); // Check if ACPI Table Protocol has been installed From e76c8f49aeed7cde095a46f2e6dbdb8f27daa8f6 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 28 May 2024 17:56:39 -0700 Subject: [PATCH 093/139] try it here --- .azurepipelines/Platform-Build-VS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index bcc664acc..705fb280d 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -29,7 +29,7 @@ jobs: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" BuildArch: AARCH64 - BuildFlags: "" + BuildFlags: "BLD_*_QEMU_CORE_NUM=2" BuildTarget: "DEBUG" BuildExtraTag: "" BuildExtraStep: From 6f1ea138aa3ea178de065f92019d230bd585ab75 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 29 May 2024 12:26:57 -0700 Subject: [PATCH 094/139] update TFA --- .gitmodules | 2 +- Silicon/Arm/TFA | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index df7b462af..6f8e6827c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,7 +20,7 @@ branch = release/202302 [submodule "Silicon/Arm/TFA"] path = Silicon/Arm/TFA - url = https://github.com/kuqin12/arm-trusted-firmware.git + url = https://github.com/ARM-software/arm-trusted-firmware.git branch = v2.9.0 [submodule "Features/DFCI"] path = Features/DFCI diff --git a/Silicon/Arm/TFA b/Silicon/Arm/TFA index bb9799bcf..b6c094840 160000 --- a/Silicon/Arm/TFA +++ b/Silicon/Arm/TFA @@ -1 +1 @@ -Subproject commit bb9799bcf5fedcf2870637c12050fed29188c59b +Subproject commit b6c0948400594e3cc4dbb5a4ef04b815d2675808 From 21fddcb41224cc4092c56527aac65b79f6d5bf77 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 29 May 2024 12:28:58 -0700 Subject: [PATCH 095/139] Revert some junk --- Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index 3d1fa6aa6..fcbac5d49 100644 --- a/Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Platforms/QemuSbsaPkg/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -432,8 +432,6 @@ InitializeSbsaQemuAcpiDxe ( // Parse the device tree and get the number of CPUs NumCores = FdtHelperCountCpus (); - DEBUG ((DEBUG_ERROR, "Number of Cores: %d\n", NumCores)); - DEBUG ((DEBUG_ERROR, "Number of Cores from PCD: %d\n", PcdGet32 (PcdCoreCount))); ASSERT (PcdGet32 (PcdCoreCount) == NumCores); // Check if ACPI Table Protocol has been installed From 3b656736ce614480100b333108350498040cbf89 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 29 May 2024 12:31:10 -0700 Subject: [PATCH 096/139] revert more --- Platforms/QemuSbsaPkg/PlatformBuild.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index ab2abf701..c2c3fbd95 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -10,7 +10,6 @@ import uuid from io import StringIO from pathlib import Path -import posixpath from edk2toolext.environment import shell_environment from edk2toolext.environment.uefi_build import UefiBuilder @@ -278,7 +277,7 @@ def GetLoggingLevel(self, loggerType): "txt": logs to plain text file """ - return logging.DEBUG + return logging.INFO return super().GetLoggingLevel(loggerType) def SetPlatformEnv(self): From fbb19c13979bac5546fc0a2d7232db2d86a41245 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Mon, 3 Jun 2024 17:33:42 -0700 Subject: [PATCH 097/139] Update basecore --- MU_BASECORE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MU_BASECORE b/MU_BASECORE index bdced549f..fb7473500 160000 --- a/MU_BASECORE +++ b/MU_BASECORE @@ -1 +1 @@ -Subproject commit bdced549f811d87fb07cc8c4dc11652585cb69cb +Subproject commit fb7473500ad4dba185245e2ef441d8f69f8d49f2 From 2ca2ae6ede484b77c320cf0af65a9043eee073d3 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 4 Jun 2024 00:10:50 -0700 Subject: [PATCH 098/139] 4 cores by default --- .azurepipelines/Platform-Build-VS.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index e5cdc61ce..12f0cb230 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -28,14 +28,13 @@ jobs: QemuSbsa_DEBUG: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" - BuildFlags: "BLD_*_QEMU_CORE_NUM=2" BuildTarget: "DEBUG" BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" BuildArtifactsBinary: | **/QEMU_EFI.fd **/SECURE_FLASH0.fd From a78f52a886e8965f42271ae761c0c1cb73ee0bbd Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 4 Jun 2024 00:11:51 -0700 Subject: [PATCH 099/139] removed some junk --- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 1 - Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf | 1 - 2 files changed, 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index d09efdb64..253e8952c 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -1019,7 +1019,6 @@ # # Platform Driver # - EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf QemuPkg/VirtioBlkDxe/VirtioBlk.inf QemuPkg/VirtioScsiDxe/VirtioScsi.inf QemuPkg/VirtioNetDxe/VirtioNet.inf diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf b/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf index 4079fab72..8e2011e5d 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf @@ -202,7 +202,6 @@ READ_LOCK_STATUS = TRUE INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf - INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf # # PI DXE Drivers producing Architectural Protocols (EFI Services) From 620cffe1351bf28f986006a4df3a28e36f734d76 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 4 Jun 2024 10:15:12 -0700 Subject: [PATCH 100/139] Updated mu --- Common/MU | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/MU b/Common/MU index 927dbf842..8da8aa731 160000 --- a/Common/MU +++ b/Common/MU @@ -1 +1 @@ -Subproject commit 927dbf842988bacb81ff29f662bcbc806df88ce1 +Subproject commit 8da8aa73144066cfaf5fd404161560e63eb8bbd3 From ccabc2c91b09bab18f97e5f34caa7fa5a9ef0856 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 4 Jun 2024 10:40:23 -0700 Subject: [PATCH 101/139] Update mu basecore --- MU_BASECORE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MU_BASECORE b/MU_BASECORE index fb7473500..7a2c23291 160000 --- a/MU_BASECORE +++ b/MU_BASECORE @@ -1 +1 @@ -Subproject commit fb7473500ad4dba185245e2ef441d8f69f8d49f2 +Subproject commit 7a2c23291e14a389919d447cfeffe262050ff85f From fd6c219e14624f549ff89323164914d20dc3c777 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 4 Jun 2024 16:01:55 -0700 Subject: [PATCH 102/139] Add them back --- .azurepipelines/Platform-Build-GCC5.yml | 169 ++++++++++++++++++++++++ .azurepipelines/Ubuntu-GCC5.yml | 68 ++++++++++ .azurepipelines/Windows-VS.yml | 58 ++++++++ 3 files changed, 295 insertions(+) create mode 100644 .azurepipelines/Platform-Build-GCC5.yml create mode 100644 .azurepipelines/Ubuntu-GCC5.yml create mode 100644 .azurepipelines/Windows-VS.yml diff --git a/.azurepipelines/Platform-Build-GCC5.yml b/.azurepipelines/Platform-Build-GCC5.yml new file mode 100644 index 000000000..3cde03c7c --- /dev/null +++ b/.azurepipelines/Platform-Build-GCC5.yml @@ -0,0 +1,169 @@ +## @file +# Azure Pipeline build file for building platforms with GCC. +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +resources: + repositories: + - repository: mu_devops + type: github + endpoint: microsoft + name: microsoft/mu_devops + ref: main + containers: + - container: linux-gcc + image: ghcr.io/microsoft/mu_devops/ubuntu-22-test:latest + options: --name mu_devops_build_container + +variables: +- group: tool-chain-ubuntu-gcc + +jobs: +- template: Platform-Build-Job.yml + parameters: + tool_chain_tag: 'GCC5' + vm_image: $(vm_image) + os_type: Linux + container_image: linux-gcc + build_matrix: + QemuQ35_DEBUG: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_RELEASE: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_DEBUG_ARM: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "ON_ARM" + BuildExtraStep: + - script: echo No extra steps provided + Run: false + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + **/*/*TestApp.efi + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_RELEASE_ARM: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "ON_ARM" + BuildExtraStep: + - script: echo No extra steps provided + Run: false + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + **/*/*TestApp.efi + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_NO_SMM_RELEASE: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "BLD_*_SMM_ENABLED=FALSE" + BuildTarget: "RELEASE" + BuildExtraTag: "NO_SMM" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=2 BLD_*_SMM_ENABLED=FALSE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "" + + QemuSbsa_DEBUG: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "" + BuildExtraStep: + - script: sudo apt-get install -y libssl-dev + displayName: Install openssl + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuSbsa_RELEASE: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "" + BuildExtraStep: + - script: sudo apt-get install -y libssl-dev + displayName: Install openssl + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuSbsa_DEBUG_ARM: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "ON_AARCH64" + BuildExtraStep: + - script: echo No extra steps provided + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuSbsa_RELEASE_ARM: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "ON_AARCH64" + BuildExtraStep: + - script: echo No extra steps provided + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml new file mode 100644 index 000000000..498f3590b --- /dev/null +++ b/.azurepipelines/Ubuntu-GCC5.yml @@ -0,0 +1,68 @@ +## @file +# Azure Pipeline build file for a build using Ubuntu and GCC. +# +# IMPORTANT: This file requires the local repo to contain a .azurepipelines/Matrix-Build-Job.yml file that +# performs the actual build steps for the configurations and packages supported by the repo. +# +# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there +# instead of the file in this repo. +# +# - Mu DevOps Repo: https://github.com/microsoft/mu_devops +# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +variables: +- group: architectures-arm-64-x86-64 +- group: tool-chain-ubuntu-gcc + +extends: + template: MuDevOpsWrapper.yml + parameters: + do_ci_build: true + do_ci_setup: true + do_non_ci_build: false + do_non_ci_setup: true + do_pr_eval: true + container_build: true + os_type: Linux + rust_build: true + extra_cargo_steps: + - script: pip install -r pip-requirements.txt --upgrade + displayName: Install and Upgrade pip Modules + condition: succeeded() + - task: CmdLine@2 + displayName: Repo Setup + inputs: + script: stuart_setup -c .pytool/CISettings.py + condition: succeeded() + build_matrix: + TARGET_QEMU: + Pkgs: 'QemuPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: IA32,X64,AARCH64 + TARGET_Q35: + Pkgs: 'QemuQ35Pkg' + Targets: 'NO-TARGET' + ArchList: IA32,X64 + TARGET_SBSA: + Pkgs: 'QemuSbsaPkg' + Targets: 'NO-TARGET' + ArchList: AARCH64 + TARGET_QEMU_ARM: + Pkgs: 'QemuPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: IA32,X64,AARCH64 + SelfHostAgent: true + TARGET_Q35_ARM: + Pkgs: 'QemuQ35Pkg' + Targets: 'NO-TARGET' + ArchList: IA32,X64 + SelfHostAgent: true + TARGET_SBSA_ARM: + Pkgs: 'QemuSbsaPkg' + Targets: 'NO-TARGET' + ArchList: AARCH64 + SelfHostAgent: true diff --git a/.azurepipelines/Windows-VS.yml b/.azurepipelines/Windows-VS.yml new file mode 100644 index 000000000..e2333662b --- /dev/null +++ b/.azurepipelines/Windows-VS.yml @@ -0,0 +1,58 @@ +## @file +# Azure Pipeline build file for a build using Windows and the latest Visual Studio toolchain supported. +# +# IMPORTANT: This file requires the local repo to contain a .azurepipelines/Matrix-Build-Job.yml file that +# performs the actual build steps for the configurations and packages supported by the repo. +# +# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there +# instead of the file in this repo. +# +# - Mu DevOps Repo: https://github.com/microsoft/mu_devops +# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +variables: +- group: architectures-x86-64 +- group: tool-chain-windows-visual-studio-latest + +extends: + template: MuDevOpsWrapper.yml + parameters: + do_ci_build: true + do_ci_setup: true + do_non_ci_build: false + do_non_ci_setup: true + do_pr_eval: true + os_type: Windows_NT + rust_build: true + extra_cargo_steps: + - script: pip install -r pip-requirements.txt --upgrade + displayName: Install and Upgrade pip Modules + condition: succeeded() + - task: CmdLine@2 + displayName: Repo Setup + inputs: + script: stuart_setup -c .pytool/CISettings.py + condition: succeeded() + build_matrix: + TARGET_QEMU: + Pkgs: 'QemuPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: IA32,X64,AARCH64 + TARGET_Q35: + Pkgs: 'QemuQ35Pkg' + Targets: 'NO-TARGET' + ArchList: IA32,X64 + TARGET_QEMU_ARM: + Pkgs: 'QemuPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: IA32,X64,AARCH64 + SelfHostAgent: true + TARGET_Q35_ARM: + Pkgs: 'QemuQ35Pkg' + Targets: 'NO-TARGET' + ArchList: IA32,X64 + SelfHostAgent: true From db3332f7d9c7e870377b733d0563646f69bfee7f Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Tue, 4 Jun 2024 16:08:59 -0700 Subject: [PATCH 103/139] Update yml --- .azurepipelines/MuDevOpsWrapper.yml | 6 +++++- .azurepipelines/Platform-Build-Job.yml | 2 +- .azurepipelines/Ubuntu-GCC5.yml | 1 + .azurepipelines/Windows-VS.yml | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.azurepipelines/MuDevOpsWrapper.yml b/.azurepipelines/MuDevOpsWrapper.yml index e83828382..a9a8d889a 100644 --- a/.azurepipelines/MuDevOpsWrapper.yml +++ b/.azurepipelines/MuDevOpsWrapper.yml @@ -73,6 +73,10 @@ parameters: displayName: Whether Rust code is being built type: boolean default: false +- name: tool_chain_tag + displayName: Tool Chain (e.g. VS2022) + type: string + default: '$(tool_chain_tag)' - name: extra_cargo_steps displayName: Extra Steps to Run Before Standard Cargo Steps type: stepList @@ -94,7 +98,7 @@ jobs: os_type: ${{ parameters.os_type }} pool_name: ${{ parameters.pool_name }} extra_install_step: ${{ parameters.extra_install_step }} - tool_chain_tag: $(tool_chain_tag) + tool_chain_tag: ${{ parameters.tool_chain_tag }} vm_image: $(vm_image) container_build: ${{ parameters.container_build }} rust_build: ${{ parameters.rust_build }} diff --git a/.azurepipelines/Platform-Build-Job.yml b/.azurepipelines/Platform-Build-Job.yml index a8c35ec65..8fcccf1ca 100644 --- a/.azurepipelines/Platform-Build-Job.yml +++ b/.azurepipelines/Platform-Build-Job.yml @@ -100,7 +100,7 @@ jobs: run_timeout: ${{ parameters.run_timeout }} extra_install_step: ${{ parameters.extra_install_step }} install_tools: ${{ and(ne(item.Value.SelfHostAgent, true), eq(parameters.container_image, '')) }} - artifacts_identifier: '${{ item.Value.BuildPackage }} $(tool_chain_tag) ${{ item.Value.BuildTarget }} ${{ item.Value.BuildExtraTag }}' + artifacts_identifier: '${{ item.Value.BuildPackage }} ${{ parameters.tool_chain_tag }} ${{ item.Value.BuildTarget }} ${{ item.Value.BuildExtraTag }}' artifacts_binary: ${{ item.Value.BuildArtifactsBinary }} ${{ if or(eq(item.Value.Run, true), eq(parameters.os_type, 'Linux'), EndsWith(item.Key, 'CODE_COVERAGE')) }}: artifacts_other: ${{ item.Value.BuildArtifactsOther }} diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml index 498f3590b..4e5959504 100644 --- a/.azurepipelines/Ubuntu-GCC5.yml +++ b/.azurepipelines/Ubuntu-GCC5.yml @@ -29,6 +29,7 @@ extends: container_build: true os_type: Linux rust_build: true + tool_chain_tag: 'CLANGPDB' extra_cargo_steps: - script: pip install -r pip-requirements.txt --upgrade displayName: Install and Upgrade pip Modules diff --git a/.azurepipelines/Windows-VS.yml b/.azurepipelines/Windows-VS.yml index e2333662b..75a9c67ce 100644 --- a/.azurepipelines/Windows-VS.yml +++ b/.azurepipelines/Windows-VS.yml @@ -28,6 +28,7 @@ extends: do_pr_eval: true os_type: Windows_NT rust_build: true + tool_chain_tag: 'CLANGPDB' extra_cargo_steps: - script: pip install -r pip-requirements.txt --upgrade displayName: Install and Upgrade pip Modules From 7aeeb4c6b554121a24bea8bc37908bf1a4c63c80 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 11:46:14 -0700 Subject: [PATCH 104/139] revert changes after discussion --- .azurepipelines/MuDevOpsWrapper.yml | 6 +----- .azurepipelines/Ubuntu-GCC5.yml | 1 - .azurepipelines/Windows-VS.yml | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.azurepipelines/MuDevOpsWrapper.yml b/.azurepipelines/MuDevOpsWrapper.yml index a9a8d889a..e83828382 100644 --- a/.azurepipelines/MuDevOpsWrapper.yml +++ b/.azurepipelines/MuDevOpsWrapper.yml @@ -73,10 +73,6 @@ parameters: displayName: Whether Rust code is being built type: boolean default: false -- name: tool_chain_tag - displayName: Tool Chain (e.g. VS2022) - type: string - default: '$(tool_chain_tag)' - name: extra_cargo_steps displayName: Extra Steps to Run Before Standard Cargo Steps type: stepList @@ -98,7 +94,7 @@ jobs: os_type: ${{ parameters.os_type }} pool_name: ${{ parameters.pool_name }} extra_install_step: ${{ parameters.extra_install_step }} - tool_chain_tag: ${{ parameters.tool_chain_tag }} + tool_chain_tag: $(tool_chain_tag) vm_image: $(vm_image) container_build: ${{ parameters.container_build }} rust_build: ${{ parameters.rust_build }} diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml index 4e5959504..498f3590b 100644 --- a/.azurepipelines/Ubuntu-GCC5.yml +++ b/.azurepipelines/Ubuntu-GCC5.yml @@ -29,7 +29,6 @@ extends: container_build: true os_type: Linux rust_build: true - tool_chain_tag: 'CLANGPDB' extra_cargo_steps: - script: pip install -r pip-requirements.txt --upgrade displayName: Install and Upgrade pip Modules diff --git a/.azurepipelines/Windows-VS.yml b/.azurepipelines/Windows-VS.yml index 75a9c67ce..e2333662b 100644 --- a/.azurepipelines/Windows-VS.yml +++ b/.azurepipelines/Windows-VS.yml @@ -28,7 +28,6 @@ extends: do_pr_eval: true os_type: Windows_NT rust_build: true - tool_chain_tag: 'CLANGPDB' extra_cargo_steps: - script: pip install -r pip-requirements.txt --upgrade displayName: Install and Upgrade pip Modules From 21f438630fd442ca139e03279363a24198f42eaa Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 11:50:39 -0700 Subject: [PATCH 105/139] update submodule --- Silicon/Arm/MU_TIANO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Arm/MU_TIANO b/Silicon/Arm/MU_TIANO index a138e108d..dd475dab6 160000 --- a/Silicon/Arm/MU_TIANO +++ b/Silicon/Arm/MU_TIANO @@ -1 +1 @@ -Subproject commit a138e108dea945f1472fa86e86d110fca29b8768 +Subproject commit dd475dab6fe304b80824c1ade2d97281641b5f47 From 30be1504b5e532199f2f4ac45784d5d2782f92e9 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 11:51:06 -0700 Subject: [PATCH 106/139] update to new basecore --- MU_BASECORE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MU_BASECORE b/MU_BASECORE index 7a2c23291..8a25901f9 160000 --- a/MU_BASECORE +++ b/MU_BASECORE @@ -1 +1 @@ -Subproject commit 7a2c23291e14a389919d447cfeffe262050ff85f +Subproject commit 8a25901f9e788aeddbfccf45daab3f67c54148f7 From 91c56571707ce4b374ff583f5be00b3654ee5441 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 11:57:35 -0700 Subject: [PATCH 107/139] revert some changes --- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 2 +- Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index 253e8952c..ba9a99075 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -1019,6 +1019,7 @@ # # Platform Driver # + EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf QemuPkg/VirtioBlkDxe/VirtioBlk.inf QemuPkg/VirtioScsiDxe/VirtioScsi.inf QemuPkg/VirtioNetDxe/VirtioNet.inf @@ -1402,7 +1403,6 @@ GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] - GCC:*_GCC*_ARM_DLINK_FLAGS = -z common-page-size=0x1000 GCC:*_GCC*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000 GCC:*_CLANGPDB_AARCH64_DLINK_FLAGS = /ALIGN:0x10000 RVCT:*_*_ARM_DLINK_FLAGS = --scatter $(EDK_TOOLS_PATH)/Scripts/Rvct-Align4K.sct diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf b/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf index 8e2011e5d..4079fab72 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf @@ -202,6 +202,7 @@ READ_LOCK_STATUS = TRUE INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf # # PI DXE Drivers producing Architectural Protocols (EFI Services) From d1b0e0a6ca5e3eb96804470ada8f6025cee4ffe5 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 13:14:05 -0700 Subject: [PATCH 108/139] added back more --- .azurepipelines/Platform-Build-VS.yml | 258 +++++++++++++++++++++++++- 1 file changed, 255 insertions(+), 3 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 12f0cb230..06c2a6be3 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -10,13 +10,119 @@ resources: - repository: mu_devops type: github endpoint: microsoft - name: kuqin12/mu_devops - ref: add_clangpdb + name: microsoft/mu_devops + ref: main variables: - group: tool-chain-windows-visual-studio-latest jobs: +- template: Platform-Build-Job.yml + parameters: + extra_install_step: + - template: Steps/InstallCoverageTools.yml@mu_devops + tool_chain_tag: 'VS2022' + vm_image: $(vm_image) + os_type: Windows_NT + build_matrix: + QemuQ35_DEBUG: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_RELEASE: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_DEBUG_ARM: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "ON_ARM" + BuildExtraStep: + - script: echo No extra steps provided + Run: false + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + **/*/*TestApp.efi + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_RELEASE_ARM: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "ON_ARM" + BuildExtraStep: + - script: echo No extra steps provided + Run: false + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + **/*/*TestApp.efi + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_NO_SMM_RELEASE: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "BLD_*_SMM_ENABLED=FALSE" + BuildTarget: "RELEASE" + BuildExtraTag: "NO_SMM" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=2 BLD_*_SMM_ENABLED=FALSE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "" + + QemuQ35_CODE_COVERAGE: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/Test/PlatformTest.py" + BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" + BuildTarget: "NOOPT" + BuildExtraTag: "UNIT_TESTS" + BuildExtraStep: + - script: dotnet tool install -g dotnet-reportgenerator-globaltool + displayName: Install Report Generator + BuildArtifactsOther: "**/Coverage/**" + Run: false + + QemuSbsa_CODE_COVERAGE: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/Test/PlatformTest.py" + BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" + BuildTarget: "NOOPT" + BuildExtraTag: "UNIT_TESTS" + BuildExtraStep: + - script: dotnet tool install -g dotnet-reportgenerator-globaltool + displayName: Install Report Generator + BuildArtifactsOther: "**/Coverage/**" + Run: false + - template: Platform-Build-Job.yml parameters: extra_install_step: @@ -25,11 +131,71 @@ jobs: vm_image: $(vm_image) os_type: Windows_NT build_matrix: + QemuQ35_DEBUG: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "CLANGPDB" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_RELEASE: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "CLANGPDB" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_DEBUG_ARM: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "CLANGPDB_ON_ARM" + BuildExtraStep: + - script: echo No extra steps provided + Run: false + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + **/*/*TestApp.efi + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_RELEASE_ARM: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "CLANGPDB_ON_ARM" + BuildExtraStep: + - script: echo No extra steps provided + Run: false + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + **/*/*TestApp.efi + BuildArtifactsOther: "**/unit_test_results/*" + QemuSbsa_DEBUG: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" BuildTarget: "DEBUG" - BuildExtraTag: "" + BuildExtraTag: "CLANGPDB" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops @@ -39,3 +205,89 @@ jobs: **/QEMU_EFI.fd **/SECURE_FLASH0.fd BuildArtifactsOther: "**/unit_test_results/*" + + QemuSbsa_RELEASE: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "CLANGPDB" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuSbsa_DEBUG_ARM: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "DEBUG" + BuildExtraTag: "CLANGPDB_ON_AARCH64" + BuildExtraStep: + - script: echo No extra steps provided + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuSbsa_RELEASE_ARM: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" + BuildFlags: "" + BuildTarget: "RELEASE" + BuildExtraTag: "CLANGPDB_ON_AARCH64" + BuildExtraStep: + - script: echo No extra steps provided + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" + SelfHostAgent: true + BuildArtifactsBinary: | + **/QEMU_EFI.fd + **/SECURE_FLASH0.fd + BuildArtifactsOther: "**/unit_test_results/*" + + QemuQ35_NO_SMM_RELEASE: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" + BuildFlags: "BLD_*_SMM_ENABLED=FALSE" + BuildTarget: "RELEASE" + BuildExtraTag: "CLANGPDB_NO_SMM" + BuildExtraStep: + - template: Steps/RustSetupSteps.yml@mu_devops + Run: true + RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=2 BLD_*_SMM_ENABLED=FALSE" + BuildArtifactsBinary: | + **/QEMUQ35_*.fd + BuildArtifactsOther: "" + + QemuQ35_CODE_COVERAGE: + BuildPackage: QemuQ35Pkg + BuildFile: "Platforms/QemuQ35Pkg/Test/PlatformTest.py" + BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" + BuildTarget: "NOOPT" + BuildExtraTag: "CLANGPDB_UNIT_TESTS" + BuildExtraStep: + - script: dotnet tool install -g dotnet-reportgenerator-globaltool + displayName: Install Report Generator + BuildArtifactsOther: "**/Coverage/**" + Run: false + + QemuSbsa_CODE_COVERAGE: + BuildPackage: QemuSbsaPkg + BuildFile: "Platforms/QemuSbsaPkg/Test/PlatformTest.py" + BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" + BuildTarget: "NOOPT" + BuildExtraTag: "CLANGPDB_UNIT_TESTS" + BuildExtraStep: + - script: dotnet tool install -g dotnet-reportgenerator-globaltool + displayName: Install Report Generator + BuildArtifactsOther: "**/Coverage/**" + Run: false From e98fc7ebcf5c619fb8f2f719a47692be70d1690a Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 13:16:52 -0700 Subject: [PATCH 109/139] complete that --- .azurepipelines/Platform-Build-VS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 06c2a6be3..c3220d154 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -10,8 +10,8 @@ resources: - repository: mu_devops type: github endpoint: microsoft - name: microsoft/mu_devops - ref: main + name: kuqin12/mu_devops + ref: add_clangpdb variables: - group: tool-chain-windows-visual-studio-latest From 55680ea6c82648cc65bc8ae924b468069eafefe2 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 13:20:00 -0700 Subject: [PATCH 110/139] more changes --- .azurepipelines/Platform-Build-VS.yml | 44 +++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index c3220d154..a311ead13 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -131,12 +131,12 @@ jobs: vm_image: $(vm_image) os_type: Windows_NT build_matrix: - QemuQ35_DEBUG: + QemuQ35_DEBUG_CLANGPDB: BuildPackage: QemuQ35Pkg BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" BuildFlags: "" BuildTarget: "DEBUG" - BuildExtraTag: "CLANGPDB" + BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops Run: true @@ -145,12 +145,12 @@ jobs: **/QEMUQ35_*.fd BuildArtifactsOther: "**/unit_test_results/*" - QemuQ35_RELEASE: + QemuQ35_RELEASE_CLANGPDB: BuildPackage: QemuQ35Pkg BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" BuildFlags: "" BuildTarget: "RELEASE" - BuildExtraTag: "CLANGPDB" + BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops Run: true @@ -159,12 +159,12 @@ jobs: **/QEMUQ35_*.fd BuildArtifactsOther: "**/unit_test_results/*" - QemuQ35_DEBUG_ARM: + QemuQ35_DEBUG_ARM_CLANGPDB: BuildPackage: QemuQ35Pkg BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" BuildFlags: "" BuildTarget: "DEBUG" - BuildExtraTag: "CLANGPDB_ON_ARM" + BuildExtraTag: "ON_ARM" BuildExtraStep: - script: echo No extra steps provided Run: false @@ -175,12 +175,12 @@ jobs: **/*/*TestApp.efi BuildArtifactsOther: "**/unit_test_results/*" - QemuQ35_RELEASE_ARM: + QemuQ35_RELEASE_ARM_CLANGPDB: BuildPackage: QemuQ35Pkg BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" BuildFlags: "" BuildTarget: "RELEASE" - BuildExtraTag: "CLANGPDB_ON_ARM" + BuildExtraTag: "ON_ARM" BuildExtraStep: - script: echo No extra steps provided Run: false @@ -191,11 +191,11 @@ jobs: **/*/*TestApp.efi BuildArtifactsOther: "**/unit_test_results/*" - QemuSbsa_DEBUG: + QemuSbsa_DEBUG_CLANGPDB: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" BuildTarget: "DEBUG" - BuildExtraTag: "CLANGPDB" + BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops @@ -206,12 +206,12 @@ jobs: **/SECURE_FLASH0.fd BuildArtifactsOther: "**/unit_test_results/*" - QemuSbsa_RELEASE: + QemuSbsa_RELEASE_CLANGPDB: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" BuildFlags: "" BuildTarget: "RELEASE" - BuildExtraTag: "CLANGPDB" + BuildExtraTag: "" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops - template: Steps/SetupToolChainTagPreReqs.yml@mu_devops @@ -222,12 +222,12 @@ jobs: **/SECURE_FLASH0.fd BuildArtifactsOther: "**/unit_test_results/*" - QemuSbsa_DEBUG_ARM: + QemuSbsa_DEBUG_ARM_CLANGPDB: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" BuildFlags: "" BuildTarget: "DEBUG" - BuildExtraTag: "CLANGPDB_ON_AARCH64" + BuildExtraTag: "ON_AARCH64" BuildExtraStep: - script: echo No extra steps provided Run: true @@ -238,12 +238,12 @@ jobs: **/SECURE_FLASH0.fd BuildArtifactsOther: "**/unit_test_results/*" - QemuSbsa_RELEASE_ARM: + QemuSbsa_RELEASE_ARM_CLANGPDB: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" BuildFlags: "" BuildTarget: "RELEASE" - BuildExtraTag: "CLANGPDB_ON_AARCH64" + BuildExtraTag: "ON_AARCH64" BuildExtraStep: - script: echo No extra steps provided Run: true @@ -254,12 +254,12 @@ jobs: **/SECURE_FLASH0.fd BuildArtifactsOther: "**/unit_test_results/*" - QemuQ35_NO_SMM_RELEASE: + QemuQ35_NO_SMM_RELEASE_CLANGPDB: BuildPackage: QemuQ35Pkg BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" BuildFlags: "BLD_*_SMM_ENABLED=FALSE" BuildTarget: "RELEASE" - BuildExtraTag: "CLANGPDB_NO_SMM" + BuildExtraTag: "NO_SMM" BuildExtraStep: - template: Steps/RustSetupSteps.yml@mu_devops Run: true @@ -268,24 +268,24 @@ jobs: **/QEMUQ35_*.fd BuildArtifactsOther: "" - QemuQ35_CODE_COVERAGE: + QemuQ35_CODE_COVERAGE_CLANGPDB: BuildPackage: QemuQ35Pkg BuildFile: "Platforms/QemuQ35Pkg/Test/PlatformTest.py" BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" BuildTarget: "NOOPT" - BuildExtraTag: "CLANGPDB_UNIT_TESTS" + BuildExtraTag: "UNIT_TESTS" BuildExtraStep: - script: dotnet tool install -g dotnet-reportgenerator-globaltool displayName: Install Report Generator BuildArtifactsOther: "**/Coverage/**" Run: false - QemuSbsa_CODE_COVERAGE: + QemuSbsa_CODE_COVERAGE_CLANGPDB: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/Test/PlatformTest.py" BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" BuildTarget: "NOOPT" - BuildExtraTag: "CLANGPDB_UNIT_TESTS" + BuildExtraTag: "UNIT_TESTS" BuildExtraStep: - script: dotnet tool install -g dotnet-reportgenerator-globaltool displayName: Install Report Generator From 2a4994fe9b410c0ebd89ba725e5c7a01fba9516d Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 13:21:59 -0700 Subject: [PATCH 111/139] more changes --- .azurepipelines/Platform-Build-VS.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index a311ead13..68c4d237c 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -267,27 +267,3 @@ jobs: BuildArtifactsBinary: | **/QEMUQ35_*.fd BuildArtifactsOther: "" - - QemuQ35_CODE_COVERAGE_CLANGPDB: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/Test/PlatformTest.py" - BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" - BuildTarget: "NOOPT" - BuildExtraTag: "UNIT_TESTS" - BuildExtraStep: - - script: dotnet tool install -g dotnet-reportgenerator-globaltool - displayName: Install Report Generator - BuildArtifactsOther: "**/Coverage/**" - Run: false - - QemuSbsa_CODE_COVERAGE_CLANGPDB: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/Test/PlatformTest.py" - BuildFlags: "CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary" - BuildTarget: "NOOPT" - BuildExtraTag: "UNIT_TESTS" - BuildExtraStep: - - script: dotnet tool install -g dotnet-reportgenerator-globaltool - displayName: Install Report Generator - BuildArtifactsOther: "**/Coverage/**" - Run: false From 194f426f220d52a5ef85b244166ccab4facbcf33 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 14:10:25 -0700 Subject: [PATCH 112/139] test change --- .gitmodules | 2 +- Common/MU | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6f8e6827c..a0da7ebae 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,7 +8,7 @@ branch = release/202302 [submodule "Common/MU"] path = Common/MU - url = https://github.com/microsoft/mu_plus.git + url = https://github.com/kuqin12/mu_plus.git branch = release/202302 [submodule "Common/MU_OEM_SAMPLE"] path = Common/MU_OEM_SAMPLE diff --git a/Common/MU b/Common/MU index 8da8aa731..06798eb31 160000 --- a/Common/MU +++ b/Common/MU @@ -1 +1 @@ -Subproject commit 8da8aa73144066cfaf5fd404161560e63eb8bbd3 +Subproject commit 06798eb31f6cb9cbd2b9a030755f26a81aa7199f From 4e5ed6c7813e77653cbd7872f32de65fc545dc91 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 15:04:23 -0700 Subject: [PATCH 113/139] bottom line --- Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc b/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc index 34627432a..7f1586706 100644 --- a/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc +++ b/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc @@ -1533,4 +1533,5 @@ QemuQ35Pkg/Library/ResetSystemLib/StandaloneMmResetSystemLib.inf # protection of DXE_SMM_DRIVER/SMM_CORE modules [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER, BuildOptions.common.EDKII.SMM_CORE, BuildOptions.common.EDKII.DXE_DRIVER, BuildOptions.common.EDKII.DXE_CORE, BuildOptions.common.EDKII.UEFI_DRIVER, BuildOptions.common.EDKII.UEFI_APPLICATION, BuildOptions.common.EDKII.MM_CORE_STANDALONE, BuildOptions.common.EDKII.MM_STANDALONE] MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 - GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:4096 From f32abafba01f61a6e0a75a6cb61b571d4c80fd2c Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 15:05:32 -0700 Subject: [PATCH 114/139] default back to gcc --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index d8c132822..85d1fc196 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -270,7 +270,7 @@ def SetPlatformEnv(self): self.env.SetValue("PRODUCT_NAME", "QemuSbsa", "Platform Hardcoded") self.env.SetValue("ACTIVE_PLATFORM", "QemuSbsaPkg/QemuSbsaPkg.dsc", "Platform Hardcoded") self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue("TOOL_CHAIN_TAG", "GCC5", "set default to gcc5") self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") self.env.SetValue("QEMU_HEADLESS", "FALSE", "Default to false") From 4e9cfe950613b47b464acc332461125fca870d76 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 15:08:12 -0700 Subject: [PATCH 115/139] remove unused ones --- .azurepipelines/Platform-Build-VS.yml | 78 --------------------------- 1 file changed, 78 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 68c4d237c..16b1f22e8 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -159,38 +159,6 @@ jobs: **/QEMUQ35_*.fd BuildArtifactsOther: "**/unit_test_results/*" - QemuQ35_DEBUG_ARM_CLANGPDB: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildFlags: "" - BuildTarget: "DEBUG" - BuildExtraTag: "ON_ARM" - BuildExtraStep: - - script: echo No extra steps provided - Run: false - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - **/*/*TestApp.efi - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_RELEASE_ARM_CLANGPDB: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "ON_ARM" - BuildExtraStep: - - script: echo No extra steps provided - Run: false - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE BLD_*_QEMU_CORE_NUM=2 TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - **/*/*TestApp.efi - BuildArtifactsOther: "**/unit_test_results/*" - QemuSbsa_DEBUG_CLANGPDB: BuildPackage: QemuSbsaPkg BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" @@ -221,49 +189,3 @@ jobs: **/QEMU_EFI.fd **/SECURE_FLASH0.fd BuildArtifactsOther: "**/unit_test_results/*" - - QemuSbsa_DEBUG_ARM_CLANGPDB: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" - BuildFlags: "" - BuildTarget: "DEBUG" - BuildExtraTag: "ON_AARCH64" - BuildExtraStep: - - script: echo No extra steps provided - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMU_EFI.fd - **/SECURE_FLASH0.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuSbsa_RELEASE_ARM_CLANGPDB: - BuildPackage: QemuSbsaPkg - BuildFile: "Platforms/QemuSbsaPkg/PlatformBuild.py" - BuildFlags: "" - BuildTarget: "RELEASE" - BuildExtraTag: "ON_AARCH64" - BuildExtraStep: - - script: echo No extra steps provided - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE" - SelfHostAgent: true - BuildArtifactsBinary: | - **/QEMU_EFI.fd - **/SECURE_FLASH0.fd - BuildArtifactsOther: "**/unit_test_results/*" - - QemuQ35_NO_SMM_RELEASE_CLANGPDB: - BuildPackage: QemuQ35Pkg - BuildFile: "Platforms/QemuQ35Pkg/PlatformBuild.py" - BuildFlags: "BLD_*_SMM_ENABLED=FALSE" - BuildTarget: "RELEASE" - BuildExtraTag: "NO_SMM" - BuildExtraStep: - - template: Steps/RustSetupSteps.yml@mu_devops - Run: true - RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=2 BLD_*_SMM_ENABLED=FALSE" - BuildArtifactsBinary: | - **/QEMUQ35_*.fd - BuildArtifactsOther: "" From af69257de2a707e8b78ea8c6cd3a2e8ef4cba0fa Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 15:31:41 -0700 Subject: [PATCH 116/139] update mu_plus --- Common/MU | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/MU b/Common/MU index 06798eb31..0a1ce577e 160000 --- a/Common/MU +++ b/Common/MU @@ -1 +1 @@ -Subproject commit 06798eb31f6cb9cbd2b9a030755f26a81aa7199f +Subproject commit 0a1ce577e8c8f151f33d239ff52a80d4bc652e44 From 932ec4d5701006e95832dd12601f7baffb504b72 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 15:42:17 -0700 Subject: [PATCH 117/139] Fix normal gcc5 build for Q35 --- Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc | 2 +- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc b/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc index 7f1586706..b90aeabd1 100644 --- a/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc +++ b/Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc @@ -1533,5 +1533,5 @@ QemuQ35Pkg/Library/ResetSystemLib/StandaloneMmResetSystemLib.inf # protection of DXE_SMM_DRIVER/SMM_CORE modules [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER, BuildOptions.common.EDKII.SMM_CORE, BuildOptions.common.EDKII.DXE_DRIVER, BuildOptions.common.EDKII.DXE_CORE, BuildOptions.common.EDKII.UEFI_DRIVER, BuildOptions.common.EDKII.UEFI_APPLICATION, BuildOptions.common.EDKII.MM_CORE_STANDALONE, BuildOptions.common.EDKII.MM_STANDALONE] MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 - GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_GCC5_*_DLINK_FLAGS = -z common-page-size=0x1000 GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:4096 diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index ba9a99075..e102718ea 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -1395,15 +1395,15 @@ GCC:*_*_*_CC_FLAGS = -DDISABLE_NEW_DEPRECATED_INTERFACES [BuildOptions.common.EDKII.SEC,BuildOptions.common.EDKII.MM_CORE_STANDALONE] - GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_GCC5_*_DLINK_FLAGS = -z common-page-size=0x1000 GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 /FILEALIGN:0x1000 [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION,BuildOptions.common.EDKII.MM_CORE_STANDALONE,BuildOptions.common.EDKII.MM_STANDALONE] - GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_GCC5_*_DLINK_FLAGS = -z common-page-size=0x1000 GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] - GCC:*_GCC*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000 + GCC:*_GCC5_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000 GCC:*_CLANGPDB_AARCH64_DLINK_FLAGS = /ALIGN:0x10000 RVCT:*_*_ARM_DLINK_FLAGS = --scatter $(EDK_TOOLS_PATH)/Scripts/Rvct-Align4K.sct From f5179f6fb8a27602109b9bfec7accb29e6b9c3ce Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 15:50:35 -0700 Subject: [PATCH 118/139] fixing gcc --- Platforms/QemuSbsaPkg/PlatformBuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 85d1fc196..744c9dedc 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -120,7 +120,7 @@ def GetActiveScopes(self): "TOOL_CHAIN_TAG", "" ) if actual_tool_chain_tag.upper().startswith("GCC"): - scopes += ("gcc_aarch64_linux") + scopes += ("gcc_aarch64_linux",) return scopes def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: @@ -232,7 +232,7 @@ def GetActiveScopes(self): "TOOL_CHAIN_TAG", "" ) if actual_tool_chain_tag.upper().startswith("GCC"): - scopes += ("gcc_aarch64_linux") + scopes += ("gcc_aarch64_linux",) return scopes def GetName(self): From db691b3893be70db24c7238caede69068bf3d66b Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 15:53:48 -0700 Subject: [PATCH 119/139] fixing some more of the scripts --- Platforms/QemuSbsaPkg/PlatformBuild.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 744c9dedc..da6b44a38 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -402,11 +402,8 @@ def PlatformPostBuild(self): shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) - choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") - print(f"choco_path = {choco_path}") - # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds - cmd = os.path.join(choco_path, "bin", "make") + cmd = "make" args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) if ret != 0: @@ -417,7 +414,7 @@ def PlatformPostBuild(self): RunCmd("set", "") # Then we can make the firmware images with the fiptool built above - cmd = os.path.join(choco_path, "bin", "make") + cmd = "make" args = "CC="+clang_exe args += " PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() From 2b47aa7bc776870a82eac5e2bbc7b7131081473e Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 16:35:44 -0700 Subject: [PATCH 120/139] pick up correct mu_plus --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index a0da7ebae..6f8e6827c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,7 +8,7 @@ branch = release/202302 [submodule "Common/MU"] path = Common/MU - url = https://github.com/kuqin12/mu_plus.git + url = https://github.com/microsoft/mu_plus.git branch = release/202302 [submodule "Common/MU_OEM_SAMPLE"] path = Common/MU_OEM_SAMPLE From dcbc7ba258b65a5261219030527a90c9da80d92c Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 16:50:32 -0700 Subject: [PATCH 121/139] remove 2 step --- Platforms/QemuSbsaPkg/PlatformBuild.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index da6b44a38..553b6fc1a 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -402,16 +402,9 @@ def PlatformPostBuild(self): shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) - # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds - cmd = "make" - args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" - ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) - if ret != 0: - return ret - - logging.info(f"ClangBin = {ClangBin}") + choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") + shell_environment.GetEnvironment().insert_path(os.path.join(choco_path, "bin")) shell_environment.GetEnvironment().insert_path(ClangBin) - RunCmd("set", "") # Then we can make the firmware images with the fiptool built above cmd = "make" From f82e9c5c08f2f256cb38a12fbe6f52d3b182cc22 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 16:58:41 -0700 Subject: [PATCH 122/139] updated supv to fix an error --- Features/MM_SUPV | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Features/MM_SUPV b/Features/MM_SUPV index e67ea5450..700e003ae 160000 --- a/Features/MM_SUPV +++ b/Features/MM_SUPV @@ -1 +1 @@ -Subproject commit e67ea54502452430e425062546dffaf5cbf878e4 +Subproject commit 700e003ae5eac8737448b1063392a8e7505aceba From 84c194b76d5f067e9388990a99543f01199c2c22 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 17:54:55 -0700 Subject: [PATCH 123/139] removed clang bin --- Platforms/QemuSbsaPkg/PlatformBuild.py | 50 ++++++++------------------ 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 553b6fc1a..71c30eedb 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -332,7 +332,7 @@ def PlatformPostBuild(self): path = os.environ["PATH"] shell_environment.GetEnvironment().set_path('') - interesting_keys = ["LIB", "LIBPATH", "VCToolsInstallDir", "Path"] + interesting_keys = ["Path"] if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": HostInfo = GetHostInfo() @@ -371,44 +371,24 @@ def PlatformPostBuild(self): for (k, v) in vs_vars.items(): shell_env.set_shell_var(k, v) - HostInfo = GetHostInfo() - clang_exe = "clang.exe" if HostInfo.os == "Windows" else "clang" - ClangBin = shell_environment.GetEnvironment().get_shell_var("CLANG_BIN") - ClangBin_Default = "UNDEFINED" - - if HostInfo.os == "Windows": - ClangBin_Default = shell_environment.GetEnvironment().get_shell_var("AGENT_TEMPDIRECTORY") - if ClangBin_Default is None: - ClangBin_Default = "C:\\Program Files\\LLVM\\bin\\\\" #need to escape the last slash as it seems to be removed + if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": + if os.name == 'nt': + clang_exe = "clang.exe" + choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") + shell_environment.GetEnvironment().insert_path(os.path.join(choco_path, "bin")) + shell_environment.GetEnvironment().insert_path(shell_environment.GetEnvironment().get_shell_var("CLANG_BIN")) else: - ClangBin_Default += "\\LLVM\\bin\\" - logging.critical("ClangBin_Default = %s" % ClangBin_Default) - elif HostInfo.os == "Linux": - ClangBin_Default = "/LLVM/bin/" #this isn't right - else: - pass - if ClangBin is not None: - logging.info("CLANG_BIN is already set.") - else: - # see if clang is on path. - for path_entry in os.getenv("PATH").split(os.pathsep): - path_entry = os.path.normpath(path_entry) - if os.path.isfile(os.path.join(path_entry, clang_exe)): - ClangBin = os.path.abspath(path_entry) - break - if ClangBin is None: - # Didn't find it on path - try the install default. - ClangBin = ClangBin_Default - - shell_environment.GetEnvironment().set_shell_var("CLANG_BIN", ClangBin) - - choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") - shell_environment.GetEnvironment().insert_path(os.path.join(choco_path, "bin")) - shell_environment.GetEnvironment().insert_path(ClangBin) + clang_exe = "clang" # Then we can make the firmware images with the fiptool built above cmd = "make" - args = "CC="+clang_exe + if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": + args = "CC="+clang_exe + elif self.env.GetValue("TOOL_CHAIN_TAG") == "GCC5": + args = "CROSS_COMPILE=" + shell_environment.GetEnvironment().get_shell_var("GCC5_AARCH64_PREFIX") + else: + logging.error("Unsupported toolchain") + return -1 args += " PLAT=" + self.env.GetValue("QEMU_PLATFORM").lower() args += " ARCH=" + self.env.GetValue("TARGET_ARCH").lower() args += " DEBUG=" + str(1 if self.env.GetValue("TARGET").lower() == 'debug' else 0) From 1a76ea629ece87b15e03d3cc6de7fe94c8c97344 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 22:36:30 -0700 Subject: [PATCH 124/139] Upadted mu --- Common/MU | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/MU b/Common/MU index 0a1ce577e..2d6746b8f 160000 --- a/Common/MU +++ b/Common/MU @@ -1 +1 @@ -Subproject commit 0a1ce577e8c8f151f33d239ff52a80d4bc652e44 +Subproject commit 2d6746b8fe04a9be3998b3e1a682a4cbffcd7345 From fa215a42a38a08bb9a041db92a9ea0af25b50828 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 23:15:29 -0700 Subject: [PATCH 125/139] alright, add lib.. --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 71c30eedb..0276e4ab7 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -332,7 +332,7 @@ def PlatformPostBuild(self): path = os.environ["PATH"] shell_environment.GetEnvironment().set_path('') - interesting_keys = ["Path"] + interesting_keys = ["LIB", "Path"] if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": HostInfo = GetHostInfo() From b2e35b46e60c5d11fbc1476db8e4e0c3f6753c13 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 5 Jun 2024 23:43:23 -0700 Subject: [PATCH 126/139] updated fiptool... --- Platforms/QemuSbsaPkg/PlatformBuild.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 0276e4ab7..df4c33672 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -380,6 +380,13 @@ def PlatformPostBuild(self): else: clang_exe = "clang" + # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds + cmd = "make" + args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) + if ret != 0: + return ret + # Then we can make the firmware images with the fiptool built above cmd = "make" if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": From 2df9c014182e71aca2e0115c7e686db8f2de2ea2 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 11:55:38 -0700 Subject: [PATCH 127/139] how is this --- MU_BASECORE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MU_BASECORE b/MU_BASECORE index 8a25901f9..4298c31df 160000 --- a/MU_BASECORE +++ b/MU_BASECORE @@ -1 +1 @@ -Subproject commit 8a25901f9e788aeddbfccf45daab3f67c54148f7 +Subproject commit 4298c31df7a47fc9731885292daefe8c170dd0c7 From 7d478f76a5277331507cea351f507eda36c9d052 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 13:48:31 -0700 Subject: [PATCH 128/139] supv update --- Features/MM_SUPV | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Features/MM_SUPV b/Features/MM_SUPV index 700e003ae..83b2f31e3 160000 --- a/Features/MM_SUPV +++ b/Features/MM_SUPV @@ -1 +1 @@ -Subproject commit 700e003ae5eac8737448b1063392a8e7505aceba +Subproject commit 83b2f31e356ece531398737ef5d51c4134d97dcf From f43f0129a05acf0833f04aebc5dcb7cde663a6cf Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 13:58:16 -0700 Subject: [PATCH 129/139] revert it back? --- Platforms/QemuSbsaPkg/PlatformBuild.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index df4c33672..dd4633899 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -380,12 +380,12 @@ def PlatformPostBuild(self): else: clang_exe = "clang" - # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds - cmd = "make" - args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" - ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) - if ret != 0: - return ret + # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds + cmd = "make" + args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) + if ret != 0: + return ret # Then we can make the firmware images with the fiptool built above cmd = "make" @@ -393,6 +393,7 @@ def PlatformPostBuild(self): args = "CC="+clang_exe elif self.env.GetValue("TOOL_CHAIN_TAG") == "GCC5": args = "CROSS_COMPILE=" + shell_environment.GetEnvironment().get_shell_var("GCC5_AARCH64_PREFIX") + args += " -j $(nproc)" else: logging.error("Unsupported toolchain") return -1 @@ -404,7 +405,6 @@ def PlatformPostBuild(self): # args += " FEATURE_DETECTION=1" # Enforces support for features enabled. args += " BL32=" + os.path.join(op_fv, "BL32_AP_MM.fd") args += " all fip" - # args += " -j $(nproc)" ret = RunCmd(cmd, args, workingdir= self.env.GetValue("ARM_TFA_PATH")) if ret != 0: return ret From 5960d07048f2fbe8fd9c70402a8d44fc4bfa268e Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 13:59:04 -0700 Subject: [PATCH 130/139] move the comment --- Platforms/QemuSbsaPkg/PlatformBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index dd4633899..93c9d007f 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -386,8 +386,8 @@ def PlatformPostBuild(self): ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) if ret != 0: return ret + # Then we can make the firmware images with the fiptool built above - # Then we can make the firmware images with the fiptool built above cmd = "make" if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": args = "CC="+clang_exe From 59f1335978a1f365676ba4fca13551e4954baaa6 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 14:24:22 -0700 Subject: [PATCH 131/139] clean up the py --- Platforms/QemuSbsaPkg/PlatformBuild.py | 146 ++++++++++--------------- 1 file changed, 59 insertions(+), 87 deletions(-) diff --git a/Platforms/QemuSbsaPkg/PlatformBuild.py b/Platforms/QemuSbsaPkg/PlatformBuild.py index 93c9d007f..18c9ce469 100644 --- a/Platforms/QemuSbsaPkg/PlatformBuild.py +++ b/Platforms/QemuSbsaPkg/PlatformBuild.py @@ -165,45 +165,49 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManager): def __init__(self): UefiBuilder.__init__(self) - def CleanTree(self, RemoveConfTemplateFilesToo=False): - interesting_keys = ["VCToolsInstallDir", "Path", "LIB"] - if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": - HostInfo = GetHostInfo() - - # check to see if host is configured - # HostType for VS tools should be (defined in tools_def): - # x86 == 32bit Intel - # x64 == 64bit Intel - # arm == 32bit Arm - # arm64 == 64bit Arm - # - HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") - if HostType is not None: - HostType = HostType.lower() - logging.info( - f"CLANG_VS_HOST defined by environment. Value is {HostType}") + # Helper function to query the VC variables of interest and inject them into the environment + def InjectVcVarsOfInterests(self, vcvars: list): + HostInfo = GetHostInfo() + + # check to see if host is configured + # HostType for VS tools should be (defined in tools_def): + # x86 == 32bit Intel + # x64 == 64bit Intel + # arm == 32bit Arm + # arm64 == 64bit Arm + # + HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") + if HostType is not None: + HostType = HostType.lower() + logging.info( + f"CLANG_VS_HOST defined by environment. Value is {HostType}") + else: + #figure it out based on host info + if HostInfo.arch == "x86": + if HostInfo.bit == "32": + HostType = "x86" + elif HostInfo.bit == "64": + HostType = "x64" else: - #figure it out based on host info - if HostInfo.arch == "x86": - if HostInfo.bit == "32": - HostType = "x86" - elif HostInfo.bit == "64": - HostType = "x64" - else: - # anything other than x86 or x64 is not supported - raise NotImplementedError() - - # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. - VC_HOST_ARCH_TRANSLATOR = { - "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} - - # now get the environment variables for the platform - shell_env = shell_environment.GetEnvironment() - # Use the tools lib to determine the correct values for the vars that interest us. - vs_vars = QueryVcVariables( - interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) - for (k, v) in vs_vars.items(): - shell_env.set_shell_var(k, v) + # anything other than x86 or x64 is not supported + raise NotImplementedError() + + # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. + VC_HOST_ARCH_TRANSLATOR = { + "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} + + # now get the environment variables for the platform + shell_env = shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for the vars that interest us. + vs_vars = QueryVcVariables( + vcvars, VC_HOST_ARCH_TRANSLATOR[HostType]) + for (k, v) in vs_vars.items(): + shell_env.set_shell_var(k, v) + + def CleanTree(self, RemoveConfTemplateFilesToo=False): + # If this is a Windows Clang build, we need to inject the VC variables of interest + if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB" and os.name == 'nt': + self.InjectVcVarsOfInterests(["VCToolsInstallDir", "Path", "LIB"]) # Add a step to clean up BL31 as well, if asked cmd = "make" @@ -330,64 +334,29 @@ def PlatformPostBuild(self): logging.info("Building TF-A") - path = os.environ["PATH"] - shell_environment.GetEnvironment().set_path('') - interesting_keys = ["LIB", "Path"] - if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": - HostInfo = GetHostInfo() - - # check to see if host is configured - # HostType for VS tools should be (defined in tools_def): - # x86 == 32bit Intel - # x64 == 64bit Intel - # arm == 32bit Arm - # arm64 == 64bit Arm - # - HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST") - if HostType is not None: - HostType = HostType.lower() - logging.info( - f"CLANG_VS_HOST defined by environment. Value is {HostType}") - else: - #figure it out based on host info - if HostInfo.arch == "x86": - if HostInfo.bit == "32": - HostType = "x86" - elif HostInfo.bit == "64": - HostType = "x64" - else: - # anything other than x86 or x64 is not supported - raise NotImplementedError() - - # CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates. - VC_HOST_ARCH_TRANSLATOR = { - "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"} - - # now get the environment variables for the platform - shell_env = shell_environment.GetEnvironment() - # Use the tools lib to determine the correct values for the vars that interest us. - vs_vars = QueryVcVariables( - interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType]) - for (k, v) in vs_vars.items(): - shell_env.set_shell_var(k, v) - + shell_environment.CheckpointBuildVars() # checkpoint our config before we mess with it if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": if os.name == 'nt': + # If this is a Windows build, we need to demolish the path and inject the VC variables of interest + # otherwise the build could pick up wrong tools + shell_environment.GetEnvironment().set_path('') + self.InjectVcVarsOfInterests(["LIB", "Path"]) + clang_exe = "clang.exe" choco_path = shell_environment.GetEnvironment().get_shell_var("CHOCOLATEYINSTALL") shell_environment.GetEnvironment().insert_path(os.path.join(choco_path, "bin")) shell_environment.GetEnvironment().insert_path(shell_environment.GetEnvironment().get_shell_var("CLANG_BIN")) + + # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds + cmd = "make" + args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" + ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) + if ret != 0: + return ret + # Then we can make the firmware images with the fiptool built above else: clang_exe = "clang" - # Need to build fiptool separately because the build system will override LIB with LIBC for firmware builds - cmd = "make" - args = " fiptool MAKEFLAGS= LIB=\"" + shell_environment.GetEnvironment().get_shell_var("LIB") + "\"" - ret = RunCmd(cmd, args, workingdir=self.env.GetValue("ARM_TFA_PATH")) - if ret != 0: - return ret - # Then we can make the firmware images with the fiptool built above - cmd = "make" if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB": args = "CC="+clang_exe @@ -409,6 +378,9 @@ def PlatformPostBuild(self): if ret != 0: return ret + # Revert the build vars to the original state + shell_environment.RevertBuildVars() + # Now that BL31 is built with BL32 supplied, patch BL1 and BL31 built fip.bin into the SECURE_FLASH0.fd op_tfa = os.path.join ( self.env.GetValue("ARM_TFA_PATH"), "build", From 22f23da0d383367ab4bdfda2cb2b60e30a65bbcd Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 14:30:24 -0700 Subject: [PATCH 132/139] remove some junk --- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index e102718ea..1c9cb0d8b 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -1395,8 +1395,7 @@ GCC:*_*_*_CC_FLAGS = -DDISABLE_NEW_DEPRECATED_INTERFACES [BuildOptions.common.EDKII.SEC,BuildOptions.common.EDKII.MM_CORE_STANDALONE] - GCC:*_GCC5_*_DLINK_FLAGS = -z common-page-size=0x1000 - GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 /FILEALIGN:0x1000 + GCC:*_CLANGPDB_*_DLINK_FLAGS = /FILEALIGN:0x1000 [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION,BuildOptions.common.EDKII.MM_CORE_STANDALONE,BuildOptions.common.EDKII.MM_STANDALONE] GCC:*_GCC5_*_DLINK_FLAGS = -z common-page-size=0x1000 From d5d274a653b56a3ccb6b1c65d80c131ab1b235bb Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 14:39:15 -0700 Subject: [PATCH 133/139] hmm --- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index 1c9cb0d8b..3343fc4bb 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -1395,7 +1395,7 @@ GCC:*_*_*_CC_FLAGS = -DDISABLE_NEW_DEPRECATED_INTERFACES [BuildOptions.common.EDKII.SEC,BuildOptions.common.EDKII.MM_CORE_STANDALONE] - GCC:*_CLANGPDB_*_DLINK_FLAGS = /FILEALIGN:0x1000 + GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 /FILEALIGN:0x1000 [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION,BuildOptions.common.EDKII.MM_CORE_STANDALONE,BuildOptions.common.EDKII.MM_STANDALONE] GCC:*_GCC5_*_DLINK_FLAGS = -z common-page-size=0x1000 From 752a80cd39edea1cb2cd53b7e83326278348d21c Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 14:48:54 -0700 Subject: [PATCH 134/139] remove it so that i can add it back --- .gitmodules | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 6f8e6827c..000000000 --- a/.gitmodules +++ /dev/null @@ -1,36 +0,0 @@ -[submodule "MU_BASECORE"] - path = MU_BASECORE - url = https://github.com/microsoft/mu_basecore.git - branch = release/202302 -[submodule "Common/MU_TIANO"] - path = Common/MU_TIANO - url = https://github.com/microsoft/mu_tiano_plus.git - branch = release/202302 -[submodule "Common/MU"] - path = Common/MU - url = https://github.com/microsoft/mu_plus.git - branch = release/202302 -[submodule "Common/MU_OEM_SAMPLE"] - path = Common/MU_OEM_SAMPLE - url = https://github.com/microsoft/mu_oem_sample.git - branch = release/202302 -[submodule "Silicon/Arm/MU_TIANO"] - path = Silicon/Arm/MU_TIANO - url = https://github.com/microsoft/mu_silicon_arm_tiano.git - branch = release/202302 -[submodule "Silicon/Arm/TFA"] - path = Silicon/Arm/TFA - url = https://github.com/ARM-software/arm-trusted-firmware.git - branch = v2.9.0 -[submodule "Features/DFCI"] - path = Features/DFCI - url = https://github.com/microsoft/mu_feature_dfci -[submodule "Features/CONFIG"] - path = Features/CONFIG - url = https://github.com/microsoft/mu_feature_config.git -[submodule "Features/MM_SUPV"] - path = Features/MM_SUPV - url = https://github.com/microsoft/mu_feature_mm_supv.git -[submodule "Features/DEBUGGER"] - path = Features/DEBUGGER - url = https://github.com/microsoft/mu_feature_debugger.git From af4b1532579f89e4beba0d1913e482144e0ee4d9 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 14:49:26 -0700 Subject: [PATCH 135/139] add it back --- .gitmodules | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..6f8e6827c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,36 @@ +[submodule "MU_BASECORE"] + path = MU_BASECORE + url = https://github.com/microsoft/mu_basecore.git + branch = release/202302 +[submodule "Common/MU_TIANO"] + path = Common/MU_TIANO + url = https://github.com/microsoft/mu_tiano_plus.git + branch = release/202302 +[submodule "Common/MU"] + path = Common/MU + url = https://github.com/microsoft/mu_plus.git + branch = release/202302 +[submodule "Common/MU_OEM_SAMPLE"] + path = Common/MU_OEM_SAMPLE + url = https://github.com/microsoft/mu_oem_sample.git + branch = release/202302 +[submodule "Silicon/Arm/MU_TIANO"] + path = Silicon/Arm/MU_TIANO + url = https://github.com/microsoft/mu_silicon_arm_tiano.git + branch = release/202302 +[submodule "Silicon/Arm/TFA"] + path = Silicon/Arm/TFA + url = https://github.com/ARM-software/arm-trusted-firmware.git + branch = v2.9.0 +[submodule "Features/DFCI"] + path = Features/DFCI + url = https://github.com/microsoft/mu_feature_dfci +[submodule "Features/CONFIG"] + path = Features/CONFIG + url = https://github.com/microsoft/mu_feature_config.git +[submodule "Features/MM_SUPV"] + path = Features/MM_SUPV + url = https://github.com/microsoft/mu_feature_mm_supv.git +[submodule "Features/DEBUGGER"] + path = Features/DEBUGGER + url = https://github.com/microsoft/mu_feature_debugger.git From 983d0599cdd1e617d48832aa69f0b1a504c4c0fd Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 15:03:03 -0700 Subject: [PATCH 136/139] remove the rogue lib --- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 3 --- 1 file changed, 3 deletions(-) diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index 3343fc4bb..038eb9d92 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -464,9 +464,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf -!if $(TARGET) != RELEASE - DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf -!endif VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf ResetSystemLib|MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.inf From 3ece963f74e8b04269650d137d451ecc8f6d9efd Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 15:12:22 -0700 Subject: [PATCH 137/139] more odd stuff --- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index 038eb9d92..fa89645c5 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -623,9 +623,15 @@ # gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x40 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x0 +!if $(TOOL_CHAIN_TAG) == GCC5 # This is really odd on why CLANGPDB has runtime memory consumption differences + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x505 + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x258 + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x260 +!else gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x30 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x40 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x300 +!endif gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode|0x5DC gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|0x2EE0 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|0x14 From a95699fbf2f875f95cb61d25f94c62c3ee2f11d4 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 6 Jun 2024 17:51:50 -0700 Subject: [PATCH 138/139] get the build to mainline --- .azurepipelines/Platform-Build-VS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azurepipelines/Platform-Build-VS.yml b/.azurepipelines/Platform-Build-VS.yml index 16b1f22e8..a914f2a36 100644 --- a/.azurepipelines/Platform-Build-VS.yml +++ b/.azurepipelines/Platform-Build-VS.yml @@ -10,8 +10,8 @@ resources: - repository: mu_devops type: github endpoint: microsoft - name: kuqin12/mu_devops - ref: add_clangpdb + name: microsoft/mu_devops + ref: main variables: - group: tool-chain-windows-visual-studio-latest From 2eaf05f71ff2cc78b619f70d9787bc395a808c91 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 7 Jun 2024 11:54:44 -0700 Subject: [PATCH 139/139] fixing the dsc --- Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc index fa89645c5..d53b9cba5 100644 --- a/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc +++ b/Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc @@ -627,8 +627,12 @@ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x505 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x258 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x260 +!else +!if $(TARGET) == RELEASE + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x505 !else gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x30 +!endif gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x40 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x300 !endif @@ -1391,6 +1395,10 @@ GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG + # Exception tables are required for stack walks in the debugger. + MSFT:*_*_AARCH64_GENFW_FLAGS = --keepexceptiontable + GCC:*_*_AARCH64_GENFW_FLAGS = --keepexceptiontable + # # Disable deprecated APIs. #