]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/PlatformCI: Add CI coverage for ArmVirtQemuKernel
authorArd Biesheuvel <ardb@kernel.org>
Tue, 24 Jan 2023 15:45:02 +0000 (15:45 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 26 Jan 2023 18:54:58 +0000 (18:54 +0000)
ArmVirtQemuKernel.dsc describes a firmware build that is loadable at
arbitrary address and can be invoked using the Linux/arm64 kernel boot
protocol. The early code deviates significantly from ArmVirtQemu, and so
it makes sense to cover this platform in CI even if it is not widely
used. This ensures that the relocatable PrePi and other components in
EmbeddedPkg don't regress on ARM as they are being updated for use on
TDVF.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
ArmVirtPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
ArmVirtPkg/PlatformCI/PlatformBuildLib.py
ArmVirtPkg/PlatformCI/QemuBuild.py
ArmVirtPkg/PlatformCI/QemuKernelBuild.py [new file with mode: 0644]

index 44a1d3da674254718900c6c57f21b2307d44862a..2b6cc119167b5c2ebe9c879d6e86cde05d8b6e62 100644 (file)
@@ -72,6 +72,49 @@ jobs:
             Run.Flags: $(run_flags)\r
             Run: $(should_run)\r
 \r
+          QEMU_KERNEL_AARCH64_DEBUG:\r
+            Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"\r
+            Build.Arch: "AARCH64"\r
+            Build.Flags: ""\r
+            Build.Target: "DEBUG"\r
+            Run.Flags: $(run_flags)\r
+            Run: $(should_run)\r
+          QEMU_KERNEL_AARCH64_RELEASE:\r
+            Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"\r
+            Build.Arch: "AARCH64"\r
+            Build.Flags: ""\r
+            Build.Target: "RELEASE"\r
+            Run.Flags: $(run_flags)\r
+            Run: $(should_run)\r
+          QEMU_KERNEL_AARCH64_NOOPT:\r
+            Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"\r
+            Build.Arch: "AARCH64"\r
+            Build.Flags: ""\r
+            Build.Target: "NOOPT"\r
+            Run.Flags: $(run_flags)\r
+            Run: $(should_run)\r
+          QEMU_KERNEL_ARM_DEBUG:\r
+            Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"\r
+            Build.Arch: "ARM"\r
+            Build.Flags: ""\r
+            Build.Target: "DEBUG"\r
+            Run.Flags: $(run_flags)\r
+            Run: $(should_run)\r
+          QEMU_KERNEL_ARM_RELEASE:\r
+            Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"\r
+            Build.Arch: "ARM"\r
+            Build.Flags: ""\r
+            Build.Target: "RELEASE"\r
+            Run.Flags: $(run_flags)\r
+            Run: $(should_run)\r
+          QEMU_KERNEL_ARM_NOOPT:\r
+            Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"\r
+            Build.Arch: "ARM"\r
+            Build.Flags: ""\r
+            Build.Target: "NOOPT"\r
+            Run.Flags: $(run_flags)\r
+            Run: $(should_run)\r
+\r
     workspace:\r
       clean: all\r
 \r
index 91aa9b31d3c5eab1ca8ac01e07f34a4a47225948..405817cae785863a3b9204c7a1de1b5e8b8c1c75 100644 (file)
@@ -226,13 +226,13 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManager):
             args += " -cpu cortex-a57"                                          # emulate cpu\r
         elif(self.env.GetValue("TARGET_ARCH").upper() == "ARM"):\r
             cmd = "qemu-system-arm"\r
-            args = "-M virt"\r
+            args = "-M virt,highmem=off"\r
             args += " -cpu cortex-a15"                                          # emulate cpu\r
         else:\r
             raise NotImplementedError()\r
 \r
         # Common Args\r
-        args += " -pflash " + Built_FV                                     # path to fw\r
+        args += CommonPlatform.FvQemuArg + Built_FV                         # path to fw\r
         args += " -m 1024"                                                  # 1gb memory\r
         # turn off network\r
         args += " -net none"\r
index f4dcc1d1d2451110694c17605febc3434fd92648..c651a9501fcf92a0307a861548479b9ac1863e01 100644 (file)
@@ -27,5 +27,8 @@ class CommonPlatform():
 \r
     DscName = os.path.join("ArmVirtPkg", "ArmVirtQemu.dsc")\r
 \r
+    # this platform produces a bootable NOR flash image\r
+    FvQemuArg = " -pflash "\r
+\r
 import PlatformBuildLib\r
 PlatformBuildLib.CommonPlatform = CommonPlatform\r
diff --git a/ArmVirtPkg/PlatformCI/QemuKernelBuild.py b/ArmVirtPkg/PlatformCI/QemuKernelBuild.py
new file mode 100644 (file)
index 0000000..f340dfa
--- /dev/null
@@ -0,0 +1,35 @@
+# @file\r
+# Script to Build OVMF UEFI firmware\r
+#\r
+# Copyright (c) Microsoft Corporation.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
+##\r
+import os\r
+import sys\r
+\r
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))\r
+from PlatformBuildLib import SettingsManager\r
+from PlatformBuildLib import PlatformBuilder\r
+\r
+    # ####################################################################################### #\r
+    #                                Common Configuration                                     #\r
+    # ####################################################################################### #\r
+class CommonPlatform():\r
+    ''' Common settings for this platform.  Define static data here and use\r
+        for the different parts of stuart\r
+    '''\r
+    PackagesSupported = ("ArmVirtPkg",)\r
+    ArchSupported = ("AARCH64", "ARM")\r
+    TargetsSupported = ("DEBUG", "RELEASE", "NOOPT")\r
+    Scopes = ('armvirt', 'edk2-build')\r
+    WorkspaceRoot = os.path.realpath(os.path.join(\r
+        os.path.dirname(os.path.abspath(__file__)), "..", ".."))\r
+\r
+    DscName = os.path.join("ArmVirtPkg", "ArmVirtQemuKernel.dsc")\r
+\r
+    # this platform produces an executable image that is invoked using\r
+    # the Linux/arm64 kernel boot protocol\r
+    FvQemuArg = " -kernel "\r
+\r
+import PlatformBuildLib\r
+PlatformBuildLib.CommonPlatform = CommonPlatform\r