From: Rabin Vincent <rabin@rab.in>
To: Peter Zijlstra <peterz@infradead.org>
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
Date: Tue, 28 Jul 2015 19:00:55 +0200 [thread overview]
Message-ID: <20150728170055.GA402@debian> (raw)
In-Reply-To: <20150728132313.164884020@infradead.org>
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 <linux/types.h>
+#include <asm/unified.h>
#define JUMP_LABEL_NOP_SIZE 4
With that added, it builds and works fine on ARM.
next prev parent reply other threads:[~2015-07-28 17:01 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 13:20 [PATCH -v2 0/8] jump_label: Another (better) static_key interface Peter Zijlstra
2015-07-28 13:20 ` [PATCH -v2 1/8] jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE Peter Zijlstra
2015-07-28 13:20 ` [PATCH -v2 2/8] jump_label: Rename JUMP_LABEL_TYPE_* Peter Zijlstra
2015-07-29 12:58 ` Borislav Petkov
2015-07-28 13:20 ` [PATCH -v2 3/8] jump_label: Add jump_entry_key() helper Peter Zijlstra
2015-07-28 13:20 ` [PATCH -v2 4/8] jump_label: Add static_key_{en,dis}able() helpers Peter Zijlstra
2015-07-28 13:21 ` [PATCH -v2 5/8] jump_label: Rework update logic Peter Zijlstra
2015-07-28 13:21 ` [PATCH -v2 6/8] jump_label: Add a new static_key interface Peter Zijlstra
2015-07-28 17:00 ` Rabin Vincent [this message]
2015-07-28 17:20 ` Peter Zijlstra
2015-07-29 6:43 ` Heiko Carstens
2015-07-29 7:19 ` Vlastimil Babka
2015-07-29 8:49 ` Peter Zijlstra
2015-08-03 19:03 ` Steven Rostedt
2015-08-03 19:18 ` Peter Zijlstra
2015-08-03 19:28 ` Steven Rostedt
2015-08-03 20:00 ` Peter Zijlstra
2015-08-03 21:57 ` Steven Rostedt
2015-08-04 3:37 ` Borislav Petkov
2015-08-04 4:07 ` Andy Lutomirski
2015-08-04 4:21 ` Borislav Petkov
2015-08-04 12:06 ` Steven Rostedt
2015-08-04 14:33 ` Borislav Petkov
2015-08-04 14:41 ` Steven Rostedt
2015-08-04 14:51 ` Andy Lutomirski
2015-07-30 12:18 ` Michael Ellerman
2015-08-04 6:50 ` yalin wang
2015-08-04 9:15 ` Peter Zijlstra
2015-07-28 13:21 ` [PATCH -v2 7/8] jump_label: Add selftest Peter Zijlstra
2015-07-28 21:46 ` Jason Baron
2015-07-29 8:53 ` Peter Zijlstra
2015-07-28 13:21 ` [PATCH -v2 8/8] x86, tsc: Employ static_branch_likely() Peter Zijlstra
2015-07-29 14:07 ` Borislav Petkov
2015-07-29 6:46 ` [PATCH -v2 0/8] jump_label: Another (better) static_key interface Heiko Carstens
2015-07-29 8:58 ` Peter Zijlstra
2015-08-03 17:03 ` [tip:locking/core] s390/uaccess, locking/static_keys: employ static_branch_likely() tip-bot for Heiko Carstens
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=20150728170055.GA402@debian \
--to=rabin@rab.in \
--cc=benh@kernel.crashing.org \
--cc=bp@alien8.de \
--cc=davem@davemloft.net \
--cc=ddaney@caviumnetworks.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jasonbaron0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liuj97@gmail.com \
--cc=luto@amacapital.net \
--cc=michael@ellerman.id.au \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=ralf@linux-mips.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=vbabka@suse.cz \
--cc=will.deacon@arm.com \
/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