Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1192907

Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface
Date 2015-07-27 12:00 +0200
Message-ID <pQNmp-6qa-3@gated-at.bofh.it> (permalink)
References <pPPzX-4Yj-5@gated-at.bofh.it> <pPPzY-4Yj-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jul 24, 2015 at 07:52:15PM +0200, Peter Zijlstra wrote:
> --- a/arch/s390/include/asm/jump_label.h
> +++ b/arch/s390/include/asm/jump_label.h
> @@ -12,14 +12,29 @@
>   * We use a brcl 0,2 instruction for jump labels at compile time so it
>   * can be easily distinguished from a hotpatch generated instruction.
>   */
> -static __always_inline bool arch_static_branch(struct static_key *key)
> +static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
>  {
>  	asm_volatile_goto("0:	brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n"
>  		".pushsection __jump_table, \"aw\"\n"
>  		".balign 8\n"
>  		".quad 0b, %l[label], %0\n"
>  		".popsection\n"
> -		: : "X" (key) : : label);
> +		: : "X" (&((char *)key)[branch]) : : label);
> +
> +	return false;
> +label:
> +	return true;
> +}
> +
> +static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
> +{
> +	asm_volatile_goto("0:	j %l[l_yes]\n"

Looking at the s390 version of jump_label_make_branch(), this should
have been:

		"brcl 15, %l[l_yes]\n"

I suppose?

> +		".pushsection __jump_table, \"aw\"\n"
> +		".balign 8\n"
> +		".quad 0b, %l[label], %0\n"
> +		".popsection\n"
> +		: : "X" (&((char *)key)[branch]) : : label);
> +
>  	return false;
>  label:
>  	return true;
--
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/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface Peter Zijlstra <peterz@infradead.org> - 2015-07-27 12:00 +0200
  Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface Heiko Carstens <heiko.carstens@de.ibm.com> - 2015-07-27 12:30 +0200
    Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface Peter Zijlstra <peterz@infradead.org> - 2015-07-27 12:50 +0200
      Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface Heiko Carstens <heiko.carstens@de.ibm.com> - 2015-07-27 13:00 +0200
        Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface Peter Zijlstra <peterz@infradead.org> - 2015-07-27 16:40 +0200
      Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface Peter Zijlstra <peterz@infradead.org> - 2015-07-27 13:00 +0200

csiph-web