Re: [PATCH 1/1] x86/fpu: math_state_restore() should not blindly disable irqs

Andy Lutomirski
2015-03-06T22:28:55Z

On Fri, Mar 6, 2015 at 2:00 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Fri, Mar 6, 2015 at 11:23 AM, Andy Lutomirski <luto@amacapital.net> 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.

--Andy

>
> The point being that we still *not* just randomly enable interrupts
> because we decide that the callers are wrong.
>
> Linus

--
Andy Lutomirski
AMA Capital Management, LLC