lkml.org 
[lkml]   [2018]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/7] x86/idle: Disable IBRS entering idle and enable it on wakeup
On Thu, Jan 04, 2018 at 11:47:31PM +0100, Peter Zijlstra wrote:
> Argh.. no. Who is calling this with IRQs enabled? And why can't we frob
> the MSR with IRQs enabled? That comment doesn't seem to explain
> anything.

Why we can't is easy to explain, the irq handler would run in such
case and that isn't using save paranoid, it relies on KERNEL_CS and it
assumes IBRS already set.

The irqs_disabled() check can be dropped if you do enough verification
that it never happens. Initially it wasn't obvious the irq disabled
invariant would be always enforced from the multitude of callers it
has (and that varies on different codebases). I didn't want to deal
with such an occurrence and risk even more trouble. Later I did the
verifications and I dropped the irqs_disabled() too.

It should be possible to drop it but it generally doesn't hurt to
start more obviously safe and optimize it later.

\
 
 \ /
  Last update: 2018-01-05 00:01    [W:0.531 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site