[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/34] linux-user: Support for restarting system
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 10/34] linux-user: Support for restarting system calls for Microblaze targets |
Date: |
Thu, 10 Sep 2015 19:14:08 +0100 |
On 6 September 2015 at 00:57, Timothy E Baldwin
<address@hidden> wrote:
> Signed-off-by: Timothy Edward Baldwin <address@hidden>
> ---
>
> Works without signals, but my signal test case
> crashes with or without my changes.
>
> linux-user/main.c | 14 +++++++++-----
> linux-user/microblaze/syscall.h | 2 ++
> linux-user/signal.c | 2 +-
> 3 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/linux-user/main.c b/linux-user/main.c
> index d47e33f..3eacc9c 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -2911,14 +2911,14 @@ void cpu_loop(CPUMBState *env)
> queue_signal(env, info.si_signo, &info);
> }
> break;
> - case EXCP_INTERRUPT:
> - /* just indicate that signals should be handled asap */
> - break;
> + case EXCP_INTERRUPT:
> + /* just indicate that signals should be handled asap */
> + break;
> case EXCP_BREAK:
> /* Return address is 4 bytes after the call. */
> env->regs[14] += 4;
> env->sregs[SR_PC] = env->regs[14];
> - ret = do_syscall(env,
> + ret = do_syscall(env,
> env->regs[12],
> env->regs[5],
> env->regs[6],
> @@ -2927,7 +2927,11 @@ void cpu_loop(CPUMBState *env)
> env->regs[9],
> env->regs[10],
> 0, 0);
> - env->regs[3] = ret;
> + if (ret == -TARGET_ERESTARTSYS) {
> + env->sregs[SR_PC] -= 4;
This isn't going to cleanly undo the changes to regs[14]
and sregs[SR_PC] that we do on entry, so I think the restart
isn't going to work right.
> + } else if (ret != -TARGET_QEMU_ESIGRETURN) {
> + env->regs[3] = ret;
> + }
> break;
> case EXCP_HW_EXCP:
> env->regs[17] = env->sregs[SR_PC] + 4;
thanks
-- PMM
- [Qemu-devel] [PATCH 09/34] linux-user: Test for restarting system calls, (continued)
- [Qemu-devel] [PATCH 09/34] linux-user: Test for restarting system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 19/34] linux-user: Restart fork() if signals pending, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 15/34] linux-user: Remove redundant get_errno() calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 17/34] linux-user: Use safe_syscall for wait system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 21/34] linux-user: Remove redundant gdb_queuesig(), Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 10/34] linux-user: Support for restarting system calls for Microblaze targets, Timothy E Baldwin, 2015/09/05
- Re: [Qemu-devel] [PATCH 10/34] linux-user: Support for restarting system calls for Microblaze targets,
Peter Maydell <=
- [Qemu-devel] [PATCH 07/34] linux-user: Support for restarting system calls for PPC targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 14/34] linux-user: Use safe_syscall for read and write system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 16/34] linux-user: Use safe_syscall for open and openat system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 08/34] linux-user: Support for restarting system calls for SPARC targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 20/34] linux-user: Remove redundant default action check in queue_signal(), Timothy E Baldwin, 2015/09/05