lkml.org 
[lkml]   [2020]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [patch V6 07/37] x86/entry: Provide helpers for execute on irqstack
On Wed, May 20, 2020 at 8:27 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> Andy Lutomirski <luto@kernel.org> writes:
> > On Wed, May 20, 2020 at 5:35 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> >>
> >> Andy Lutomirski <luto@kernel.org> writes:
> >> > On Mon, May 18, 2020 at 4:53 PM Thomas Gleixner <tglx@linutronix.de> wrote:
> >> >>
> >> >> Andy Lutomirski <luto@kernel.org> writes:
> >> >> > Actually, I revoke my ack. Can you make one of two changes:
> >> >> >
> >> >> > Option A: Add an assertion to run_on_irqstack to verify that irq_count
> >> >> > was -1 at the beginning? I suppose this also means you could just
> >> >> > explicitly write 0 instead of adding and subtracting.
> >> >> >
> >> >> > Option B: Make run_on_irqstack() just call the function on the current
> >> >> > stack if we're already on the irq stack.
> >> >> >
> >> >> > Right now, it's too easy to mess up and not verify the right
> >> >> > precondition before calling run_on_irqstack().
> >> >> >
> >> >> > If you choose A, perhaps add a helper to do the if(irq_needs_irqstack)
> >> >> > dance so that users can just do:
> >> >> >
> >> >> > run_on_irqstack_if_needed(...);
> >> >> >
> >> >> > instead of checking everything themselves.
> >> >>
> >> >> I'll have a look tomorrow morning with brain awake.
> >> >
> >> > Also, reading more of the series, I suspect that asm_call_on_stack is
> >> > logically in the wrong section or that the noinstr stuff is otherwise
> >> > not quite right. I think that objtool should not accept
> >> > run_on_irqstack() from noinstr code. See followups on patch 10.
> >>
> >> It's in entry.text which is non-instrumentable as well.
> >
> > Hmm. I suppose we can chalk this up to the noinstr checking not being
> > entirely perfect.
>
> objtool considers both entry.text and noinstr.text. We just can't stick
> everything into entry.text for these !%@#45@# reasons.
>

Meh, this is all fine I think. I think it would be slightly nicer if
objtool were to warn if noinstr code called run_on_stack(), but I'm
not sure it matters much.

\
 
 \ /
  Last update: 2020-05-20 17:37    [W:0.107 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site