Messages in this thread | | | From | Linus Torvalds <> | Date | Wed, 17 Aug 2016 12:37:35 -0700 | Subject | Re: RFC: Petition Intel/AMD to add POPF_IF insn |
| |
On Wed, Aug 17, 2016 at 12:32 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote: > > The 2-page pseudo-code is about behavior. It's trivial to > short-circuit. There are obvious optimizations, which involve just > making the rare cases go slow and have a trivial "if those bits didn't > change, don't go through the expense of testing them".
That said, the first thing we should test is to just see how the "let's just optimize this in software" thing works.
Replace the "popf" with "if (val & X86_EFLAGS_IF) local_irq_enable();" and see how that works out. Play with inlining it or not, and see if the branch predictor matters.
We may simply not need popf optimizations.
Linus
| |