Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933918AbbDIJCX (ORCPT ); Thu, 9 Apr 2015 05:02:23 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51771 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933739AbbDIJCQ (ORCPT ); Thu, 9 Apr 2015 05:02:16 -0400 Date: Thu, 9 Apr 2015 02:01:16 -0700 From: tip-bot for Anton Blanchard Message-ID: Cc: tglx@linutronix.de, hpa@zytor.com, paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, mingo@kernel.org, peterz@infradead.org, anton@samba.org Reply-To: akpm@linux-foundation.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, tglx@linutronix.de, hpa@zytor.com, peterz@infradead.org, anton@samba.org, mingo@kernel.org In-Reply-To: <1428551492-21977-2-git-send-email-anton@samba.org> References: <1428551492-21977-2-git-send-email-anton@samba.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] jump_label: Allow jump labels to be used in assembly Git-Commit-ID: c0ccf6f99e3a43b87980c9df7da48427885206d0 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3502 Lines: 117 Commit-ID: c0ccf6f99e3a43b87980c9df7da48427885206d0 Gitweb: http://git.kernel.org/tip/c0ccf6f99e3a43b87980c9df7da48427885206d0 Author: Anton Blanchard AuthorDate: Thu, 9 Apr 2015 13:51:31 +1000 Committer: Ingo Molnar CommitDate: Thu, 9 Apr 2015 09:40:24 +0200 jump_label: Allow jump labels to be used in assembly To use jump labels in assembly we need the HAVE_JUMP_LABEL define, so we select a fallback version if the toolchain does not support them. Modify linux/jump_label.h so it can be included by assembly files. We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS. Signed-off-by: Anton Blanchard Acked-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: benh@kernel.crashing.org Cc: catalin.marinas@arm.com Cc: davem@davemloft.net Cc: heiko.carstens@de.ibm.com Cc: jbaron@akamai.com Cc: linux@arm.linux.org.uk Cc: linuxppc-dev@lists.ozlabs.org Cc: liuj97@gmail.com Cc: mgorman@suse.de Cc: mmarek@suse.cz Cc: mpe@ellerman.id.au Cc: paulus@samba.org Cc: ralf@linux-mips.org Cc: rostedt@goodmis.org Cc: schwidefsky@de.ibm.com Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/1428551492-21977-2-git-send-email-anton@samba.org Signed-off-by: Ingo Molnar --- Makefile | 1 + include/linux/jump_label.h | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9fab639..a2aa475 100644 --- a/Makefile +++ b/Makefile @@ -779,6 +779,7 @@ KBUILD_ARFLAGS := $(call ar-option,D) # check for 'asm goto' ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO + KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO endif include $(srctree)/scripts/Makefile.kasan diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 98f923b6..f4de473 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h @@ -45,6 +45,12 @@ * same as using STATIC_KEY_INIT_FALSE. */ +#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) +# define HAVE_JUMP_LABEL +#endif + +#ifndef __ASSEMBLY__ + #include #include #include @@ -55,7 +61,7 @@ extern bool static_key_initialized; "%s used before call to jump_label_init", \ __func__) -#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) +#ifdef HAVE_JUMP_LABEL struct static_key { atomic_t enabled; @@ -66,13 +72,18 @@ struct static_key { #endif }; -# include -# define HAVE_JUMP_LABEL #else struct static_key { atomic_t enabled; }; -#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */ +#endif /* HAVE_JUMP_LABEL */ +#endif /* __ASSEMBLY__ */ + +#ifdef HAVE_JUMP_LABEL +#include +#endif + +#ifndef __ASSEMBLY__ enum jump_label_type { JUMP_LABEL_DISABLE = 0, @@ -203,3 +214,5 @@ static inline bool static_key_enabled(struct static_key *key) } #endif /* _LINUX_JUMP_LABEL_H */ + +#endif /* __ASSEMBLY__ */ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/