[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure fo
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls |
Date: |
Sun, 10 Jun 2018 13:39:12 +0100 |
On 10 June 2018 at 13:32, Peter Maydell <address@hidden> wrote:
> On 10 June 2018 at 04:00, Richard Henderson
> <address@hidden> wrote:
>> At the same time, split out set_robust_list and get_robust_list.
>> Put them together, along with their block comment, at the top
>> of syscall_table.
>>
>> Signed-off-by: Richard Henderson <address@hidden>
>> +/* For a given syscall number, return a function implementing it.
>> + * Do this via switch statement instead of table because some targets
>> + * do not begin at 0 and others have a large split in the middle of
>> + * the numbers. The compiler should be able to produce a dense table.
>> + */
> I was expecting this to be a table lookup, something like
> return syscalls[num].impl;
>
> where the other entries in the syscalls[num] structs would be
> for instance the strace data we currently have in strace.list.
Ah, I see the comment covers this. I'd still rather we had all
the information related to a syscall in one place, though -- this
way we end up with the ifdefs and so on which determine whether
a syscall is implemented having to be duplicated:
(a) in the implementation
(b) in this switch code
(c) in the handling of strace
It would be cleaner to have a single
#if something
static foo_impl(..) { ... }
static syscall_impl foo = {
.name = "foo",
.impl = foo_impl,
.strace_stuff = ...,
};
register_syscall(foo);
#endif
Hash table?
thanks
-- PMM
- Re: [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG, (continued)
- [Qemu-devel] [PATCH v2 002/108] linux-user: Split out do_syscall1, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 005/108] linux-user: Propagate goto unimplemented_nowarn to return, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 006/108] linux-user: Propagate goto unimplemented to default, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 007/108] linux-user: Propagate goto fail to return, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 004/108] linux-user: Propagate goto efault to return, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 008/108] linux-user: Make syscall number unsigned, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 010/108] linux-user: Split out brk, close, exit, read, write, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 003/108] linux-user: Relax single exit from "break", Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 011/108] linux-user: Split out execve, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 012/108] linux-user: Split out open, openat, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 013/108] linux-user: Split out name_to_handle_at, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 014/108] linux-user: Split out open_to_handle_at, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 016/108] linux-user: Split out link, linkat, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 015/108] linux-user: Split out creat, fork, waitid, waitpid, Richard Henderson, 2018/06/09
- [Qemu-devel] [PATCH v2 017/108] linux-user: Split out unlink, unlinkat, Richard Henderson, 2018/06/09