[4/6] compel: arch, x86 -- Don't require fpu structures to be aligned

Submitted by Cyrill Gorcunov on Feb. 13, 2017, 3:03 p.m.

Details

Message ID 1486998203-2834-5-git-send-email-gorcunov@openvz.org
State New
Series "ia32: Add support for FPU c/r in compat environment"
Headers show

Commit Message

Cyrill Gorcunov Feb. 13, 2017, 3:03 p.m.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
 compel/arch/x86/src/lib/infect.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/compel/arch/x86/src/lib/infect.c b/compel/arch/x86/src/lib/infect.c
index 418c43414d32..d5b4f7659c65 100644
--- a/compel/arch/x86/src/lib/infect.c
+++ b/compel/arch/x86/src/lib/infect.c
@@ -115,15 +115,10 @@  int sigreturn_prep_fpu_frame_plain(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;
 }