lkml.org 
[lkml]   [2020]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 05/12] x86: rework arch_local_irq_restore() to not use popf
    On Fri, Nov 20, 2020 at 12:46:23PM +0100, Juergen Gross wrote:
    > +static __always_inline void arch_local_irq_restore(unsigned long flags)
    > +{
    > + if (!arch_irqs_disabled_flags(flags))
    > + arch_local_irq_enable();
    > +}

    If someone were to write horrible code like:

    local_irq_disable();
    local_irq_save(flags);
    local_irq_enable();
    local_irq_restore(flags);

    we'd be up some creek without a paddle... now I don't _think_ we have
    genius code like that, but I'd feel saver if we can haz an assertion in
    there somewhere...

    Maybe something like:

    #ifdef CONFIG_DEBUG_ENTRY // for lack of something saner
    WARN_ON_ONCE((arch_local_save_flags() ^ flags) & X86_EFLAGS_IF);
    #endif

    At the end?

    \
     
     \ /
      Last update: 2020-11-20 13:01    [W:4.241 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site