RFC linux-user: refactor do_syscall()
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest5 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | linux-user: move exit to own functionlinux-user/ | +48 | 0 replies | |
| 2/5 | linux-user: move read to own functionlinux-user/ | +16 | 0 replies | |
| 3/5 | linux-user: move write to own functionlinux-user/ | +11 | 0 replies | |
| 4/5 | linux-user: complete do_open function isolationlinux-user/ | +18 | 0 replies | |
| 5/5 | linux-user: do_openat wrapper addedlinux-user/ | +14 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [RFC] [PATCH 0/5] linux-user: refactor do_syscall()
From: Riku Voipio <[email protected]>
Currently linux-user handles system calls with a 3000+ line switch/case construct in do_syscall(). Some syscalls are implemented inline in the switch/case, others as separate functions, and the rest as mix of both.
As the first step of the cleanup, I'd like to move implementation of each syscall completely to their own functions. While at it, we define more standard interface between do_syscall() and the functions implementing the system calls: system call functions take parameter as raw abi_long, and leave the host to target errno conversion to do_syscall.
Once all syscall are converted to separate functions, we can convert to switch/case to a table with syscall structs pointing to syscall implementation as well the strace definitions currently in strace.list.
Before I proceed to convert all 300+ syscalls implemented, I'd like to hear if people think it is a good idea, or if you have some improvements to suggest. To see how it would look in practice, here are the first five syscalls cleaned up.
Riku Voipio (5):
linux-user: move exit to own function
linux-user: move read to own function
linux-user: move write to own function
linux-user: complete do_open function isolation
linux-user: do_openat wrapper added
linux-user/syscall.c | 182 +++++++++++++++++++++++++++++--------------------- 1 file changed, 106 insertions(+), 76 deletions(-)
Signature · 1 line
1.7.9.5