Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbaBFF03 (ORCPT ); Thu, 6 Feb 2014 00:26:29 -0500 Received: from aurora.thatsmathematics.com ([162.209.10.89]:46099 "EHLO aurora.thatsmathematics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbaBFF01 (ORCPT ); Thu, 6 Feb 2014 00:26:27 -0500 Date: Wed, 5 Feb 2014 22:26:24 -0700 (MST) From: Nate Eldredge X-X-Sender: nate@minerva.lan To: Suresh Siddha cc: Linus Torvalds , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , stable , Linux Kernel Mailing List , Maarten Baert , Jan Kara , George Spelvin , Pekka Riikonen Subject: Re: [PATCH] Make math_state_restore() save and restore the interrupt flag In-Reply-To: <1391410583.3801.6.camel@europa> Message-ID: References: <1391325599.6481.5.camel@europa> <1391410583.3801.6.camel@europa> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2 Feb 2014, Suresh Siddha wrote: > Here is the second patch, which should fix the issue reported in this > thread. Maarten, Nate, George, please give this patch a try as is and > see if it helps address the issue you ran into. And please ack/review > with your test results. 3.13 plus this patch: boots and fixes the testcase I reported (core dump on ecrypt). Tested-by: Nate Eldredge > diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c > index 4e5f770..670bba1 100644 > --- a/arch/x86/kernel/i387.c > +++ b/arch/x86/kernel/i387.c > @@ -87,10 +87,19 @@ EXPORT_SYMBOL(__kernel_fpu_begin); > > void __kernel_fpu_end(void) > { > - if (use_eager_fpu()) > - math_state_restore(); > - else > + if (use_eager_fpu()) { > + /* > + * For eager fpu, most the time, tsk_used_math() is true. > + * Restore the user math as we are done with the kernel usage. > + * At few instances during thread exit, signal handling etc, > + * tsk_used_math() is false. Those few places will take proper > + * actions, so we don't need to restore the math here. > + */ > + if (likely(tsk_used_math(current))) > + math_state_restore(); > + } else { > stts(); > + } > } > EXPORT_SYMBOL(__kernel_fpu_end); -- Nate Eldredge nate@thatsmathematics.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/