[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201217143640.GZ3040@hirez.programming.kicks-ass.net>
Date: Thu, 17 Dec 2020 15:36:40 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Mark Rutland <mark.rutland@....com>
Cc: linux-kernel@...r.kernel.org, Andy Lutomirski <luto@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Juergen Gross <jgross@...e.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] lockdep: report broken irq restoration
On Wed, Dec 09, 2020 at 06:33:37PM +0000, Mark Rutland wrote:
> This means that a seuence such as:
+q
> 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)
> +#else
> +#define check_bogus_irq_restore() do { } while (0)
> +#endif
> +
> #define local_irq_enable() do { raw_local_irq_enable(); } while (0)
> #define local_irq_disable() do { raw_local_irq_disable(); } while (0)
> #define local_irq_save(flags) do { raw_local_irq_save(flags); } while (0)
> -#define local_irq_restore(flags) do { raw_local_irq_restore(flags); } while (0)
> +#define local_irq_restore(flags) \
> + do { \
> + check_bogus_irq_restore(); \
> + raw_local_irq_restore(flags); \
> + } while (0)
Shouldn't that be in raw_local_irq_restore() ?
> #define safe_halt() do { raw_safe_halt(); } while (0)
>
> #endif /* CONFIG_TRACE_IRQFLAGS */
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -162,6 +162,7 @@ do { \
#define raw_local_irq_restore(flags) \
do { \
typecheck(unsigned long, flags); \
+ check_bogus_irq_restore(); \
arch_local_irq_restore(flags); \
} while (0)
#define raw_local_save_flags(flags) \
@@ -235,11 +236,7 @@ extern void warn_bogus_irq_restore(bool
#define local_irq_enable() do { raw_local_irq_enable(); } while (0)
#define local_irq_disable() do { raw_local_irq_disable(); } while (0)
#define local_irq_save(flags) do { raw_local_irq_save(flags); } while (0)
-#define local_irq_restore(flags) \
- do { \
- check_bogus_irq_restore(); \
- raw_local_irq_restore(flags); \
- } while (0)
+#define local_irq_restore(flags) do { raw_local_irq_restore(flags); } while (0)
#define safe_halt() do { raw_safe_halt(); } while (0)
#endif /* CONFIG_TRACE_IRQFLAGS */
Powered by blists - more mailing lists