Re: [PATCH -v2 6/8] jump_label: Add a new static_key interface

From: Rabin Vincent
Date: Tue Jul 28 2015 - 13:01:09 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/