Skip to content

Commit

Permalink
x86/entry, bug: Comment the instrumentation_begin() usage for WARN()
Browse files Browse the repository at this point in the history
Explain the rationale for annotating WARN(), even though, strictly
speaking printk() and friends are very much not safe in many of the
places we put them.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
  • Loading branch information
Peter Zijlstra committed Jun 15, 2020
1 parent 6b643a0 commit 8e8bb06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/x86/include/asm/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ do { \
unreachable(); \
} while (0)

/*
* This instrumentation_begin() is strictly speaking incorrect; but it
* suppresses the complaints from WARN()s in noinstr code. If such a WARN()
* were to trigger, we'd rather wreck the machine in an attempt to get the
* message out than not know about it.
*/
#define __WARN_FLAGS(flags) \
do { \
instrumentation_begin(); \
Expand Down

0 comments on commit 8e8bb06

Please sign in to comment.