Skip to content

Commit

Permalink
ci: Update QEMU on Windows to 8.1, OpenSBI to 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Aug 27, 2023
1 parent 74841a7 commit 53ca0b2
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 52 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,18 @@ jobs:
qemu-system-misc
# APT's qemu package doesn't provide firmware for riscv32 and mips:
# https://packages.ubuntu.com/en/jammy/all/qemu-system-data/filelist
OPENSBI_VERSION=1.2
OPENSBI_VERSION=1.3.1 # https://github.com/riscv-software-src/opensbi/releases
curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://github.com/riscv-software-src/opensbi/releases/download/v${OPENSBI_VERSION}/opensbi-${OPENSBI_VERSION}-rv-bin.tar.xz" \
| tar xJf -
sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.elf" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf
rm -rf "opensbi-${OPENSBI_VERSION}-rv-bin"
# TODO: use sparse-checkout
git clone --depth 1 https://github.com/qemu/qemu.git
git clone --depth 1 --filter=tree:0 --no-checkout https://github.com/qemu/qemu.git
cd qemu
git sparse-checkout init
echo '!/*' >> .git/info/sparse-checkout
echo '/pc-bios/' >> .git/info/sparse-checkout
git checkout
sudo mv pc-bios/{efi-pcnet.rom,vgabios-cirrus.bin} /usr/share/qemu/
cd ..
rm -rf qemu
Expand All @@ -145,15 +148,20 @@ jobs:
docker rm -f qemu-user >/dev/null
sudo mv qemu-user/bin/qemu-* /usr/bin/
rm -rf ./qemu-user
qemu-system-arm --version
qemu-arm --version
if: startsWith(matrix.os, 'ubuntu') || matrix.os == ''
- run: brew install --cask gcc-arm-embedded
- run: |
set -euxo pipefail
brew install --cask gcc-arm-embedded
qemu-system-arm --version
if: startsWith(matrix.os, 'macos')
- run: |
set -euxo pipefail
choco install --no-progress --requirechecksums gcc-arm-embedded
choco install --no-progress --requirechecksums qemu --version=2023.4.24 # 8.0
choco install --no-progress --requirechecksums qemu --version=2023.8.22 # 8.1 https://community.chocolatey.org/packages/Qemu#versionhistory
echo "C:\Program Files\qemu" >>"${GITHUB_PATH}"
"C:\Program Files\qemu\qemu-system-arm" --version
if: startsWith(matrix.os, 'windows')
- run: tools/no-std.sh
- run: TEST_RUNNER=qemu-user tools/no-std.sh
Expand Down
43 changes: 21 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,30 @@ The host must be running an emulator or a debugger attached to the target.

The following targets have been tested on CI. (qemu-system has been tested on Linux, macOS, and Windows hosts, and qemu-user on Linux host.)

| target | exit | all-apis \[1] (qemu-system) | all-apis \[1] (qemu-user) | panic-unwind (qemu-system \[2]) |
| ------------------------------------ | ---- | --------------------------- | ------------------------- | ------------------------------- |
| `aarch64-unknown-none{,-softfloat}` || |||
| `{arm,thumb}v4t-none-eabi` || || |
| `{arm,thumb}v5te-none-eabi` || || |
| `armv7a-none-eabi{,hf}` || || |
| `armv7r-none-eabi{,hf}` || || |
| `armebv7r-none-eabi{,hf}` || || |
| `thumbv6m-none-eabi` || | N/A | |
| `thumbv7m-none-eabi` || | N/A | |
| `thumbv7em-none-eabi{,hf}` || | N/A | |
| `thumbv8m.base-none-eabi` ||\[3] | N/A | |
| `thumbv8m.main-none-eabi{,hf}` ||\[3] | N/A | |
| `riscv32*-unknown-none-elf` || |||
| `riscv64*-unknown-none-elf` || |||
| `mips{,el}-unknown-none` \[5] ||\[6] | N/A | |
| `mips64{,el}-unknown-none` \[5] ||\[6] | N/A | |
| `mipsisa32r6{,el}-unknown-none` \[5] ||\[6] | N/A | |
| `mipsisa64r6{,el}-unknown-none` \[5] ||\[6] | N/A | |
| target | exit | all-apis \[1] (system) | all-apis \[1] (user-mode) | panic-unwind (system \[2]) | note |
| ----------------------------------- | ---- | ---------------------- | ------------------------- | -------------------------- | ---- |
| `aarch64-unknown-none{,-softfloat}` |||| | |
| `{arm,thumb}v4t-none-eabi` || || | |
| `{arm,thumb}v5te-none-eabi` |||| | |
| `armv7a-none-eabi{,hf}` |||| | |
| `armv7r-none-eabi{,hf}` |||| | |
| `armebv7r-none-eabi{,hf}` || || | |
| `thumbv6m-none-eabi` ||| N/A | | |
| `thumbv7m-none-eabi` ||| N/A | | |
| `thumbv7em-none-eabi{,hf}` ||| N/A | | |
| `thumbv8m.base-none-eabi` ||| N/A | | |
| `thumbv8m.main-none-eabi{,hf}` ||| N/A | | |
| `riscv32*-unknown-none-elf` |||| | |
| `riscv64*-unknown-none-elf` |||| | |
| `mips{,el}-unknown-none` ||| N/A | | \[3] \[4] |
| `mips64{,el}-unknown-none` ||| N/A | | \[3] \[4] |
| `mipsisa32r6{,el}-unknown-none` ||| N/A | | \[3] \[4] |
| `mipsisa64r6{,el}-unknown-none` ||| N/A | | \[3] \[4] |

\[1] `stdio`, `fs`, `time`, and `args`.<br>
\[2] I'm not sure how to test panic-unwind on qemu-user.<br>
\[4] Worked on QEMU 6.2 and QEMU 8.0, failed on QEMU 7.2.<br>
\[5] Requires nightly due to `#![feature(asm_experimental_arch)]`.<br>
\[6] It seems [unsupported on QEMU 8.0](https://qemu-project.gitlab.io/qemu/about/removed-features.html#mips-trap-and-emulate-kvm-support-removed-in-8-0).<br>
\[3] Requires nightly due to `#![feature(asm_experimental_arch)]`.<br>
\[4] It seems [unsupported on QEMU 8.0+](https://qemu-project.gitlab.io/qemu/about/removed-features.html#mips-trap-and-emulate-kvm-support-removed-in-8-0).<br>

## Optional features

Expand Down
43 changes: 21 additions & 22 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,30 @@ The host must be running an emulator or a debugger attached to the target.
The following targets have been tested on CI. (qemu-system has been tested on Linux, macOS, and Windows hosts, and qemu-user on Linux host.)
| target | exit | all-apis \[1] (qemu-system) | all-apis \[1] (qemu-user) | panic-unwind (qemu-system \[2]) |
| ------------------------------------ | ---- | --------------------------- | ------------------------- | ------------------------------- |
| `aarch64-unknown-none{,-softfloat}` | ✓ | ✓ | ✓ | ✓ |
| `{arm,thumb}v4t-none-eabi` | ✓ | | ✓ | |
| `{arm,thumb}v5te-none-eabi` | ✓ | ✓ | ✓ | |
| `armv7a-none-eabi{,hf}` | ✓ | ✓ | ✓ | |
| `armv7r-none-eabi{,hf}` | ✓ | ✓ | ✓ | |
| `armebv7r-none-eabi{,hf}` | ✓ | | ✓ | |
| `thumbv6m-none-eabi` | ✓ | ✓ | N/A | |
| `thumbv7m-none-eabi` | ✓ | ✓ | N/A | |
| `thumbv7em-none-eabi{,hf}` | ✓ | ✓ | N/A | |
| `thumbv8m.base-none-eabi` | ✓ | ✓ \[3] | N/A | |
| `thumbv8m.main-none-eabi{,hf}` | ✓ | ✓ \[3] | N/A | |
| `riscv32*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ |
| `riscv64*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ |
| `mips{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | |
| `mips64{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | |
| `mipsisa32r6{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | |
| `mipsisa64r6{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | |
| target | exit | all-apis \[1] (system) | all-apis \[1] (user-mode) | panic-unwind (system \[2]) | note |
| ----------------------------------- | ---- | ---------------------- | ------------------------- | -------------------------- | ---- |
| `aarch64-unknown-none{,-softfloat}` | ✓ | ✓ | ✓ | ✓ | |
| `{arm,thumb}v4t-none-eabi` | ✓ | | ✓ | | |
| `{arm,thumb}v5te-none-eabi` | ✓ | ✓ | ✓ | | |
| `armv7a-none-eabi{,hf}` | ✓ | ✓ | ✓ | | |
| `armv7r-none-eabi{,hf}` | ✓ | ✓ | ✓ | | |
| `armebv7r-none-eabi{,hf}` | ✓ | | ✓ | | |
| `thumbv6m-none-eabi` | ✓ | ✓ | N/A | | |
| `thumbv7m-none-eabi` | ✓ | ✓ | N/A | | |
| `thumbv7em-none-eabi{,hf}` | ✓ | ✓ | N/A | | |
| `thumbv8m.base-none-eabi` | ✓ | ✓ | N/A | | |
| `thumbv8m.main-none-eabi{,hf}` | ✓ | ✓ | N/A | | |
| `riscv32*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | |
| `riscv64*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | |
| `mips{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] |
| `mips64{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] |
| `mipsisa32r6{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] |
| `mipsisa64r6{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] |
\[1] `stdio`, `fs`, `time`, and `args`.<br>
\[2] I'm not sure how to test panic-unwind on qemu-user.<br>
\[4] Worked on QEMU 6.2 and QEMU 8.0, failed on QEMU 7.2.<br>
\[5] Requires nightly due to `#![feature(asm_experimental_arch)]`.<br>
\[6] It seems [unsupported on QEMU 8.0](https://qemu-project.gitlab.io/qemu/about/removed-features.html#mips-trap-and-emulate-kvm-support-removed-in-8-0).<br>
\[3] Requires nightly due to `#![feature(asm_experimental_arch)]`.<br>
\[4] It seems [unsupported on QEMU 8.0+](https://qemu-project.gitlab.io/qemu/about/removed-features.html#mips-trap-and-emulate-kvm-support-removed-in-8-0).<br>
## Optional features
Expand Down
6 changes: 3 additions & 3 deletions tools/no-std.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ run() {
mips*)
case "${runner}" in
qemu-system)
# TODO: On QEMU 8.0, QEMU doesn't support semihosting for MIPS.
if qemu-system-mips --version | grep -Eq "QEMU emulator version 8\.0"; then
info "QEMU doesn't support semihosting for MIPS (${target}) on QEMU 8.0 (skipped)"
# On QEMU 8.0+, QEMU doesn't seem to support semihosting for MIPS.
if qemu-system-mips --version | grep -Eq "QEMU emulator version 8\."; then
info "QEMU doesn't support semihosting for MIPS (${target}) on QEMU 8.0+ (skipped)"
return 0
fi
linker=link.x
Expand Down

0 comments on commit 53ca0b2

Please sign in to comment.