All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] x86: signal_32: do save_i387_xstate() at get_sigframe()
@ 2008-11-06  2:30 Hiroshi Shimamoto
  2008-11-06  2:32 ` [PATCH 2/4] x86: ia32_signal: do save_i387_xstate_ia32 " Hiroshi Shimamoto
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Hiroshi Shimamoto @ 2008-11-06  2:30 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

move calling save_i387_xstate() into get_sigframe() from setup_sigcontext()
like 64bit.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/signal_32.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index a0efc1b..6a05c74 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -303,11 +303,7 @@ setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate,
 	err |= __put_user(regs->sp, &sc->sp_at_signal);
 	err |= __put_user(regs->ss, (unsigned int __user *)&sc->ss);
 
-	tmp = save_i387_xstate(fpstate);
-	if (tmp < 0)
-		err = 1;
-	else
-		err |= __put_user(tmp ? fpstate : NULL, &sc->fpstate);
+	err |= __put_user(fpstate, &sc->fpstate);
 
 	/* non-iBCS2 extensions.. */
 	err |= __put_user(mask, &sc->oldmask);
@@ -350,6 +346,8 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
 	if (used_math()) {
 		sp = sp - sig_xstate_size;
 		*fpstate = (struct _fpstate *) sp;
+		if (save_i387_xstate(*fpstate) < 0)
+			return (void __user *)-1L;
 	}
 
 	sp -= frame_size;
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-06  7:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-06  2:30 [PATCH 1/4] x86: signal_32: do save_i387_xstate() at get_sigframe() Hiroshi Shimamoto
2008-11-06  2:32 ` [PATCH 2/4] x86: ia32_signal: do save_i387_xstate_ia32 " Hiroshi Shimamoto
2008-11-06  2:33 ` [PATCH 3/4] x86: signal_64: setup fpstate in setup_sigcontext() Hiroshi Shimamoto
2008-11-06  2:34 ` [PATCH 4/4] x86: signal_64: make setup_sigcontext() similar Hiroshi Shimamoto
2008-11-06  7:02 ` [PATCH 1/4] x86: signal_32: do save_i387_xstate() at get_sigframe() Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.