public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>,
	Matt Fleming <matt.fleming@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Ricardo Neri <ricardo.neri-calderon@linux.intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-tip-commits@vger.kernel.org" 
	<linux-tip-commits@vger.kernel.org>
Subject: Re: [tip:x86/efi] x86/efi: Check for unsafe dealing with FPU state in irq ctxt
Date: Thu, 05 Jun 2014 09:43:07 -0700	[thread overview]
Message-ID: <53909E1B.3020503@zytor.com> (raw)
In-Reply-To: <CALCETrVhN36asNbx40BTK8TU3eCLq36-hh-i1MKMw=iL=5_m0A@mail.gmail.com>

On 06/05/2014 09:35 AM, Andy Lutomirski wrote:
>>
>> The bottom line is that we can't call EFI from a context where we can't
>> use the FPU.  Or specifically, we can't then resume execution.  If all
>> we're doing is stashing away some data before dying, well, then, by all
>> means - but we need to make sure that is what actually happens.
> 
> I bet we have to be extra careful about EFI: I imagine that, if we
> take an NMI or MCE while in EFI code, another call into EFI is a
> terrible idea, which might be a good reason to have the EFI code track
> its own context and prevent nesting.
> 

I strongly suspect we also want to make sure that we don't ever let more
than one CPU into EFI context.  This would also make it possible to have
a dedicated XSAVE buffer for EFI.

Now, the tricky part: what do we do if another CPU is already in EFI and
we want to do something.

> 
> I suppose it's a question of how valuable making a change like this
> would be (two per-thread xstate areas plus a bunch per cpu, say).  I
> doubt that the memory usage matters much, but writing and maintaining
> it will be a mild PITA.  Maybe no worse than the current stuff.
> 
> What are the major users?  If it worked really well, we could enable
> SSE for all kernel code, but at least all the crypto stuff would
> benefit a lot.
> 

No, enabling SSE for all kernel code would force us to context-switch on
any kernel entry or exit, which is way too expensive for what it gains.
 However, perhaps the realtime people will be happier if we don't have
to stop preemption.

	-hpa



  reply	other threads:[~2014-06-05 16:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tip-baa916f39b50ad91661534652110df40396acda0@git.kernel.org>
2014-06-04 22:17 ` [tip:x86/efi] x86/efi: Check for unsafe dealing with FPU state in irq ctxt H. Peter Anvin
2014-06-04 22:49   ` Borislav Petkov
2014-06-04 22:52     ` H. Peter Anvin
2014-06-05  0:19     ` Andy Lutomirski
2014-06-05  7:18       ` Borislav Petkov
2014-06-05  8:49         ` Matt Fleming
2014-06-05  9:02           ` Borislav Petkov
2014-06-05 15:44             ` Andy Lutomirski
2014-06-05 15:53               ` Borislav Petkov
2014-06-05 16:01                 ` Andy Lutomirski
2014-06-05 16:08                   ` Borislav Petkov
2014-06-05 16:14                     ` Andy Lutomirski
2014-06-05 16:18                       ` Borislav Petkov
2014-06-05 16:31                         ` H. Peter Anvin
2014-06-05 16:35                           ` Andy Lutomirski
2014-06-05 16:43                             ` H. Peter Anvin [this message]
2014-06-05 16:37                           ` Borislav Petkov
2014-06-05 16:43                             ` H. Peter Anvin
2014-06-05 16:44                               ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53909E1B.3020503@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=matt.fleming@intel.com \
    --cc=mingo@kernel.org \
    --cc=ricardo.neri-calderon@linux.intel.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox