linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] objtool: Add a comment for the unreachable annotation macros
@ 2017-11-06 13:17 Josh Poimboeuf
  2017-11-06 13:17 ` [PATCH 2/2] objtool: Make unreachable annotation inline asms explicitly volatile Josh Poimboeuf
  2017-11-07  9:51 ` [tip:core/objtool] objtool: Add a comment for the unreachable annotation macros tip-bot for Josh Poimboeuf
  0 siblings, 2 replies; 4+ messages in thread
From: Josh Poimboeuf @ 2017-11-06 13:17 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Linus Torvalds

Add a comment for the unreachable annotation macros to explain their
purpose and the '__COUNTER__' label hack.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 include/linux/compiler.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 3672353a0acd..b863e5ad91a3 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -88,6 +88,11 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
 
 /* Unreachable code */
 #ifdef CONFIG_STACK_VALIDATION
+/*
+ * These macros help objtool understand GCC code flow for unreachable code.
+ * The __COUNTER__ based labels are a hack to make each instance of the macros
+ * unique, to convince GCC not to merge duplicate inline asm statements.
+ */
 #define annotate_reachable() ({						\
 	asm("%c0:\n\t"							\
 	    ".pushsection .discard.reachable\n\t"			\
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-07  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-06 13:17 [PATCH 1/2] objtool: Add a comment for the unreachable annotation macros Josh Poimboeuf
2017-11-06 13:17 ` [PATCH 2/2] objtool: Make unreachable annotation inline asms explicitly volatile Josh Poimboeuf
2017-11-07  9:52   ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2017-11-07  9:51 ` [tip:core/objtool] objtool: Add a comment for the unreachable annotation macros tip-bot for Josh Poimboeuf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).