From 985923c2d2cbd04d2e203bab607f7709f47d7cd6 Mon Sep 17 00:00:00 2001 From: Mikhail Krichanov Date: Mon, 28 Oct 2024 16:04:56 +0300 Subject: [PATCH] Ring3: Added build targets with '-D USER_SPACE' for ARM, AARCH64. --- .github/workflows/build_arm.yaml | 66 ++++++++++++++++++++++++++++++ .github/workflows/build_nolto.yaml | 36 ++++++++++++++++ ArmVirtPkg/ArmVirt.dsc.inc | 4 +- 3 files changed, 105 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_arm.yaml b/.github/workflows/build_arm.yaml index 02e37fe57e..9f55ee9cdf 100644 --- a/.github/workflows/build_arm.yaml +++ b/.github/workflows/build_arm.yaml @@ -98,6 +98,38 @@ jobs: cp ./Build/ArmVirtQemu-"$arch"/"$target"_"$TOOLCHAIN"/FV/QEMU_EFI.fd ./firmware_artifacts/ArmVirtQemu/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd done done + rm -r ./Build/* + env: + ARCHS: ARM,AARCH64 + TARGETS: RELEASE,DEBUG,NOOPT + TOOLCHAIN: GCC + + - name: Build ArmVirtQemu + if: always() + run: ./efibuild.sh + env: + SELFPKG: ArmVirtQemu + SELFPKG_DIR: ArmVirtPkg + TOOLCHAINS: GCC + ARCHS: ARM,AARCH64 + TARGETS: RELEASE,DEBUG,NOOPT + SKIP_TESTS: 1 + SKIP_PACKAGE: 1 + GCC_ARM_PREFIX: arm-linux-gnueabi- + GCC_AARCH64_PREFIX: aarch64-linux-gnu- + BUILD_ARGUMENTS: -D USER_SPACE + + - name: Prepare artifacts with firmwares for Linux + if: always() + run: | + IFS=', ' read -r -a TARGETS <<< "$TARGETS" + IFS=', ' read -r -a ARCHS <<< "$ARCHS" + for target in "${TARGETS[@]}"; do + for arch in "${ARCHS[@]}"; do + mkdir -p ./firmware_artifacts/ArmVirtQemu/Linux/"$arch"/"$target"_"$TOOLCHAIN" + cp ./Build/ArmVirtQemu-"$arch"/"$target"_"$TOOLCHAIN"/FV/QEMU_EFI.fd ./firmware_artifacts/ArmVirtQemu/Linux/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd + done + done env: ARCHS: ARM,AARCH64 TARGETS: RELEASE,DEBUG,NOOPT @@ -194,6 +226,36 @@ jobs: cp ./Build/ArmVirtQemu-"$arch"/"$target"_"$TOOLCHAIN"/FV/QEMU_EFI.fd ./firmware_artifacts/ArmVirtQemu/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd done done + rm -r ./Build/* + env: + ARCHS: ARM,AARCH64 + TARGETS: RELEASE,DEBUG,NOOPT + TOOLCHAIN: CLANGDWARF + + - name: Build ArmVirtQemu for Linux + if: always() + run: ./efibuild.sh + env: + SELFPKG: ArmVirtQemu + SELFPKG_DIR: ArmVirtPkg + TOOLCHAINS: CLANGDWARF + ARCHS: ARM,AARCH64 + TARGETS: RELEASE,DEBUG,NOOPT + SKIP_TESTS: 1 + SKIP_PACKAGE: 1 + BUILD_ARGUMENTS: -D USER_SPACE + + - name: Prepare artifacts with firmwares for Linux + if: always() + run: | + IFS=', ' read -r -a TARGETS <<< "$TARGETS" + IFS=', ' read -r -a ARCHS <<< "$ARCHS" + for target in "${TARGETS[@]}"; do + for arch in "${ARCHS[@]}"; do + mkdir -p ./firmware_artifacts/ArmVirtQemu/Linux/"$arch"/"$target"_"$TOOLCHAIN" + cp ./Build/ArmVirtQemu-"$arch"/"$target"_"$TOOLCHAIN"/FV/QEMU_EFI.fd ./firmware_artifacts/ArmVirtQemu/Linux/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd + done + done env: ARCHS: ARM,AARCH64 TARGETS: RELEASE,DEBUG,NOOPT @@ -272,6 +334,8 @@ jobs: for arch in "${ARCHS[@]}"; do echo Checking "$PACKAGE""$arch" "$target"_"$TOOLCHAIN" python3 test_qemu_fw.py ./firmware_artifacts/"$PACKAGE"/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd --fw-arch "$arch" + echo Checking "$PACKAGE""$arch" "$target"_"$TOOLCHAIN" for Linux + python3 test_qemu_fw.py ./firmware_artifacts/"$PACKAGE"/Linux/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd --fw-arch "$arch" done done env: @@ -289,6 +353,8 @@ jobs: for arch in "${ARCHS[@]}"; do echo Checking "$PACKAGE""$arch" "$target"_"$TOOLCHAIN" python3 test_qemu_fw.py ./firmware_artifacts/"$PACKAGE"/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd --test-linux --fw-arch "$arch" + echo Checking "$PACKAGE""$arch" "$target"_"$TOOLCHAIN" for Linux + python3 test_qemu_fw.py ./firmware_artifacts/"$PACKAGE"/Linux/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd --test-linux --fw-arch "$arch" done done env: diff --git a/.github/workflows/build_nolto.yaml b/.github/workflows/build_nolto.yaml index ad48934a31..8bab2ea242 100644 --- a/.github/workflows/build_nolto.yaml +++ b/.github/workflows/build_nolto.yaml @@ -101,6 +101,38 @@ jobs: cp ./Build/ArmVirtQemu-"$arch"/"$target"_"$TOOLCHAIN"/FV/QEMU_EFI.fd ./firmware_artifacts/ArmVirtQemu/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd done done + rm -r ./Build/* + env: + ARCHS: ARM,AARCH64 + TARGETS: RELEASE,DEBUG + TOOLCHAIN: GCC + + - name: Build ArmVirtQemu + if: always() + run: ./efibuild.sh + env: + SELFPKG: ArmVirtQemu + SELFPKG_DIR: ArmVirtPkg + TOOLCHAINS: GCC + ARCHS: ARM,AARCH64 + TARGETS: RELEASE,DEBUG + SKIP_TESTS: 1 + SKIP_PACKAGE: 1 + GCC_ARM_PREFIX: arm-linux-gnueabi- + GCC_AARCH64_PREFIX: aarch64-linux-gnu- + BUILD_ARGUMENTS: -D EDK2_GCC_NOLTO -D USER_SPACE + + - name: Prepare artifacts with firmwares for Linux + if: always() + run: | + IFS=', ' read -r -a TARGETS <<< "$TARGETS" + IFS=', ' read -r -a ARCHS <<< "$ARCHS" + for target in "${TARGETS[@]}"; do + for arch in "${ARCHS[@]}"; do + mkdir -p ./firmware_artifacts/ArmVirtQemu/Linux/"$arch"/"$target"_"$TOOLCHAIN" + cp ./Build/ArmVirtQemu-"$arch"/"$target"_"$TOOLCHAIN"/FV/QEMU_EFI.fd ./firmware_artifacts/ArmVirtQemu/Linux/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd + done + done env: ARCHS: ARM,AARCH64 TARGETS: RELEASE,DEBUG @@ -420,6 +452,8 @@ jobs: for arch in "${ARCHS[@]}"; do echo Checking "$PACKAGE""$arch" "$target"_"$TOOLCHAIN" python3 test_qemu_fw.py ./firmware_artifacts/"$PACKAGE"/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd --fw-arch "$arch" + echo Checking "$PACKAGE""$arch" "$target"_"$TOOLCHAIN" for Linux + python3 test_qemu_fw.py ./firmware_artifacts/"$PACKAGE"/Linux/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd --fw-arch "$arch" done done env: @@ -437,6 +471,8 @@ jobs: for arch in "${ARCHS[@]}"; do echo Checking "$PACKAGE""$arch" "$target"_"$TOOLCHAIN" python3 test_qemu_fw.py ./firmware_artifacts/"$PACKAGE"/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd --test-linux --fw-arch "$arch" + echo Checking "$PACKAGE""$arch" "$target"_"$TOOLCHAIN" for Linux + python3 test_qemu_fw.py ./firmware_artifacts/"$PACKAGE"/Linux/"$arch"/"$target"_"$TOOLCHAIN"/FW.fd --test-linux --fw-arch "$arch" done done env: diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 906fd05275..6837232202 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -373,7 +373,9 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xC000000000007FD5 gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|TRUE - gEfiMdeModulePkgTokenSpaceGuid.PcdEnableUserSpace|FALSE +!ifdef $(USER_SPACE) + gEfiMdeModulePkgTokenSpaceGuid.PcdEnableUserSpace|TRUE +!endif gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE [Components.common]