Skip to content

Commit

Permalink
Ring3: Added build targets with '-D USER_SPACE' for ARM, AARCH64.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Krichanov committed Oct 29, 2024
1 parent 5db269a commit 3dc0253
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 1 deletion.
66 changes: 66 additions & 0 deletions .github/workflows/build_arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 for Linux
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/build_nolto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 for Linux
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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion ArmVirtPkg/ArmVirt.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 3dc0253

Please sign in to comment.