-
Notifications
You must be signed in to change notification settings - Fork 151
Only clear io buffer after unsuccesfull guest call #811
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
Conversation
58c76e0
to
48ca86a
Compare
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.
Pull Request Overview
This PR optimizes performance by only clearing I/O buffers after unsuccessful guest calls, rather than clearing them after every call. Additionally, it fixes issues with poisoned mutexes when host functions panic and adds required system calls to the seccomp allowlist for the Rust panic handler.
Key changes:
- Conditional buffer clearing to improve performance in the happy path
- Enhanced panic handling for host functions with proper error propagation
- Addition of syscalls needed by Rust's panic handler to the seccomp allowlist
Reviewed Changes
Copilot reviewed 6 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/hyperlight_host/src/sandbox/initialized_multi_use.rs |
Added conditional buffer clearing logic and comprehensive test for host function panic scenarios |
src/hyperlight_host/src/sandbox/host_funcs.rs |
Enhanced panic handling to extract and propagate panic messages as proper errors |
src/hyperlight_host/src/func/host_functions.rs |
Fixed poisoned mutex handling to allow recovery from panicked host function calls |
src/hyperlight_host/src/error.rs |
Added new HostFunctionPanic error variant for better error reporting |
src/hyperlight_host/src/seccomp/guest.rs |
Added syscalls required by Rust's panic handler to the allowlist |
src/tests/rust_guests/simpleguest/src/main.rs |
Added test guest function to trigger host function panics for testing |
48ca86a
to
ed51c21
Compare
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.
LGTM
ef9bfd4
to
57f1716
Compare
Signed-off-by: Ludvig Liljenberg <[email protected]> Undo stuff that breaks unwinding Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
57f1716
to
1d7ff9a
Compare
We are currently zeroing out some buffers when we do not need to. By removing the extra clear, performance should increase:
Copy-pasted comment from code here
In the happy path we do not need to clear io-buffers from the host because:
try_pop_shared_input_data_into::<FunctionCall>()
get_guest_function_call_result
get_host_function_call
get_host_return_value
In addition,this PR fixes an issue when host functions panicked, the associated mutexes were poisoned which prevented making further host calls to the same function.EDIT: this PR does not fix thatCloses #715