On Mon, May 05, 2008 at 12:00:08PM +0200, Eric Sesterhenn wrote:[...] Hi Eric, This appears to be caused by init_fpu() missing from the restore_sigcontext->restore_i387->restore_fpu_checking code path. I believe that moving the init_fpu() call from math_state_restore to restore_fpu_checking should fix the problem? Regards, Frederik Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com> diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index 8069073..5b1af48 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c @@ -1142,22 +1142,6 @@ asmlinkage void math_state_restore(void) { struct task_struct *me = current; - if (!used_math()) { - local_irq_enable(); - /* - * does a slab alloc which can sleep - */ - if (init_fpu(me)) { - /* - * ran out of memory! - */ - do_group_exit(SIGKILL); - return; - } - local_irq_disable(); - } - - clts(); /* Allow maths ops (or we recurse) */ restore_fpu_checking(&me->thread.xstate->fxsave); task_thread_info(me)->status |= TS_USEDFPU; me->fpu_counter++; diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h index da2adb4..bf1cabe 100644 --- a/include/asm-x86/i387.h +++ b/include/asm-x86/i387.h @@ -47,7 +47,20 @@ static inline void tolerant_fwait(void) static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) { - int err; + int err = -1; + + if (!used_math()) { + local_irq_enable(); + /* + * does a slab alloc which can sleep + */ + if (init_fpu(current)) + return err; + local_irq_disable(); + } + + clts(); /* Allow maths ops (or we recurse) */ asm volatile("1: rex64/fxrstor (%[fx])\n\t" "2:\n" --
| Andrea Arcangeli | [PATCH 06 of 11] rwsem contended |
| Manu Abraham | PCIE |
| Alex Samad | page swap allocation error/failure in 2.6.25 |
| Rafael J. Wysocki | Re: [Bug 10030] Suspend doesn't work when SD card is inserted |
git: | |
| Elijah Newren | Trying to use git-filter-branch to compress history by removing large, obsolete bi... |
| Andy Parkins | svn:externals using git submodules |
| Junio C Hamano | [ANNOUNCE] GIT 1.5.4 |
| Tommi Virtanen | [PATCH] "git shell" won't work, need "git-shell" |
| Marcos Laufer | dmesg IBM x3650 OpenBSD 4.3 |
| Richard Stallman | Real men don't attack straw men |
| Richard Storm | MAXDSIZ 1GB memory limit for process |
| Edd Barrett | Re: OpenBSD in the webcomic XKCD |
| Felix Radensky | RE: e1000e "Detected Tx Unit Hang" |
| Sami Farin | Re: Linux 2.6.27.5 / SFQ/HTB scheduling problems |
| Jeff Garzik | Re: [PATCH] sky2: jumbo frame regression fix |
| Indan Zupancic | Re: Realtek 8111C transmit timed out |
