From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, torvalds@linux-foundation.org,
fweisbec@gmail.com, hpa@zytor.com, dvlasenk@redhat.com,
peterz@infradead.org, luto@kernel.org, brgerst@gmail.com,
mingo@kernel.org, linux-kernel@vger.kernel.org,
luto@amacapital.net, bp@alien8.de
Subject: [tip:x86/asm] x86/asm: Error out if asm/ jump_label.h is included inappropriately
Date: Tue, 24 Nov 2015 01:35:58 -0800 [thread overview]
Message-ID: <tip-c28454332fe0b65e22c3a2717e5bf05b5b47ca20@git.kernel.org> (raw)
In-Reply-To: <99407f0ac7fa3ab03a3d31ce076d47b5c2f44795.1447361906.git.luto@kernel.org>
Commit-ID: c28454332fe0b65e22c3a2717e5bf05b5b47ca20
Gitweb: http://git.kernel.org/tip/c28454332fe0b65e22c3a2717e5bf05b5b47ca20
Author: Andy Lutomirski <luto@kernel.org>
AuthorDate: Thu, 12 Nov 2015 12:59:02 -0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 24 Nov 2015 09:56:43 +0100
x86/asm: Error out if asm/jump_label.h is included inappropriately
Rather than potentially generating incorrect code on a
non-HAVE_JUMP_LABEL kernel if someone includes asm/jump_label.h,
error out.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/99407f0ac7fa3ab03a3d31ce076d47b5c2f44795.1447361906.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/jump_label.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
index 5daeca3..96872dc 100644
--- a/arch/x86/include/asm/jump_label.h
+++ b/arch/x86/include/asm/jump_label.h
@@ -1,6 +1,19 @@
#ifndef _ASM_X86_JUMP_LABEL_H
#define _ASM_X86_JUMP_LABEL_H
+#ifndef HAVE_JUMP_LABEL
+/*
+ * For better or for worse, if jump labels (the gcc extension) are missing,
+ * then the entire static branch patching infrastructure is compiled out.
+ * If that happens, the code in here will malfunction. Raise a compiler
+ * error instead.
+ *
+ * In theory, jump labels and the static branch patching infrastructure
+ * could be decoupled to fix this.
+ */
+#error asm/jump_label.h included on a non-jump-label kernel
+#endif
+
#ifndef __ASSEMBLY__
#include <linux/stringify.h>
next prev parent reply other threads:[~2015-11-24 9:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-12 20:58 [PATCH v3 0/5] x86 entry stuff, maybe for 4.4 Andy Lutomirski
2015-11-12 20:59 ` [PATCH v3 1/5] x86/entry/64: Fix irqflag tracing wrt context tracking Andy Lutomirski
2015-11-24 9:35 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-11-12 20:59 ` [PATCH v3 2/5] context_tracking: Switch to new static_branch API Andy Lutomirski
2015-11-24 9:35 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-11-12 20:59 ` [PATCH v3 3/5] x86/asm: Error out if asm/jump_label.h is included inappropriately Andy Lutomirski
2015-11-13 14:13 ` Thomas Gleixner
2015-11-24 9:35 ` tip-bot for Andy Lutomirski [this message]
2015-11-12 20:59 ` [PATCH v3 4/5] x86/asm: Add asm macros for static keys/jump labels Andy Lutomirski
2015-11-13 14:22 ` Thomas Gleixner
2015-11-24 9:36 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-11-12 20:59 ` [PATCH v3 5/5] x86/entry/64: Bypass enter_from_user_mode on non-context-tracking boots Andy Lutomirski
2015-11-13 14:23 ` Thomas Gleixner
2015-11-13 15:26 ` Frederic Weisbecker
2015-11-16 19:10 ` Andy Lutomirski
2015-11-16 22:50 ` Frederic Weisbecker
2015-11-16 23:57 ` Andy Lutomirski
2015-11-19 0:57 ` Frederic Weisbecker
2015-11-24 9:36 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-c28454332fe0b65e22c3a2717e5bf05b5b47ca20@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox