lkml.org 
[lkml]   [2016]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: RFC: Petition Intel/AMD to add POPF_IF insn
On Wed, Aug 17, 2016 at 2:43 PM, Andy Lutomirski <luto@amacapital.net> wrote:
>
> It shouldn't be *too* bad, since xen_restore_fl only affects "IF".
> And even if native_restore_fl needs to be able to turn IRQs off as
> well as on, we can just do:
>
> if (likely(flags & X86_EFLAGS_IF))
> sti();
> else
> cli();
>
> at some cost to code size but hopefully little to no runtime cost for
> the sane cases.

No, that would be horrible for the case where we had an irq spinlock
in an irq-region. Then we'd have a pointless "cli" there.

So I'd rather just make sure that only the spinlock code actually uses
native_restore_fl().

And yes, the patch works at least minimally, since I'm writing this
with a kernel compiled with that.

Of course, somebody really should do timings on modern CPU's (in cpl0,
comparing native_fl() that enables interrupts with a popf)

Linus

\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.121 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site