From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754408AbbCFSRd (ORCPT ); Fri, 6 Mar 2015 13:17:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42011 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbbCFSRc (ORCPT ); Fri, 6 Mar 2015 13:17:32 -0500 Date: Fri, 6 Mar 2015 19:15:25 +0100 From: Oleg Nesterov To: Linus Torvalds Cc: Ingo Molnar , Dave Hansen , Borislav Petkov , Andy Lutomirski , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: Re: [PATCH 1/1] x86/fpu: math_state_restore() should not blindly disable irqs Message-ID: <20150306181525.GA1896@redhat.com> References: <54F74F59.5070107@intel.com> <20150305195127.GA12657@redhat.com> <20150305195149.GB12657@redhat.com> <20150305201101.GA21571@gmail.com> <20150305212532.GA16890@redhat.com> <20150306075833.GA623@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/06, Linus Torvalds wrote: > > On Thu, Mar 5, 2015 at 11:58 PM, Ingo Molnar wrote: > > > > math_state_restore() was historically called with irqs disabled, > > because that's how the hardware generates the trap, and also because > > back in the days it was possible for it to be an asynchronous > > interrupt and interrupt handlers run with irqs off. > > > > These days it's always an instruction trap, and furthermore it does > > inevitably complex things such as memory allocation and signal > > processing, which is not done with irqs disabled. > > > > So keep irqs enabled. > > I agree with the "keep irqs enabled". Me too, but not for stable. This patch is wrong without other changes. > IOW, I think the starting point should be something like the attached > (which doesn't do the WARN_ON_ONCE() - it should be added for > debugging). Yes, agreed. And. Even if we forget about stable, we need some minor changes before this one. At least we need to add preempt_disable() into kernel_fpu_disable(). So I still think that the horrible hack I sent makes sense for -stable. Just we need to cleanup (kill) it "immediately". Oleg.