Stream: general

Topic: ✔ riscv64 fiber port.


view this post on Zulip yang yu (Jul 25 2022 at 05:36):

Can someone help me port fiber lib to riscv64.
I am not very understand the concept of the lib.
https://github.com/bytecodealliance/wasmtime/pull/4271#issuecomment-1186734601
thanks.

I am been trying to add riscv64 backend for cranelift these days. right now I have pass all run test in filetests. some features not implemented right now. i128 mul div rem, all simd type and com...

view this post on Zulip Anton Kirilov (Jul 25 2022 at 13:47):

I might be able to answer general questions, but nothing RISC-V-specific. Since you say that you don't understand the concept of the crate, are you aware of the general concept of a fiber?
The wasmtime_fiber_switch() function is executed after one fiber yields, and there is another runnable fiber. wasmtime_fiber_init() is a fiber creation routine, or at least contains the bits that must be implemented in assembly.

view this post on Zulip yang yu (Aug 04 2022 at 02:51):

right now . only unwinding stack not working.

image.png
https://github.com/yuyang-ok/wasmtime/blob/risc-v/crates/fiber/src/unix/riscv64.rs

I am wondering if something wrong with sp pointer, since sp is callee-save register.
But looks didnot restore.

Standalone JIT-style runtime for WebAssembly, using Cranelift - wasmtime/riscv64.rs at risc-v · yuyang-ok/wasmtime

view this post on Zulip Chris Fallin (Aug 04 2022 at 15:05):

I am wondering if something wrong with sp pointer, since sp is callee-save register.
But looks didnot restore.

@yang yu a stack-swapping context switch (what the fiber switch routine is doing) saves/restores SP right in the middle, as it switches to the new one; or do I misunderstand the issue? In any case, great that fibers are working now!

view this post on Zulip nagisa (Aug 04 2022 at 18:45):

unwinds not working usually are going to be caused by incorrect cfi somewhere.

view this post on Zulip yang yu (Aug 05 2022 at 00:59):

@Chris Fallin I have switch sp in assembly code. sp didnot restore I means sp didnot restore when unwinding the stack.
I have another question at.

https://stackoverflow.com/questions/73232295/how-dwarf-format-caculate-provious-sp-pointer

this is example is from dwarf document. How Can I caculate provious sp(r7) pointer,I mean It didnot save sp somewhere since sp is a callee-save register. The architectural ABI committee specifies t...

view this post on Zulip Chris Fallin (Aug 05 2022 at 01:12):

@yang yu it's probably best to ask @Alex Crichton , he set up the CFI directives in wasmtime-fiber I think

view this post on Zulip yang yu (Aug 05 2022 at 01:13):

yes , but He still have no time.

view this post on Zulip Notification Bot (Aug 10 2022 at 00:44):

yang yu has marked this topic as resolved.


Last updated: Nov 22 2024 at 17:03 UTC