Closed rrnewton closed 5 years ago
@gatoWololo - this is a place we need to sync up. The low-level JITed code in the trampoline needs to match conventions on the memory layout of the structs pointed to by the arguments to the handler function.
They will have no types in the low-level JIT'd code, but should have a matching type in the Rust code (with a corresponding pragma to control the layout).
in the trampoline: set up a call to the handler function in the trampoline: add a pointer to the register file as an argument before calling the handler function
This is already possible, you can call register_syscall_hook
to register a customized hook. though the caller must be also in the same address space as libpreload.so
.
Great, check it off! ;-)
I think the last two in that original list are debatable:
For now, I'm running on the assumption that existing thread local storage (TLS) approaches will be good enough for us to cheaply figure out who we are / where we're running from inside the captured_syscall
callback. Perhaps microbenchmark results will prove me wrong on this! I haven't benchmarked TLS in a while, but I did before when releasing a Haskell lib for it.
@wangbj has already taken this prototype pretty far. Here's a checklist and what's left (feel free to edit/correct):