Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752864AbbG1RBF (ORCPT ); Tue, 28 Jul 2015 13:01:05 -0400 Received: from mail-la0-f65.google.com ([209.85.215.65]:33075 "EHLO mail-la0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752461AbbG1RBD (ORCPT ); Tue, 28 Jul 2015 13:01:03 -0400 Date: Tue, 28 Jul 2015 19:00:55 +0200 From: Rabin Vincent To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jasonbaron0@gmail.com, bp@alien8.de, luto@amacapital.net, tglx@linutronix.de, rostedt@goodmis.org, will.deacon@arm.com, liuj97@gmail.com, ralf@linux-mips.org, ddaney@caviumnetworks.com, benh@kernel.crashing.org, michael@ellerman.id.au, heiko.carstens@de.ibm.com, davem@davemloft.net, vbabka@suse.cz Subject: Re: [PATCH -v2 6/8] jump_label: Add a new static_key interface Message-ID: <20150728170055.GA402@debian> References: <20150728132055.203176565@infradead.org> <20150728132313.164884020@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150728132313.164884020@infradead.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1854 Lines: 61 On Tue, Jul 28, 2015 at 03:21:01PM +0200, Peter Zijlstra wrote: > --- a/arch/arm/include/asm/jump_label.h > +++ b/arch/arm/include/asm/jump_label.h > @@ -7,20 +7,28 @@ > > #define JUMP_LABEL_NOP_SIZE 4 > > -#ifdef CONFIG_THUMB2_KERNEL > -#define JUMP_LABEL_NOP "nop.w" > -#else > -#define JUMP_LABEL_NOP "nop" > -#endif > +static __always_inline bool arch_static_branch(struct static_key *key, bool branch) > +{ > + asm_volatile_goto("1:\n\t" > + WASM(nop) "\n\t" > + ".pushsection __jump_table, \"aw\"\n\t" > + ".word 1b, %l[l_yes], %c0\n\t" > + ".popsection\n\t" > + : : "i" (&((char *)key)[branch]) : : l_yes); > + > + return false; > +l_yes: > + return true; > +} > > -static __always_inline bool arch_static_branch(struct static_key *key) > +static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) > { > asm_volatile_goto("1:\n\t" > - JUMP_LABEL_NOP "\n\t" > + WASM(b) " %l[l_yes]\n\t" > ".pushsection __jump_table, \"aw\"\n\t" > ".word 1b, %l[l_yes], %c0\n\t" > ".popsection\n\t" > - : : "i" (key) : : l_yes); > + : : "i" (&((char *)key)[branch]) : : l_yes); > > return false; > l_yes: This is missing an include of asm/unified.h for the WASM(): diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h index f8bc12f..34f7b69 100644 --- a/arch/arm/include/asm/jump_label.h +++ b/arch/arm/include/asm/jump_label.h @@ -4,6 +4,7 @@ #ifndef __ASSEMBLY__ #include +#include #define JUMP_LABEL_NOP_SIZE 4 With that added, it builds and works fine on ARM. -- 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/