From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753269AbbG0Jwd (ORCPT ); Mon, 27 Jul 2015 05:52:33 -0400 Received: from casper.infradead.org ([85.118.1.10]:38283 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbbG0Jwc (ORCPT ); Mon, 27 Jul 2015 05:52:32 -0400 Date: Mon, 27 Jul 2015 11:52:25 +0200 From: Peter Zijlstra To: linux-kernel@vger.kernel.org, mingo@kernel.org Cc: jasonbaron0@gmail.com, bp@alien8.de, luto@amacapital.net, tglx@linutronix.de, rostedt@goodmis.org, will.deacon@arm.com, liuj97@gmail.com, rabin@rab.in, ralf@linux-mips.org, ddaney@caviumnetworks.com, benh@kernel.crashing.org, michael@ellerman.id.au, heiko.carstens@de.ibm.com, davem@davemloft.net Subject: Re: [RFC][PATCH 6/7] jump_label: Add a new static_key interface Message-ID: <20150727095225.GR19282@twins.programming.kicks-ass.net> References: <20150724175209.814173117@infradead.org> <20150724175823.120997211@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150724175823.120997211@infradead.org> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;