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

Alexander Kartashov alekskartashov at parallels.com
Thu Oct 10 23:48:02 PDT 2013


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



More information about the CRIU mailing list