-
Notifications
You must be signed in to change notification settings - Fork 11
[Refactor] Integrate 3i into Wasmtime runtime #238
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
base: threei
Are you sure you want to change the base?
Conversation
@@ -68,17 +68,25 @@ impl LindCommonCtx { | |||
// exit syscall | |||
30 => wasmtime_lind_multi_process::exit_syscall(caller, arg1 as i32), | |||
// other syscalls goes into rawposix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either a long comment explaining the API or link to doc where its explained would be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments
@@ -43,6 +45,26 @@ fn parse_preloads(s: &str) -> Result<(String, PathBuf)> { | |||
Ok((parts[0].into(), parts[1].into())) | |||
} | |||
|
|||
static VM_TABLE: Lazy<RwLock<Vec<Option<InstanceHandle>>>> = Lazy::new(|| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment what this is and what the functions below do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments
src/wasmtime/src/commands/run.rs
Outdated
insert_ctx(current_pid as usize, grate_instancehandler.clone()); | ||
} | ||
|
||
let res = threei_test_func(current_pid, Box::new(move |call_ptr: u64, cageid: u64, arg1: u64, arg1cageid: u64, arg2: u64, arg2cageid: u64, arg3: u64, arg3cageid: u64, arg4: u64, arg4cageid: u64, arg5: u64, arg5cageid: u64, arg6: u64, arg6cageid: u64| -> i32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is labeled test function, should this be part of the main codebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
@@ -186,6 +194,33 @@ pub fn add_to_linker< | |||
}, | |||
)?; | |||
|
|||
// attach register_handler to wasmtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id like more information in the comments on what these do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments
This PR refactors the Wasmtime runtime to support 3i-based dynamic syscall interposition.
It introduces
(1) mechanisms for capturing and storing instance context (vmctx)
(2) resolving exported Wasm functions by name at runtime
(3) replacing all original
lind_syscall_api
in RawPOSIX dispatcher bymake_syscall
in threei(4) supporting
copy_data_between_cages
andcopy_handler_table
in wasmtime sideNotes:
This can only be tested after all draft PR being merged.