ArmVirtPkg/PlatformCI: Add CI coverage for ArmVirtQemuKernel

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>
This commit is contained in:
Ard Biesheuvel 2023-01-24 15:45:02 +00:00 committed by mergify[bot]
parent ed1806b2c0
commit 0eda253317
4 changed files with 83 additions and 2 deletions

View File

@ -72,6 +72,49 @@ jobs:
Run.Flags: $(run_flags) Run.Flags: $(run_flags)
Run: $(should_run) Run: $(should_run)
QEMU_KERNEL_AARCH64_DEBUG:
Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"
Build.Arch: "AARCH64"
Build.Flags: ""
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
QEMU_KERNEL_AARCH64_RELEASE:
Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"
Build.Arch: "AARCH64"
Build.Flags: ""
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
QEMU_KERNEL_AARCH64_NOOPT:
Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"
Build.Arch: "AARCH64"
Build.Flags: ""
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)
QEMU_KERNEL_ARM_DEBUG:
Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"
Build.Arch: "ARM"
Build.Flags: ""
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
QEMU_KERNEL_ARM_RELEASE:
Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"
Build.Arch: "ARM"
Build.Flags: ""
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
QEMU_KERNEL_ARM_NOOPT:
Build.File: "$(package)/PlatformCI/QemuKernelBuild.py"
Build.Arch: "ARM"
Build.Flags: ""
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)
workspace: workspace:
clean: all clean: all

View File

@ -226,13 +226,13 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManager):
args += " -cpu cortex-a57" # emulate cpu args += " -cpu cortex-a57" # emulate cpu
elif(self.env.GetValue("TARGET_ARCH").upper() == "ARM"): elif(self.env.GetValue("TARGET_ARCH").upper() == "ARM"):
cmd = "qemu-system-arm" cmd = "qemu-system-arm"
args = "-M virt" args = "-M virt,highmem=off"
args += " -cpu cortex-a15" # emulate cpu args += " -cpu cortex-a15" # emulate cpu
else: else:
raise NotImplementedError() raise NotImplementedError()
# Common Args # Common Args
args += " -pflash " + Built_FV # path to fw args += CommonPlatform.FvQemuArg + Built_FV # path to fw
args += " -m 1024" # 1gb memory args += " -m 1024" # 1gb memory
# turn off network # turn off network
args += " -net none" args += " -net none"

View File

@ -27,5 +27,8 @@ class CommonPlatform():
DscName = os.path.join("ArmVirtPkg", "ArmVirtQemu.dsc") DscName = os.path.join("ArmVirtPkg", "ArmVirtQemu.dsc")
# this platform produces a bootable NOR flash image
FvQemuArg = " -pflash "
import PlatformBuildLib import PlatformBuildLib
PlatformBuildLib.CommonPlatform = CommonPlatform PlatformBuildLib.CommonPlatform = CommonPlatform

View File

@ -0,0 +1,35 @@
# @file
# Script to Build OVMF UEFI firmware
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from PlatformBuildLib import SettingsManager
from PlatformBuildLib import PlatformBuilder
# ####################################################################################### #
# Common Configuration #
# ####################################################################################### #
class CommonPlatform():
''' Common settings for this platform. Define static data here and use
for the different parts of stuart
'''
PackagesSupported = ("ArmVirtPkg",)
ArchSupported = ("AARCH64", "ARM")
TargetsSupported = ("DEBUG", "RELEASE", "NOOPT")
Scopes = ('armvirt', 'edk2-build')
WorkspaceRoot = os.path.realpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), "..", ".."))
DscName = os.path.join("ArmVirtPkg", "ArmVirtQemuKernel.dsc")
# this platform produces an executable image that is invoked using
# the Linux/arm64 kernel boot protocol
FvQemuArg = " -kernel "
import PlatformBuildLib
PlatformBuildLib.CommonPlatform = CommonPlatform