[CRIU] [PATCH 5/8] arm: restore the VFP sigframe field fpscr properly

Andrew Vagin avagin at parallels.com
Fri Nov 1 05:51:59 PDT 2013


sigframe.c: In function ‘construct_sigframe’:
sigframe.c:27:43: error: passing argument 2 of ‘sigreturn_prep_fpu_frame’ from incompatible pointer type [-Werror]
arch/arm/include/asm/restorer.h:137:5: note: expected ‘struct fpu_state_t *’ but argument is of type ‘struct vfp_sigframe *’
cc1: all warnings being treated as errors
make[1]: *** [sigframe.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/jenkins/workspace/Rpi-CRIU'
make: *** [built-in.o] Error 2


On Fri, Oct 11, 2013 at 10:48:02AM +0400, Alexander Kartashov wrote:
> The routine restore_fpu() contains two bugs:
> 
> 1) it reads more bytes from the array ThreadInfoArm::fpstate::vfp_regs
>    than it actually containes;
> 
> 2) the value of the field ThreadInfoArm::fpstate::fpscr is dropped
>    on the floor.
> 
> Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> ---
>  arch/arm/crtools.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/crtools.c b/arch/arm/crtools.c
> index db02fce..a93c4f1 100644
> --- a/arch/arm/crtools.c
> +++ b/arch/arm/crtools.c
> @@ -192,10 +192,9 @@ void arch_free_thread_info(CoreEntry *core)
>  int restore_fpu(struct rt_sigframe *sigframe, CoreEntry *core)
>  {
>  	struct aux_sigframe *aux = (struct aux_sigframe *)&sigframe->sig.uc.uc_regspace;
> -	fpu_state_t *fpu_state = &sigframe->fpu_state;
>  
> -	memcpy(&aux->vfp.ufp, CORE_THREAD_ARCH_INFO(core)->fpstate->vfp_regs, sizeof(aux->vfp.ufp));
> -	fpu_state->ufp.fpscr = CORE_THREAD_ARCH_INFO(core)->fpstate->fpscr;
> +	memcpy(&aux->vfp.ufp.fpregs, CORE_THREAD_ARCH_INFO(core)->fpstate->vfp_regs, sizeof(aux->vfp.ufp.fpregs));
> +	aux->vfp.ufp.fpscr = CORE_THREAD_ARCH_INFO(core)->fpstate->fpscr;
>  
>  	return 0;
>  }
> -- 
> 1.7.9.5
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list