-
Notifications
You must be signed in to change notification settings - Fork 3
Rebase on the latest #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ktock
wants to merge
11
commits into
sync-upstream
Choose a base branch
from
dev-e
base: sync-upstream
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dfb7428
to
6d75747
Compare
On emscripten, function pointer casts can cause function call failure. This commit fixes the function definition to match to the type of the function call. - qtest_set_command_cb passed to g_once should match to GThreadFunc - object_class_cmp and cpreg_key_compare are passed to g_list_sort as GCopmareFunc but GLib cast them to GCompareDataFunc. Signed-off-by: Kohei Tokunaga <[email protected]>
Signed-off-by: Kohei Tokunaga <[email protected]>
Signed-off-by: Kohei Tokunaga <[email protected]>
Emscripten does not support couroutine methods currently used by QEMU but provides a coroutine implementation called "fiber". This commit introduces a coroutine backend using fiber. Note that fiber does not support submitting coroutines to other threads. Signed-off-by: Kohei Tokunaga <[email protected]>
has_int128_type is set to false on emscripten as of now to avoid errors by libffi. And tests aren't integrated with Wasm execution environment as of now so this commit disables tests. Signed-off-by: Kohei Tokunaga <[email protected]>
To enable 64-bit guest support in Wasm 32bit memory model today, it was necessary to partially revert recent changes that removed support for different pointer widths between the host and guest (e.g., commits a70af12 and bf455ec) when compiling with Emscripten. While this serves as a temporary workaround, a long-term solution could involve adopting Wasm's 64-bit memory model once it gains broader support, as it is currently not widely adopted (e.g., unsupported by Safari and libffi). Signed-off-by: Kohei Tokunaga <[email protected]>
A TB consists of a wasmTBHeader followed by the data listed below. The wasmTBHeader contains pointers for each element: - TCI code - Wasm code - Array of function indices imported into the Wasm instance - Counter tracking the number of TB executions - Pointer to the Wasm instance information The Wasm backend (tcg/wasm32.c) and Wasm instances running on the same thread share information, such as CPUArchState, through a wasmContext structure. The Wasm backend defines tcg_qemu_tb_exec as a common entry point for TBs, similar to the TCI backend. tcg_qemu_tb_exec runs TBs on a forked TCI interpreter by default, while compiles and executes frequently executed TBs as Wasm. The code generator (tcg/wasm32) receives TCG IR and generates both Wasm and TCI instructions. Since Wasm cannot directly jump to specific addresses, labels are implemented using Wasm control flow instructions. As shown in the pseudo-code below, a TB wraps instructions in a large loop, where codes are placed within if blocks separated by labels. Branching is handled by breaking from the current block and entering the target block. loop if ... code after label1 end if ... code after label2 end ... end Additionally, the Wasm backend differs from other backends in several ways: - goto_tb and goto_ptr return control to tcg_qemu_tb_exec which runs the target TB - Helper function pointers are stored in an array in TB and imported into the Wasm instance on execution - Wasm TBs lack prologue and epilogue. TBs are executed via tcg_qemu_tb_exec Browsers cause out of memory error if too many Wasm instances are created. To prevent this, the Wasm backend tracks active instances using an array. When instantiating a new instance risks exceeding the limit, the backend removes older instances to avoid browser errors. These removed instances are re-instantiated when needed. Signed-off-by: Kohei Tokunaga <[email protected]>
Emscripten's fiber does not support submitting coroutines to other threads. So this commit modifies hw/9pfs/coth.h to disable this behavior when compiled with Emscripten. Signed-off-by: Kohei Tokunaga <[email protected]>
Add GitLab CI job that builds QEMU using emscripten. The build runs in the added Dockerfile that contains dependencies (glib, libffi, pixman, zlib) compiled by emscripten. Signed-off-by: Kohei Tokunaga <[email protected]>
Signed-off-by: Kohei Tokunaga <[email protected]>
Signed-off-by: Kohei Tokunaga <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.