From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754030AbbCGKgT (ORCPT ); Sat, 7 Mar 2015 05:36:19 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:44486 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753003AbbCGKgS (ORCPT ); Sat, 7 Mar 2015 05:36:18 -0500 Date: Sat, 7 Mar 2015 11:36:13 +0100 From: Ingo Molnar To: Andy Lutomirski Cc: Linus Torvalds , Oleg Nesterov , Dave Hansen , Borislav Petkov , 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: <20150307103613.GB9378@gmail.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.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > On Fri, Mar 6, 2015 at 2:00 PM, Linus Torvalds > wrote: > > On Fri, Mar 6, 2015 at 11:23 AM, Andy Lutomirski wrote: > >> > >> Please don't. IMO it's really nice that we don't use trap gates at > >> all on x86_64, and I find the conditional_sti thing much nicer than > >> having to audit all of the entry code to see whether it's safe to run > >> it with IRQs on. > > > > So I'm not sure I see much difference, but I'd certainly be ok with > > just moving the "conditional_sti()" up unconditionally to be the first > > thing in do_device_not_available(). > > I'd be fine with that. The important difference is that it's after swapgs. The thing is, we have to be careful about NMI contexts anyway. So how about being careful in irq contexts as well? We could shave a good 10 cycles from the FPU trap overhead, maybe more? We could save the same 10 cycles from page fault overhead as well, AFAICS. Hm? Thanks, Ingo