[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWX8VaCRB2FcYe6EkFq-yJvXwO8WEcGjT_rDBq=GYX3sw@mail.gmail.com>
Date: Sat, 28 Mar 2015 08:17:42 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Ingo Molnar <mingo@...nel.org>
Cc: "H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Denys Vlasenko <dvlasenk@...hat.com>,
Andy Lutomirski <luto@...nel.org>,
stable <stable@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] x86, ia32entry: Use sysretl to return from sysenter
On Mar 28, 2015 1:35 AM, "Ingo Molnar" <mingo@...nel.org> wrote:
>
>
> * Andy Lutomirski <luto@...nel.org> wrote:
>
> > Sysexit is scary on 64-bit kernels -- sysexit must be invoked with
> > usergs and IRQs on. That means that we rely on sti to correctly
> > mask interrupts for one instruction. This is okay by itself, but
> > the semantics with respect to NMIs are unclear.
>
> At least judging by profiling output I think NMIs observe the STI
> window of one instruction non-execution as well. (But I'm not 100%
> sure.)
>
> > Avoid the whole issue by using sysretl instead. For background,
> > Intel CPUs don't allow syscall from compat mode, but they do allow
> > sysret back to compat mode. Go figure.
> >
> > Oddly this seems to be 30 cycles or so faster. Avoiding popfq and
> > sti will account for under half of that, I think, so my best guess
> > is that Intel just optimizes sysret much better than sysexit.
> >
> > Cc: stable@...r.kernel.org
>
> I like it, but no way is this automatic -stable material ... if proven
> upstream we can forward it as a fix for SYSEXIT fragility, but not
> automatically, IMHO.
Agreed. I wish we had a Stable-after-a-long-soak tag.
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists