Skip to content

Commit

Permalink
ci: Upgrade QEMU to 8.1.1 (#7096)
Browse files Browse the repository at this point in the history
* ci: Upgrade QEMU to `8.1.1`

This adds support for RISC-V's Zcb extension that includes some
extra compressed instructions.

It also removes the current cpuinfo patch, that has been released
in 8.1

* wasmtime: Don't assert the exact faulting address for wasm traps
  • Loading branch information
afonso360 authored Sep 28, 2023
1 parent cf28c22 commit 40c1f9b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 128 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ jobs:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
QEMU_BUILD_VERSION: 8.0.4
QEMU_BUILD_VERSION: 8.1.1
strategy:
fail-fast: true
matrix: ${{ fromJson(needs.determine.outputs.test-matrix) }}
Expand Down Expand Up @@ -435,7 +435,6 @@ jobs:
# quickly.
curl https://download.qemu.org/qemu-$QEMU_BUILD_VERSION.tar.xz | tar xJf -
cd qemu-$QEMU_BUILD_VERSION
patch -p1 < $GITHUB_WORKSPACE/ci/qemu-cpuinfo.patch
./configure --target-list=${{ matrix.qemu_target }} --prefix=${{ runner.tool_cache}}/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs
ninja -C build install
touch ${{ runner.tool_cache }}/qemu/built
Expand Down
2 changes: 1 addition & 1 deletion ci/build-test-matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const array = [
"target": "riscv64gc-unknown-linux-gnu",
"gcc_package": "gcc-riscv64-linux-gnu",
"gcc": "riscv64-linux-gnu-gcc",
"qemu": "qemu-riscv64 -cpu rv64,v=true,vlen=256,vext_spec=v1.0,zba=true,zbb=true,zbc=true,zbs=true,zbkb=true -L /usr/riscv64-linux-gnu",
"qemu": "qemu-riscv64 -cpu rv64,v=true,vlen=256,vext_spec=v1.0,zba=true,zbb=true,zbc=true,zbs=true,zbkb=true,zcb=true -L /usr/riscv64-linux-gnu",
"qemu_target": "riscv64-linux-user",
"name": "Test Linux riscv64",
"filter": "linux-riscv64",
Expand Down
115 changes: 0 additions & 115 deletions ci/qemu-cpuinfo.patch

This file was deleted.

15 changes: 5 additions & 10 deletions tests/all/traps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1347,23 +1347,18 @@ fn wasm_fault_address_reported_by_default() -> Result<()> {
)?;
let err = Instance::new(&mut store, &module, &[]).unwrap_err();

// On s390x faulting addressess are rounded to the nearest page boundary
// instead of having the precise address reported.
let mut expected_addr = 0xdeadbeef_u32;
if cfg!(target_arch = "s390x") {
expected_addr &= 0xfffff000;
}

// NB: at this time there's no programmatic access to the fault address
// because it's not always available for load/store traps. Only static
// memories on 32-bit have this information, but bounds-checked memories
// use manual trapping instructions and otherwise don't have a means of
// communicating the faulting address at this time.
//
// It looks like the exact reported fault address may not be deterministic,
// so assert that we have the right error message, but not the exact address.
let err = format!("{err:?}");
assert!(
err.contains(&format!(
"memory fault at wasm address 0x{expected_addr:x} in linear memory of size 0x10000"
)),
err.contains("memory fault at wasm address ")
&& err.contains(" in linear memory of size 0x10000"),
"bad error: {err}"
);
Ok(())
Expand Down

0 comments on commit 40c1f9b

Please sign in to comment.