[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 05/13] signal/all: remove return value from r
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 05/13] signal/all: remove return value from restore_sigcontext |
Date: |
Sat, 7 Jun 2014 22:30:16 +0100 |
On 6 June 2014 10:46, <address@hidden> wrote:
> From: Riku Voipio <address@hidden>
>
> make most implementations of restore_sigcontext void and
> remove checking it's return value from functions calling
> restore_sigcontext.
>
> The exception is the X86 version of the function that is
> too different from others to deal in this way.
>
> Signed-off-by: Riku Voipio <address@hidden>
> ---
> linux-user/signal.c | 65
> +++++++++++++----------------------------------------
> 1 file changed, 16 insertions(+), 49 deletions(-)
>
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index 421bd48..7b828bf 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -1546,12 +1546,6 @@ static const abi_ulong retcodes[4] = {
> SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN
> };
>
> -
> -static inline int valid_user_regs(CPUARMState *regs)
> -{
> - return 1;
> -}
I don't think we should remove this function -- there are a number
of checks we should be making here for correct behaviour to
ensure that the guest hasn't passed us a bogus CPSR. Compare
the kernel's version of this function:
http://lxr.linux.no/#linux+v3.14.5/arch/arm/include/asm/ptrace.h#L46
We basically want all those checks (except we can drop the
ones related to 26-bit CPUs and M-profile). We don't need to
implement them in this series but we shouldn't remove the function
and code path which are the right places to add them later.
thanks
-- PMM