Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1464845

Re: RFC: Petition Intel/AMD to add POPF_IF insn

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: RFC: Petition Intel/AMD to add POPF_IF insn
Date 2016-08-18 00:40 +0200
Message-ID <s7hF8-7AW-7@gated-at.bofh.it> (permalink)
References (6 earlier) <s7eQV-5ow-7@gated-at.bofh.it> <s7eQV-5ow-23@gated-at.bofh.it> <s7gzo-6R5-31@gated-at.bofh.it> <s7gJ4-6VE-43@gated-at.bofh.it> <s7gSK-6Zu-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-17 19:30 +0200
  Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 20:00 +0200
    Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-17 21:00 +0200
      Re: RFC: Petition Intel/AMD to add POPF_IF insn Andy Lutomirski <luto@amacapital.net> - 2016-08-17 21:20 +0200
        Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-17 21:30 +0200
          Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-17 21:40 +0200
            Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 22:00 +0200
          Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 21:40 +0200
            Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 23:30 +0200
              Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 23:40 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Andy Lutomirski <luto@amacapital.net> - 2016-08-17 23:50 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-18 00:40 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-18 15:30 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-19 03:00 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-19 03:10 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-19 04:30 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Paolo Bonzini <pbonzini@redhat.com> - 2016-08-19 13:00 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-18 11:30 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-18 14:20 +0200
                Re: RFC: Petition Intel/AMD to add POPF_IF insn Paolo Bonzini <pbonzini@redhat.com> - 2016-08-19 04:10 +0200
          Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 21:50 +0200
        Re: RFC: Petition Intel/AMD to add POPF_IF insn Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 21:30 +0200
  Re: RFC: Petition Intel/AMD to add POPF_IF insn Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-17 20:40 +0200

csiph-web