[CRIU] [PATCH 3/6] criu: arch, x86 -- Don't require fpu structures to be aligned

Cyrill Gorcunov gorcunov at openvz.org
Mon Feb 13 07:03:20 PST 2017


The kernel will provide aligned data internally
and pass them into hardware.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/arch/x86/sigframe.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/criu/arch/x86/sigframe.c b/criu/arch/x86/sigframe.c
index 7faed892aa7b..24afb863f0b5 100644
--- a/criu/arch/x86/sigframe.c
+++ b/criu/arch/x86/sigframe.c
@@ -18,15 +18,10 @@ int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe,
 		&rsigframe->compat.fpu_state;
 	unsigned long addr = (unsigned long)(void *)&fpu_state->xsave;
 
-	if (sigframe->is_native && (addr % 64ul) == 0ul) {
+	if (sigframe->is_native)
 		sigframe->native.uc.uc_mcontext.fpstate = &fpu_state->xsave;
-	} else if (!sigframe->is_native && (addr % 32ul) == 0ul) {
+	else if (!sigframe->is_native)
 		sigframe->compat.uc.uc_mcontext.fpstate = (uint32_t)addr;
-	} else {
-		pr_err("Unaligned address passed: %lx (native %d)\n",
-		       addr, sigframe->is_native);
-		return -1;
-	}
 
 	return 0;
 }
-- 
2.7.4



More information about the CRIU mailing list