From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750968AbbCGPkk (ORCPT ); Sat, 7 Mar 2015 10:40:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46847 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbbCGPkh (ORCPT ); Sat, 7 Mar 2015 10:40:37 -0500 Date: Sat, 7 Mar 2015 16:38:24 +0100 From: Oleg Nesterov To: Dave Hansen , Borislav Petkov , Ingo Molnar Cc: Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: [PATCH 0/1] x86/fpu: x86/fpu: avoid math_state_restore() without used_math() in __restore_xstate_sig() Message-ID: <20150307153824.GA25954@redhat.com> References: <54F74F59.5070107@intel.com> <20150305195127.GA12657@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305195127.GA12657@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/05, Oleg Nesterov wrote: > > The patch is horrible, yes. But simple, and math_state_restore/init_fpu > are already horrible and need the cleanups. OK, nobody liked it. How about this one for stable? Ingo, Linus, Andy. I do agree, math_state_restore() should be called with irqs enabled. And I was going to do this too. But this is wrong without other changed. I hope I send them soon. We need to remove this !tsk_used_math() code from math_state_restore(). And init_fpu() should die. Just look at __restore_xstate_sig() changed by this patch. Why does it call init_fpu() ? We only need fpu_alloc(). fpu_finit() is pointless, we are going to overwrite fpu->state. used_math() makes no sense at this point. user_fpu_begin() and math_state_restore() should set this flag. And other changes. Could you please review? Oleg.