[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201210110319.GA88655@C02TD0UTHF1T.local>
Date: Thu, 10 Dec 2020 11:03:19 +0000
From: Mark Rutland <mark.rutland@....com>
To: Andy Lutomirski <luto@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
Juergen Gross <jgross@...e.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] lockdep: report broken irq restoration
On Wed, Dec 09, 2020 at 11:05:21AM -0800, Andy Lutomirski wrote:
> On Wed, Dec 9, 2020 at 10:33 AM Mark Rutland <mark.rutland@....com> wrote:
> > diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
> > index 3ed4e8771b64..bca3c6fa8270 100644
> > --- a/include/linux/irqflags.h
> > +++ b/include/linux/irqflags.h
> > @@ -220,10 +220,26 @@ do { \
> >
> > #else /* !CONFIG_TRACE_IRQFLAGS */
> >
> > +#ifdef CONFIG_DEBUG_IRQFLAGS
> > +extern void warn_bogus_irq_restore(bool *warned);
> > +#define check_bogus_irq_restore() \
> > + do { \
> > + static bool __section(".data.once") __warned; \
> > + if (unlikely(!raw_irqs_disabled())) \
> > + warn_bogus_irq_restore(&__warned); \
> > + } while (0)
>
> What's the benefit of having a per-caller __warned instead of just
> having a single global one in warn_bogus_irq_restore()?
I'd copied that from the previous proposal, and had assumed that if we
had several distinct violations we'd want to report all of them in one
boot session. I'm perfectly happy to get rid of that and make
warn_bogus_irq_restore() use WARN_ONCE() directly.
I'm using this with a local Syzkaller instance, and as that will kill
the kernel on the first WARN() anyway, it makes no difference to me. I
guess in the field having a single warning is likely to be good enough
too.
Thanks,
Mark.
Powered by blists - more mailing lists