dpaoliello opened PR #9266 from dpaoliello:arm64unwind
to bytecodealliance:main
:
THIS IS A WORK IN PROGRESS.
Current status: tests partially succeeding, but there is a crash in JITted code.
dpaoliello edited PR #9266:
THIS IS A WORK IN PROGRESS.
Current status: tests partially succeeding, but there is a crash in JITted code.
Fixes #4992
dpaoliello edited PR #9266:
THIS IS A WORK IN PROGRESS.
Current status: tests partially succeeding, but there is a crash due to a malformed unwind table.
Fixes #4992
dpaoliello updated PR #9266.
alexcrichton commented on PR #9266:
At a high level this looks great, thanks for working on this! We'll probably be trusting you on the particulars of the table format here, and we unfortunately also probably won't be able to run this on CI (unless you know of way to run this and/or emulation on CI). That being said once you're able to run tests locally that's probably a good enough sign for now and should be good to land afterwards.
It may also be worth noting that the test failures may not be related to unwinding necessarily, I believe Wasmtime has seen very little testing on Windows ARM64 meaning that there could be little other things here and there to overcome as well.
dpaoliello updated PR #9266.
dpaoliello updated PR #9266.
dpaoliello updated PR #9266.
dpaoliello edited PR #9266:
Implements unwind support for ARM64 Windows.
This also fixes an issue with the current AArch64 ABI code where it wasn't emitting unwind instructions when adjusting the stack pointer (i.e., doing a stack alloc).
Fixes #4992
dpaoliello edited PR #9266:
Implements unwind support for ARM64 Windows.
This also fixes an issue with the current AArch64 ABI code where it wasn't emitting unwind instructions when adjusting the stack pointer (i.e., doing a stack alloc).
With this change,
cargo test
passes all tests on my Windows ARM64 device.Fixes #4992
dpaoliello has marked PR #9266 as ready for review.
dpaoliello requested wasmtime-compiler-reviewers for a review on PR #9266.
dpaoliello requested abrown for a review on PR #9266.
dpaoliello requested fitzgen for a review on PR #9266.
dpaoliello requested wasmtime-core-reviewers for a review on PR #9266.
cfallin submitted PR review:
I made a pass over this code as well and it's generally very high-quality, thanks!
To confirm specifically: does the whole Wasmtime suite (
cargo test
in the root) pass now on Windows/aarch64?Echoing Alex's thoughts -- if we can test this somehow (WINE on qemu-aarch64? or does Windows/x64 support running aarch64 binaries with emulation somehow? or ...?) then we can add release binaries.
(There's precedent for adding release binaries before that, from the macOS/aarch64 case -- we just got GitHub runners for that a few months ago -- though in that case there was external CI run by a third party and those of us with new Macs also manually checked when able.)
cfallin created PR review comment:
At least in new code, we're trying to avoid
as
-casts; even though here it's infallibly correct, could we writeu16::try_from(size).unwrap()
(or.expect("constant max size for this case exceeds u16")
or somesuch so that auditing for overflows is a little easier?
fitzgen submitted PR review:
LGTM modulo one nitpick below
fitzgen created PR review comment:
Can the names of each of these individual codes match the name in the link above? Specifically
SmallStackAlloc
is calledalloc_s
there so I'd expect it to beAllocS
here.Also, it would be nice to have doc comments for the variants that are missing them. For example, the difference between small vs medium stack alloc isn't immediately clear to the reader because they have the same
u16
data representation.
dpaoliello commented on PR #9266:
To confirm specifically: does the whole Wasmtime suite (cargo test in the root) pass now on Windows/aarch64?
Correct:
cargo test
in the root passes on an ARM64 Windows device.Echoing Alex's thoughts -- if we can test this somehow (WINE on qemu-aarch64? or does Windows/x64 support running aarch64 binaries with emulation somehow? or ...?) then we can add release binaries.
That's a tough one.
I've never tried WINE on AArch64 (emulated or physical), so I can't comment on that.
Windows x64 can't run AArch64 binaries.
GitHub does offer Windows ARM64 runners however the only image available is a clean Windows 11 install (No Visual Studio, no Git, etc.). The lack of an image with pre-installed tools is also blocking making aarch64-pc-windows-msvc a tier 1 Rust target, so it's high on my priority list to get the correct team at GitHub/Microsoft to make and support those images.
dpaoliello updated PR #9266.
dpaoliello submitted PR review.
dpaoliello created PR review comment:
Done: removes the
as
casts.
dpaoliello edited PR review comment.
dpaoliello submitted PR review.
dpaoliello created PR review comment:
Done: Renamed the alloc items and added a comment to explain the max size of each one.
alexcrichton commented on PR #9266:
If you're interested @dpaoliello the "fully exhaustive test suite" can be run with
./ci/run-tests.sh
locally (and/or copying out the cargo invocation since you probably don't have bash on windows) which basically iscargo test --workspace
with a few--exclude
for things that aren't supposed to be tested. That will run allwasmtime-wasi
tests for example which exercise some "larger modules" than thecargo test
does at the root of the repo. (but for development most of us I think do justcargo test
and let CI figure everything else out). I mention this if you want to perform an extra double-check that all the various bits are working, but I suspect that ifcargo test
works this won't turn up much else.I'm also happy to leave this untested on CI until it's easier to set up CI with tools and such. The likelihood of this regressing is relatively low and we can always ping you @dpaoliello (if you're ok with that) if something looks like it's changing. Otherwise I'm also happy to investigate adding ARM64 binaries for Windows to our CI to get release artifacts as well.
dpaoliello commented on PR #9266:
If you're interested @dpaoliello the "fully exhaustive test suite" can be run with
./ci/run-tests.sh
locally (and/or copying out the cargo invocation since you probably don't have bash on windows) which basically iscargo test --workspace
with a few--exclude
for things that aren't supposed to be tested. That will run allwasmtime-wasi
tests for example which exercise some "larger modules" than thecargo test
does at the root of the repo. (but for development most of us I think do justcargo test
and let CI figure everything else out). I mention this if you want to perform an extra double-check that all the various bits are working, but I suspect that ifcargo test
works this won't turn up much else.Sure, I'll give it a go. Otherwise, I was starting to look into getting
rustc_codegen_cranelift
working.I'm also happy to leave this untested on CI until it's easier to set up CI with tools and such.
I'll add it to my list of repos to setup CIs once the Windows ARM64 images are available...
we can always ping you @dpaoliello (if you're ok with that) if something looks like it's changing.
Yes, please!
Feel free to summon me for any Rust-msvc
target or Windows on ARM issue.
fitzgen submitted PR review:
Thanks so much!
fitzgen commented on PR #9266:
Looks like this is failing on our MSRV:
https://github.com/bytecodealliance/wasmtime/actions/runs/10944294333/job/30385843729#step:18:102
error[E0658]: exclusive range pattern syntax is experimental --> cranelift/codegen/src/isa/unwind/winarm64.rs:231:21 | 231 | 0..SMALL_STACK_ALLOC_MAX => unwind_codes.push(UnwindCode::AllocS { | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information = help: use an inclusive range pattern, like N..=M error[E0658]: exclusive range pattern syntax is experimental --> cranelift/codegen/src/isa/unwind/winarm64.rs:234:21 | 234 | SMALL_STACK_ALLOC_MAX..MEDIUM_STACK_ALLOC_MAX => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information = help: use an inclusive range pattern, like N..=M error[E0658]: exclusive range pattern syntax is experimental --> cranelift/codegen/src/isa/unwind/winarm64.rs:239:21 | 239 | MEDIUM_STACK_ALLOC_MAX..LARGE_STACK_ALLOC_MAX => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information = help: use an inclusive range pattern, like N..=M
fitzgen edited a comment on PR #9266:
Looks like this is failing on our MSRV of Rust 1.78:
https://github.com/bytecodealliance/wasmtime/actions/runs/10944294333/job/30385843729#step:18:102
error[E0658]: exclusive range pattern syntax is experimental --> cranelift/codegen/src/isa/unwind/winarm64.rs:231:21 | 231 | 0..SMALL_STACK_ALLOC_MAX => unwind_codes.push(UnwindCode::AllocS { | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information = help: use an inclusive range pattern, like N..=M error[E0658]: exclusive range pattern syntax is experimental --> cranelift/codegen/src/isa/unwind/winarm64.rs:234:21 | 234 | SMALL_STACK_ALLOC_MAX..MEDIUM_STACK_ALLOC_MAX => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information = help: use an inclusive range pattern, like N..=M error[E0658]: exclusive range pattern syntax is experimental --> cranelift/codegen/src/isa/unwind/winarm64.rs:239:21 | 239 | MEDIUM_STACK_ALLOC_MAX..LARGE_STACK_ALLOC_MAX => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information = help: use an inclusive range pattern, like N..=M
dpaoliello updated PR #9266.
dpaoliello commented on PR #9266:
Looks like this is failing on our MSRV of Rust 1.78
Fixed
cfallin has enabled auto merge for PR #9266.
cfallin merged PR #9266.
Last updated: Nov 22 2024 at 16:03 UTC