All of lore.kernel.org
 help / color / mirror / Atom feed
* EFI mixed mode + perf = rampant triple faults
@ 2014-12-17 16:51 Andy Lutomirski
  2014-12-17 16:54 ` Andy Lutomirski
  0 siblings, 1 reply; 19+ messages in thread
From: Andy Lutomirski @ 2014-12-17 16:51 UTC (permalink / raw)
  To: linux-efi, LKML

I figured I should send this email before I forget about this issue:

If you run perf record across any EFI mixed mode call or otherwise
receive an NMI or MCE, the machine triple-faults.  The cause is
straightforward: there is no valid IDT when we have long mode disabled
for the duration of the EFI call.

As far as I know, the only way to have continuously functional interrupt
handling across a long mode transition is to install an interrupt vector
table and hope that CPUs actually do something intelligent when
receiving an interrupt with LME=1, LMA=1, and PG=0.  Yuck.

Could we get away with issuing 32-bit EFI calls in compat mode, i.e.
with a 32-bit CPL0 CS but while still in long mode?  I think that
delivery of an IST interrupt (which includes both NMI and MCE) will
correctly switch to a fully valid 64-bit state and would correctly
switch back when we execute IRET at the end.  (Am I missing some reason
that switching bitness without a privilege level change doesn't work
well?  I haven't thought of anything, other than the lack of SS controls
on intra-ring interrupts, but that shouldn't be an issue here.)

As an added benefit, this would considerably simplify the code.

--Andy

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-01-15 22:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-17 16:51 EFI mixed mode + perf = rampant triple faults Andy Lutomirski
2014-12-17 16:54 ` Andy Lutomirski
2014-12-31 18:37   ` Matt Fleming
     [not found]     ` <20141231183739.GA28946-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2015-01-14 16:51       ` Matt Fleming
2015-01-14 16:51         ` Matt Fleming
     [not found]         ` <20150114165151.GA3479-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-01-14 18:27           ` Andy Lutomirski
2015-01-14 18:27             ` Andy Lutomirski
     [not found]             ` <CALCETrWOxPwoL0zo0UZMk=05uAEqgY-Xovk1=JHwbVtinx3u3w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-14 18:35               ` Borislav Petkov
2015-01-14 18:35                 ` Borislav Petkov
2015-01-14 18:38                 ` Andy Lutomirski
     [not found]                   ` <CALCETrUEfQY-hnmNV9-PfDbEYLa7bVoRcsZc2X0V+mEAbfNH2g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-14 18:47                     ` Borislav Petkov
2015-01-14 18:47                       ` Borislav Petkov
2015-01-14 18:49                       ` Andy Lutomirski
2015-01-15 19:41               ` Matt Fleming
2015-01-15 19:41                 ` Matt Fleming
     [not found]                 ` <20150115194127.GB12079-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-01-15 19:59                   ` H. Peter Anvin
2015-01-15 19:59                     ` H. Peter Anvin
     [not found]                     ` <54B81C2E.2090909-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2015-01-15 22:21                       ` Matt Fleming
2015-01-15 22:21                         ` Matt Fleming

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.