Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

objtool: Make unreachable annotation inline asms explicitly volatile

Add 'volatile' to the unreachable annotation macro inline asm
statements. They're already implicitly volatile because they don't have
output constraints, but it's clearer and more robust to make them
explicitly volatile.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/28659257b7a6adf4a7f65920dad70b2b0226e996.1509974104.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Josh Poimboeuf and committed by
Ingo Molnar
10259821 d0c2e691

+8 -8
+8 -8
include/linux/compiler.h
··· 193 193 * unique, to convince GCC not to merge duplicate inline asm statements. 194 194 */ 195 195 #define annotate_reachable() ({ \ 196 - asm("%c0:\n\t" \ 197 - ".pushsection .discard.reachable\n\t" \ 198 - ".long %c0b - .\n\t" \ 199 - ".popsection\n\t" : : "i" (__COUNTER__)); \ 196 + asm volatile("%c0:\n\t" \ 197 + ".pushsection .discard.reachable\n\t" \ 198 + ".long %c0b - .\n\t" \ 199 + ".popsection\n\t" : : "i" (__COUNTER__)); \ 200 200 }) 201 201 #define annotate_unreachable() ({ \ 202 - asm("%c0:\n\t" \ 203 - ".pushsection .discard.unreachable\n\t" \ 204 - ".long %c0b - .\n\t" \ 205 - ".popsection\n\t" : : "i" (__COUNTER__)); \ 202 + asm volatile("%c0:\n\t" \ 203 + ".pushsection .discard.unreachable\n\t" \ 204 + ".long %c0b - .\n\t" \ 205 + ".popsection\n\t" : : "i" (__COUNTER__)); \ 206 206 }) 207 207 #define ASM_UNREACHABLE \ 208 208 "999:\n\t" \