[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/33] linux-user: Split out do_syscall1
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 01/33] linux-user: Split out do_syscall1 |
Date: |
Fri, 1 Jun 2018 07:52:34 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 06/01/2018 07:00 AM, Eric Blake wrote:
> On 06/01/2018 02:30 AM, Richard Henderson wrote:
>> There was supposed to be a single point of return for do_syscall
>> so that tracing works properly. However, there are a few bugs
>> in that area. It is significantly simpler to simply split out
>> an inner function to enforce this.
>>
>> Signed-off-by: Richard Henderson <address@hidden>
>> ---
>> linux-user/syscall.c | 89 +++++++++++++++++++++++++++-----------------
>> 1 file changed, 54 insertions(+), 35 deletions(-)
>>
>
>> @@ -7977,28 +7979,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
>> arg1,
>> void *p;
>> char *fn;
>> -#if defined(DEBUG_ERESTARTSYS)
>
>> +abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
>> + abi_long arg2, abi_long arg3, abi_long arg4,
>> + abi_long arg5, abi_long arg6, abi_long arg7,
>> + abi_long arg8)
>> +{
>> + CPUState *cpu = ENV_GET_CPU(cpu_env);
>> + abi_long ret;
>> +
>> +#if defined(DEBUG_ERESTARTSYS)
>
> Code motion, but...
>
>> + /* Debug-only code for exercising the syscall-restart code paths
>> + * in the per-architecture cpu main loops: restart every syscall
>> + * the guest makes once before letting it through.
>> + */
>> + {
>> + static bool flag;
>> + flag = !flag;
>> + if (flag) {
>> + return -TARGET_ERESTARTSYS;
>> + }
>> + }
>> +#endif
>> +#ifdef DEBUG
>
> ...it looks inconsistent to mix '#if defined()' with '#ifdef' in the same
> function. Worth cleaning up while you do this refactoring?
Yes, I've been trying to remember to fix this as I go, but obviously missed
some.
r~
>
- [Qemu-devel] [PATCH 00/33] linux-user: Begin splitting do_syscall, Richard Henderson, 2018/06/01
- [Qemu-devel] [PATCH 01/33] linux-user: Split out do_syscall1, Richard Henderson, 2018/06/01
- [Qemu-devel] [PATCH 03/33] linux-user: Propagate goto ebadf to return, Richard Henderson, 2018/06/01
- [Qemu-devel] [PATCH 05/33] linux-user: Propagate goto unimplemented_nowarn to return, Richard Henderson, 2018/06/01
- [Qemu-devel] [PATCH 08/33] linux-user: Make syscall number unsigned, Richard Henderson, 2018/06/01
- [Qemu-devel] [PATCH 06/33] linux-user: Split out goto unimplemented to do_unimplemented, Richard Henderson, 2018/06/01
- [Qemu-devel] [PATCH 07/33] linux-user: Propagate goto fail to return, Richard Henderson, 2018/06/01